PDA

View Full Version : How to get whether a specified point is inside a spline


Cgworms
04-18-2007, 03:38 AM
i have a closed spline, now i want to know if a specified position is inside the spline.

like the method "isPointInside" in PainterInterFace.

thanks!

http://page.hxsd.com.cn/images/upload/2007/04/18/15605881.jpg

Cgworms
04-18-2007, 09:57 AM
sorry,i posted two same articles.
please delete it ,thanks

rdg
04-18-2007, 10:54 AM
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
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

eek
04-18-2007, 04:18 PM
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.

j-man
04-19-2007, 12:16 PM
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
04-19-2007, 01:22 PM
Mesh's not dead!
j-man you rock. :buttrock:

Georg

j-man
04-20-2007, 05:20 PM
LOL

thanks man!

J.

CGTalk Moderation
04-20-2007, 05:20 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.