Notifications
Clear all

[Closed] How to get whether a specified point is inside a spline

I have a closed spline , now i want to know if a specified positon is inside the spline.

like the method “isPointInside” in <PainterInterFace>.

how to ? thanks

6 Replies

sorry,i posted two same articles.
please delete it ,thanks

 rdg

I guess there is a simpler way, but if nothing helps this might be a good lecture:

http://www.cs.unc.edu/~hoff/techrep/dotprod.html
[i]The purpose of this paper is to derive a “tool” used for determining if a point is on the “inside” or “outside” of a line or plane based on the definition of the dot product.

Georg
[/i]

 eek

What about, getting the distance between the point and say 4 values along the spline. Then adding the distances together and checking it against the circumferance?

   
fn testPoint point spline
(
local arrTemp = for i = 0 to 1 by .33 collect (lengthInterp spline 1 i)
 
local arrDist = for i = 1 to arrTemp.count collect (distance point.pos arrTemp[i])
 
local finDist = 0
for i = 1 to arrDist.count do 
   (
finDist += arrdist[i]
  )
 
case of
   (
	((curveLength spline) == finDist): return 1
	((curveLength spline) != finDist): return 0
   )
 
 
 
)

something like that.

i answered this at the AREA for anyone that’s interested. easier than you think!

J.

http://discussion.autodesk.com/adskcsp/thread.jspa?threadID=563269

 rdg

Mesh’s not dead!
j-man you rock. :buttrock:

Georg

LOL

thanks man!

J.