Hidden Surface Removal / Visible Surface Determination

在一家初创公司担任数据科学家,工作中遇到一个挑战:如何处理CNC加工和3D打印中不可加工的角落及隐藏表面。隐藏表面移除算法在解决此问题中起到关键作用,涉及到对象空间和图像空间算法,如简单的光线投射(ray casting)、深度缓冲(Z-Buffer)等。目前正逐步实现这些算法以提高精度和效率。
摘要由CSDN通过智能技术生成

Recently I am working as a data scientist at a start-up company in Washington D.C. metro area. Our company is doing new generation manufacturing which involves CNC machining and 3-D Printing.

Customers upload CAD files of the parts they want to build and we (develop team) wrote an engine analyzing the geometry features of the parts and using those geometry variables to predict the quote pricing(which also involves machine learning at certain point).

One big issue is to find parts that contains unmachinable corners (those corners with an infinite radius) and hidden surfaces (surfaces cannot be reached by either the bottom or the side of the machining tools).

To find those unmachinable features, we have to find invisible sides from all the directions. So hidden surface removal is playing an important role.

For the need of quick implement, we referred to the paper: Direct Visibility of Points Sets, which is really a quick and dirty way and works for most of the time. However,
this method would result in false positives at inner corner regions so are “diminished” by the visible and side points by threshold.

So I am currently implement other algorithms which enables the GPU working, such as simple ray tracing which is also called ray casting and z buffering. Here I wanna make a summary on all these visible surface determination algorithms I have learned about recently.

First of all, there are generally two types of approaches:

  • Object precision (space)
    Algorithms do their work on the objects themselves before they are converted to pixels in the frame buffer. The resolution of the display device is irrelevant here as this calculation is done at the mathematical level of the objects
Seudocode:
for each object a in the scene
    determine which parts of object a are visible
    (involves comparing the polyons in object a to other polygons in a
    and to polygons in every other object in the scene)
  • Image precision (space)
    Algorithms do their work as the objects are being converted to pixels in the frame buffer. The resolution of the display device is important here as this is done on a pixel by pixel basis.
Seudocode:
for each pixel in the frame buffer
    determine which polygon is closest to the viewer at that pixel location
    colour the pixel with the colour of that polygon at that location

In most game development cases, the visible surface determination uses the method of image precision which relies on the pixels. However, I think in our manufacturing purpose implementation, we have to do it in object precision.

Object VS. Image Precision

Object Space Algorithms

  • Operate on geometric primitives
    • For each object in the scene, compute the part of it which isn’t obscured by any other object
    • Must perform tests at high precision
    • Resulting information is resolution-independent
  • Complexity

    • Must compare every pair of objects, so O(n2) for n objects
    • For an mm display, have to fill in colors for m2 pixels
    • Overall complexity can be O(kobjn2+kdispm2)
    • Best for scenes with few polygons or resolution-independent output
  • Implementation

    • Difficult to implement
    • Must carefully control numerical error

Image Space Algorithms

  • Operate on pixels
    • For each pixels in the scene, find the object closest to the COP which intersects the projector through that pixel, them draw
    • Perform tests at device resolution, result works only for that resolution
  • Complexity
    • Naive approach checks all n objects at every pixel, then O(nm
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值