Planar error I don't understand

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Planar error I don't understand

Post by freedman »

I'm going thru a list of faces and assigning a sketch to them as Support. When I get to a face that is circular I check for planar and the test does not work. It runs the code and I get this error.
"PositionBySupport: No planar face in AttachEngine3D::calculateAttachedPlacement()!"

I would think a flat feature with a circle cut in it would be planar, any thought on how to check this face?

Here is the code:

Code: Select all

 
if hasattr(ob1,'Shape') and str(ob1) != "<body object>": #obj.TypeId != "Sketcher::SketchObject":
    if hasattr(ob1.Shape,'Faces'):
        for i,fac in enumerate(ob1.Shape.Faces): 
            self.face_name = 'Face{:d}'.format(i+1 )
            if ob1.Shape.Faces[i].Surface.isPlanar() ==True:
                App.getDocument(self.local_doc).getObject(obj.Label).Support = [(FreeCAD.getDocument(self.local_doc).getObject(self.local_support),self.face_name) ]
Thanks
suzanne.soy
Posts: 54
Joined: Sat Dec 19, 2020 11:55 pm

Re: Planar error I don't understand

Post by suzanne.soy »

Hi freedman, could you post your FreeCAD document, or a minimal sequence of Python commands to recreate it? Better include your FreeCAD version too, just in case :) It's weird indeed that .isPlanar() isn't consistent with the error.
:?: Please mark your posts as [solved] :!:
:idea: If the answer you got is a good fit for the wiki, you can edit it!
FreeCAD modelling & coding workbenches+macros: twitch GitHub
Post Reply