coplanar faces

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

coplanar faces

Post by bernd »

Is there a function available which checks if two or more faces are coplanar?
jreinhardt
Posts: 329
Joined: Mon Sep 09, 2013 6:08 pm

Re: coplanar faces

Post by jreinhardt »

You could check whether the normals are parallel, for example by calculating the cross product and checking if it is close to zero.
BOLTS, standard parts library for FreeCAD Thread, Help with Translation
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: coplanar faces

Post by shoogen »

Code: Select all

isinstance(ob1.Shape.Surface,Part.Plane) and isinstance(ob2.Shape.Surface,Part.Plane) abs(ob1.Shape.Surface.Axis*ob2.Shape.Surface.Axis) > (1-1e-6) and ob1.Shape.isInside(ob2.Shape.Surface.Position,1e-6,True)
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: coplanar faces

Post by yorik »

Code: Select all

DraftGeomUtils.isCoplanar(list_of_faces)
Post Reply