Hi,
I am a newbie to the mdlMesh_ API and I need the API Function that creates a Mesh out of 2 (or more) polylines in the same way the GUI Function "FACET TRIANGULATE CONTOURS" does.
Thanks, Stefan.
The key to working with meshes is the PolyfaceArray. It's a list of point arrays, possibly of different lengths except for simple, regular structures such as a rectangle. You construct a PolyfaceArray and allocate its arrays dynamically. It has lists of vertices and lists of edge indexes. Except for external edges, each edge is shared by two facets. The index arrays tell you which edges belongs to which facet.
Search for Mesh Elements in the MDL function reference to see more detail, including a diagram that explains more clearly what I've written above.
Use something like mdlMesh_newPolyface() to create an element descriptor from a simple array of DPoint3d. Use something like mdlMesh_newPolyfaceFromEmbeddedArrays() to create an element descriptor from an indexed array of points.
Regards, Jon Summers LA Solutions
Stefan, MDL API does not provide such functionality, it only provides function that is able to mesh points in 2d (this is called Delaunay Triangulation).
What you want is so called Constrained Delaunay Triangulation. Your polylines must be split into segments where each represents mandatory edge of triangle - so called "constraint".
You can achieve what you want in two following passes:
Pass 1.)
Now you have so called Delaunay Triangulation, but it is NOT a "constrained" triangulation.
Pass 2.)
Advanced notes:In Pass 2, step 3 could be made using function mdlMesh_filterMultiplyDrawnEdgesIn Pass 2, steps 6 and 7 could be made at once using function mdlMesh_triangulateEmbeddedArrays
[Edit:] I have added required step no. 8 in pass 2Also note: Pass 2, steps from 3 to 7 can be replaced by so called "diagonal swapping" method.You can read something about implementing contrained triangulation algorithm in this PDF.
HTH