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.7k stars 383 forks source link

Contour Detection BY PLANE #67

Open matangpanchal opened 6 years ago

matangpanchal commented 6 years ago

Hi, I am very impressed by this huge library, I tried meshcutbyplane functionality and It given me much faster results then the one I am using. Here I want to know if you have implemented any feature to extract mesh contours by the given plane information like normal and a point on plane. Please give me any hint so that I can work on it.

THANK YOU

rms80 commented 6 years ago

The MeshPlaneCut class outputs a set of cut EdgeLoop objects, in the .CutLoops member. EdgeLoop objects have a .ToCurve() function that returns a DCurve3, which is a 3D polyline (I assume this is what you mean by a contour?)

matangpanchal commented 6 years ago

Thanks for your response. I can try as you suggested and confirm, if is this i want or not. But is it possible to get these information with out actually cutting the mesh ?

rms80 commented 6 years ago

MeshIsoCurves can be used to compute the isocontours of an arbitrary function, for a plane you can use its distance-to-plane function. However this doesn't output the loops, it produces a 3D graph, because the topology of the curve can be non-manifold (eg bowtie vertices, on-edge segments, etc).

My 3D printing slicer has an example of how to use this, look in https://github.com/gradientspace/gsSlicer/blob/master/slicing/MeshPlanarSlicer.cs at function compute_plane_curves(). In this code only the z-height is used as the distance function but you can plug in a plane equation instead.

matangpanchal commented 6 years ago

Thanks a lot, I will try this as well, but please excuse me, as I am already overloaded with something else right now , so please expect bit delay.

matangpanchal commented 7 months ago

MeshIsoCurves can be used to compute the isocontours of an arbitrary function, for a plane you can use its distance-to-plane function. However this doesn't output the loops, it produces a 3D graph, because the topology of the curve can be non-manifold (eg bowtie vertices, on-edge segments, etc).

My 3D printing slicer has an example of how to use this, look in https://github.com/gradientspace/gsSlicer/blob/master/slicing/MeshPlanarSlicer.cs at function compute_plane_curves(). In this code only the z-height is used as the distance function but you can plug in a plane equation instead.

Hi, recently I tried this and I found its very useful to me. But I am not able to understand how can I use MeshISOCurves function to provide my arbitary plane vectors like (0.1118,0.613,0.782) or (0.01467, -0.99933, -0.033533) etc. Can you please give me example or explain ?