Samson-Mano / 2DTriangle_Mesh_Generator

Program to create 2D triangle mesh for any surface domain.
https://sites.google.com/site/samsoninfinite/home
MIT License
13 stars 6 forks source link

Use mesh generator from other C# code? #1

Closed AmosEgel closed 1 year ago

AmosEgel commented 1 year ago

Congratulations, the examples that you post look very good.

I'd like to create some meshes using constrained Delauney triangulation from within another C# project, so I'd like to use your software as a library (without the GUI).

What would be the starting point, i.e., what are the relevant classes that I can use to define a polygon and to compute a mesh?

Samson-Mano commented 1 year ago

Hi,

To generate a mesh from other C# code, you will need to follow these steps:

Copy the file constrained_delaunay_triangle_main.cs located in the following folder: https://github.com/Samson-Mano/2DTriangle_Mesh_Generator/tree/master/2DTriangle_Mesh_Generator/mesh_control

Copy the entire contents of this folder: https://github.com/Samson-Mano/2DTriangle_Mesh_Generator/tree/master/2DTriangle_Mesh_Generator/mesh_control/delaunay_triangulation

That's all you need to do!

The main call to generate the mesh can be found in the file [constrained_delaunay_triangle_main.cs]. The input is a string value with format shown in the same file.

I hope this clarifies the process. If you have any further questions, feel free to ask.

Best regards, Samson Mano