-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage examples? #41
Comments
Creating a meshUsing the new API, you'd first create a context: context* triangle_context_create(); The context contains pointers to triangle_context_options(context* ctx, char *options); or by directly using the triangle_context_set_behavior(context* ctx, behavior *in); Setup your geometry ( triangle_mesh_create(context* ctx, triangleio *in); You can then get mesh statistics and quality info using triangle_mesh_quality(context *ctx, quality *q);
triangle_mesh_statistics(context *ctx, statistics *s); If you aren't satisfied with quality, update the triangle_context_set_behavior(context* ctx, behavior *in);
triangle_mesh_refine(context* ctx); Accessing mesh dataYou can either copy the mesh to a triangle_mesh_copy(context* ctx, triangleio *out, int edges, int neighbors); or access the mesh directly using the A small remark, in case you need node numbering (for example for FEM): Vertices aren't numbered by default (see issue #23). The file_writenodes method shows how to setup numbering using |
Many thanks! I know this is not a support channel, but maybe you can help me with one more question: I am able to triangulate an arbitrary region but I cannot seem to get it to not generate the convex hull. When I remove the "c" switch from the triangle_context_options call, nothing generates. I've also tried setting the behavior via behavior.convex but it seems to have no effect. Any advice appreciated, thanks! |
Oh - I also tried to define a segmentlist of the bounding segment vertices but that also did not seem to have an effect. Was not able to find documentation on this, so may have done it incorrectly. |
Please read the original documentation at http://www.cs.cmu.edu/~quake/triangle.html Here are some hints:
|
Porting to the new version requires relatively limited changes. Primarily, the data structure names, setup, and closeout functionsare slightly different. The trinagulation function returns an error code that is checked before using the output mesh data. For more information on library porting: wo80/Triangle#41
It would be great if some sample code were provided that showed usage. I can run the tests but the syntax and underlying structures seem rather different than the original library... I spent a few hours trying to cross reference how to iterate triangles/verts from the old showme.c program and this adaptation with no luck.
Many thanks for your efforts, regardless :)
The text was updated successfully, but these errors were encountered: