inside/outside decision problem
Madhavan Lakshmiraghavan
Madhavan.Lakshmiraghavan at Dartmouth.EDU
Sat Feb 19 14:13:41 EST 2000
Jens,
I just dealt with a similar problem. Basically, you want the following
equation:
Do this.
- pick a point on polygon A unconnected to B. Let its coordinates be (Xa,
Ya, Za)
- randonly pick a point on polygon B. Let its coordinates be (Xb, Yb, Zb)
- Find the components of the unit normal for polygon B. Let it be (n1, n2,
n3)
Then,
D = n1*(Xa-Xb) + n2*(Ya-Yb) + n3*(Za-Zb)
where D is the perpendiculat distance from the above-picked point on polygon A
to the plane of polygon B.
If D is positive, then that point of polygon A lies 'above' polygon B assuming
you define 'above' as the direction of the positive normal of B. Redefine your
concept of 'inside' or 'outside' in terms of 'above' or 'below'.
Hope this helps.
Raghavan
--- Jens Glagau wrote:
Dear vtkusers,
i want to decide wether a polygon A is inside or outside of a given
surface. Polygon A is connected with the surface with at least one edge
(at polygon B, which is of course part of the surface). All points of
polygon A are either outside of the surface or on the surface.
The points of polygons are known, therefore especially the normal of
polygon B and i know the point-ids which are in both polygons.
Of course, this is a mathematical question and not one related directly to
vtk, but i hope somebody sends me an answer. If my text is insufficent or
unprecise, please tell me.
Thanks in advance
Jens
--- end of quote ---
--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------
More information about the vtkusers
mailing list