Arch: Better output messages if the shape of an arch object is invalid
This commit is contained in:
parent
a871364066
commit
581d88485d
|
@ -584,16 +584,23 @@ class Component:
|
|||
"checks and cleans the given shape, and apply it to the object"
|
||||
if shape:
|
||||
if not shape.isNull():
|
||||
if shape.isValid() and shape.Solids:
|
||||
if shape.Volume < 0:
|
||||
shape.reverse()
|
||||
if shape.Volume < 0:
|
||||
FreeCAD.Console.PrintError(translate("Arch","Error computing the shape of this object"))
|
||||
return
|
||||
shape = shape.removeSplitter()
|
||||
obj.Shape = shape
|
||||
if not placement.isNull():
|
||||
obj.Placement = placement
|
||||
if shape.isValid():
|
||||
if shape.Solids:
|
||||
if shape.Volume < 0:
|
||||
shape.reverse()
|
||||
if shape.Volume < 0:
|
||||
FreeCAD.Console.PrintError(translate("Arch","Error computing the shape of this object")+"\n")
|
||||
return
|
||||
shape = shape.removeSplitter()
|
||||
obj.Shape = shape
|
||||
if not placement.isNull():
|
||||
obj.Placement = placement
|
||||
else:
|
||||
FreeCAD.Console.PrintWarning(obj.Label + " " + translate("Arch","has no solid")+"\n")
|
||||
else:
|
||||
FreeCAD.Console.PrintWarning(obj.Label + " " + translate("Arch","has an invalid shape")+"\n")
|
||||
else:
|
||||
FreeCAD.Console.PrintWarning(obj.Label + " " + translate("Arch","has a null shape")+"\n")
|
||||
|
||||
|
||||
class ViewProviderComponent:
|
||||
|
|
|
@ -568,7 +568,9 @@ class _Structure(ArchComponent.Component):
|
|||
if obj.Base.Shape.isNull():
|
||||
return
|
||||
if not obj.Base.Shape.isValid():
|
||||
return
|
||||
if not obj.Base.Shape.Solids:
|
||||
# let pass invalid objects if they have solids...
|
||||
return
|
||||
if hasattr(obj,"Tool"):
|
||||
if obj.Tool:
|
||||
try:
|
||||
|
|
|
@ -413,7 +413,9 @@ class _Wall(ArchComponent.Component):
|
|||
if obj.Base.Shape.isNull():
|
||||
return
|
||||
if not obj.Base.Shape.isValid():
|
||||
return
|
||||
if not obj.Base.Shape.Solids:
|
||||
# let pass invalid objects if they have solids...
|
||||
return
|
||||
|
||||
if hasattr(obj,"Face"):
|
||||
if obj.Face > 0:
|
||||
|
|
Loading…
Reference in New Issue
Block a user