Skip to content

MeshBuilder causes self intersections #611

Answered by mozman
MughtyWinky asked this question in Q&A
Discussion options

You must be logged in to vote

Ezdxf is not a sophisticated 3d library so try to keep things simple. In this case you add an n-gon to a MeshBuilder which is basically ok because the main target entity of MeshBuilder is the MESH entity, which support n-gons. The problem here is the rendering of the mesh as 3DFACE objects, which supports only triangles and quadrilaterals but not n-gons. The subdiv algorithm which divides n-gons into triagles is very simple and can not handle concave shapes as you see. The only solution is to subdivide the n-gons into convex shapes by yourself or using the MESH entity. A third party library like CGAL may help to subdivide the polygon.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@MughtyWinky
Comment options

@mozman
Comment options

Answer selected by MughtyWinky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants