Skip to content

Commit

Permalink
Arch: Fixed regression in structures
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Nov 26, 2020
1 parent a16eec8 commit 01a7680
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Mod/Arch/ArchComponent.py
Expand Up @@ -615,6 +615,8 @@ def rebase(self,shape,hint=None):

# Get the object's normal.
n = DraftGeomUtils.getNormal(shape[0])
if (not n) or (not n.Length):
n = FreeCAD.Vector(0, 0, 1)

# Reverse the normal if the hint vector and the normal vector have more
# than a 90 degree angle between them.
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Arch/ArchStructure.py
Expand Up @@ -739,7 +739,7 @@ def getExtrusionData(self,obj):
if obj.Base.Shape.Solids:
return None
elif obj.Base.Shape.Faces:
if not DraftGeomUtils.isCoplanar(obj.Base.Shape.Faces,tolerance=0.01):
if not DraftGeomUtils.isCoplanar(obj.Base.Shape.Faces,tol=0.01):
return None
else:
base,placement = self.rebase(obj.Base.Shape)
Expand Down

2 comments on commit 01a7680

@marioalexis84
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yorikvanhavre the proper tolerance value is 0.01? when I modified the functions in draftgeoutils I set the default value to -1 (ie 1e-7) which is perhaps too low. Is it preferable to have the default value of 0.01? If so, I could correct them all.

@yorikvanhavre
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marioalexis84 I think the Draft default is fine, because Draft deals with any kind of object, things modeled in microns, etc... However, Arch deals with architectural objects, where a tolerance of a hundredth of millimeter is more than enough.
This is exactly why it's a good idea to have a tolerance argument in that function, some contexts would want a specific case to return True while others False, depending on the scale of your work

Please sign in to comment.