Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download
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

Advertisement