Confusing method !
-
Hi all,
I've coded a method to test if a Point3d lies within a face. This method returns a wrong result sometimes
class Geom;;Point3d def on_face?(f) points3d=[] f.vertices.each { |v| points3d.push(v.position) } i = self.project_to_plane f.plane if self.on_plane?(f.plane) and i == self and Geom.point_in_polygon_2D(self,points3d,true) puts "in !" return true else puts "out !" return false end endAs you can see, 3 different tests are made to ensure that the point is on the face and within the boundaries of the face, but this is not working !
Help anyone ? -
The first thing I think about is: Calculations with Float type. Maybe in the background.
azuby
-
I needed a "point_on_face" method a while back. I can't remember who gave me this tip, but here it is:
if face.classify_point(pt) >= 1 and face.classify_point(pt) <= 4 then... -
Thanx, interesting !
The doc at classify_point is empty
-
Todd Burch did something on it a while ago...
-
Thanx a bunch TIG

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginAdvertisement