Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
Posts: 0
Joined: Fri Nov 14, 2003 4:04 pm


Post by Antares »

Is it possible to write a function that can determine if a certain coordinateis located inside an self-contained mesh?

I am currently thinking about a volume calulation script and this would be one of the prerequisites.

Or does somethign like this already exist? I have seachred the net a bit, but i havent found anything so far.

Thanx for your help

Posts: 289
Joined: Wed Oct 16, 2002 2:38 am

Post by z3r0_d »

what would you do about quads?

[there isn't such a function already]

now, if the mesh is convex the point lies inside it iff it is behind all of the faces [lets just assume quads are represented as two triangles]

if the mesh isn't convex, it is likely the point is in front of some faces, but if it is inside the mesh they wouldn't be the nearer faces

I guess you could do something to traverse the faces, and see where the shilouettes are and check if the nearest faces to the point are facing towards it or away from it. This method would be slow though, you would be better off finding another solution to your problem
[and it was just the first method that came to mind]

Post Reply