comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Point inside/outside in 3D
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Point inside/outside in 3D [message #19577] Tue, 04 April 2000 00:00
Struan Gray is currently offline  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 Go to previous message
Steve Hartmann is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: interpreter access
Next Topic: Re: Linux IDL - Direct Graphics

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 10:48:21 PDT 2025

Total time taken to generate the page: 0.56103 seconds