Re: Point inside/outside in 3D [message #19577] |
Tue, 04 April 2000 00:00 |
Struan Gray
Messages: 178 Registered: December 1995
|
Senior Member |
|
|
marc, m_schellens@hotmail.com writes:
> I have a closed surface in 3D consisting of polygons.
> Is there a routine wich decides if a point lays inside
> or outside the surface?
Add up the solid angles subtended by the individual polygons. If
they sum to 4*pi you're inside, if zero, you're outside.
Theoretically, you can detect if you are lying in one of the facet
planes by looking for a value of 2*pi, but that requires careful
control of under- and overflow errors. A dirtier and more robust
approach is to run a simple 2D check first: find the equation of the
plane for each face, and then calculate the perpendicular distance to
your point - if you're too close for comfort you can then do a
2D polygon inside/outside check (see the tip on www.dfanning.com).
The new MESH_XXX routines in 5.3 include a nice one that checks
whether your 3D polygon is in fact closed.
Struan
|
|
|
Re: Point inside/outside in 3D [message #19581 is a reply to message #19577] |
Mon, 03 April 2000 00:00  |
Steve Hartmann
Messages: 21 Registered: March 2000
|
Junior Member |
|
|
Marc,
There is a new object class in version 5.3 called IDLanROI. It contains a
member function called "ContainsPoints" that does what you are looking
for.
-Steve
marc wrote:
> I have a closed surface in 3D consisting of polygons.
> Is there a routine wich decides if a point lays inside or outside the
> surface?
> thanks,
> :-) marc
|
|
|