Closed mikhail-rozum closed 6 months ago
for speed purposes it often makes sense to first check if the point is inside the convex hull. If it is then check if the point is inside the solid. Coincidentally both of these methods have been improved fairly recently (and some of the classes have changed names). But for simplicity, MiscFunctions.IsPointInsideSolid will in fact tell you if a point is in the a complex (not necessarily convex) 3d model.
IO.Open(Path.Combine(inputFolder, "bunny.stl"), out TessellatedSolid bunny);
Presenter.ShowAndHang(bunny);
var point = new Vector3(0, 0, 0);
//var point = bunny.Center;
if ( MiscFunctions.IsPointInsideSolid(bunny, point))
Console.WriteLine("Inside");
else
Console.WriteLine("Outside");`
for speed purposes it often makes sense to first check if the point is inside the convex hull. If it is then check if the point is inside the solid. Coincidentally both of these methods have been improved fairly recently (and some of the classes have changed names). But for simplicity, MiscFunctions.IsPointInsideSolid will in fact tell you if a point is in the a complex (not necessarily convex) 3d model.
IO.Open(Path.Combine(inputFolder, "bunny.stl"), out TessellatedSolid bunny); Presenter.ShowAndHang(bunny); var point = new Vector3(0, 0, 0); //var point = bunny.Center; if ( MiscFunctions.IsPointInsideSolid(bunny, point)) Console.WriteLine("Inside"); else Console.WriteLine("Outside");`
Thank you so much!
The question is answered
Hello! I'm new here. I have *.stl file with some model. I need to find all the points inside this model. I found a question that refers to MiscFunctions.cs file. Firstly, I read all the vertices from file and create convex hull.
Later I try to use MiscFunctions.IsPointInsideSolid method that required TessellatedSolid parameter. Is it right? Is there an example of checking whether a point is inside a 3d polygon?