gradientspace / geometry3Sharp

C# library for 2D/3D geometric computation, mesh algorithms, and so on. Boost license.
http://www.gradientspace.com
Boost Software License 1.0
1.72k stars 390 forks source link

Extract Main Edges of a mesh #71

Open saravanan2020 opened 6 years ago

saravanan2020 commented 6 years ago

Hi i want to extract only the main edges that are make the mesh, and not the inner edges of the triangles. And also what are edgeloops . are they contain only main edges?. what i mean to say is - FOR EXAMPLE - "THE MAIN 12 EDGES OF A CUBE"

c1

rms80 commented 6 years ago

Sorry, but no edges of a mesh are special unless you can come up with some mathematical way to pick them out. For example in a mesh of a cube you could use the angle between the two adjacent triangles. But this won't work on other meshes where the angle is not as sharp.

Once you implement your important-edges-identifier, you iterate over the edges and pick out the ones you want. To chain them up, you could use a DGraph3 to store the 3D graph (see MeshIsoCurves for an example), and then you can use DGraph3Util.ExtractCurves() to split the edge graph up into separated curves.

saravanan2020 commented 6 years ago

Thanks. And also i want to implement CSG Boolean ops. Is your library supports full-fledged CSG? and it supports for Rotated shapes also?. Please reply.

rms80 commented 6 years ago

No, it does not support mesh booleans at all.

Evil-Spirit commented 6 years ago

@saravanan2020 You can use my algorithm from NoteCAD https://github.com/NoteCAD/NoteCAD/blob/master/Assets/Code/Utils/FullMesh.cs#L432

saravanan2020 commented 5 years ago

@saravanan2020 You can use my algorithm from NoteCAD https://github.com/NoteCAD/NoteCAD/blob/master/Assets/Code/Utils/FullMesh.cs#L432

That worked. Thanks.