开发者

Create contour from Intersecting of triangle mesh and plane

i have problem with creating contour.

I have an STL file, the STL file includes many facets,by intersecting facets with cutting plane(Z=dz,x=y=0), we have an array of lines at each incremental Z.

However lines are not in order.I want t开发者_运维知识库o sort and connect them to form closed contour or continuous path. Please help me with a program or code to solve this problem.


You can do that with the Marching algorithm for contour creation, presented by Rock and Wozny (1). The idea is quite simple, you will be marching from a face to a neighbour face, determine the intersection at their common edge and proceed to the next neighbour. You will repeat this until you get to the starting face. That way you will be building closed contours. For each height flag visited edges in case there is more contours at it.

Create contour from Intersecting of triangle mesh and plane

Marching algorithm, source: (1)

For the algorithm to work, you need to have topological information of the mesh. Each face must reference its three neighboring faces and three edges. Each edge must reference its two vertices and the two faces which define that edge (1). See (2) for how to get that information from an STL file.

Sources:

  • (1) Utilizing Topological Information to Increase Scan Vector Generation Efficiency; Rock and Wozny (the marching algorithm)

  • (2) Generating Topological Information from a "Bucket of Facets"; Rock and Wozny, 1992 (how to create topology from a STL file)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜