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"
|
"checks and cleans the given shape, and apply it to the object"
|
||||||
if shape:
|
if shape:
|
||||||
if not shape.isNull():
|
if not shape.isNull():
|
||||||
if shape.isValid() and shape.Solids:
|
if shape.isValid():
|
||||||
|
if shape.Solids:
|
||||||
if shape.Volume < 0:
|
if shape.Volume < 0:
|
||||||
shape.reverse()
|
shape.reverse()
|
||||||
if shape.Volume < 0:
|
if shape.Volume < 0:
|
||||||
FreeCAD.Console.PrintError(translate("Arch","Error computing the shape of this object"))
|
FreeCAD.Console.PrintError(translate("Arch","Error computing the shape of this object")+"\n")
|
||||||
return
|
return
|
||||||
shape = shape.removeSplitter()
|
shape = shape.removeSplitter()
|
||||||
obj.Shape = shape
|
obj.Shape = shape
|
||||||
if not placement.isNull():
|
if not placement.isNull():
|
||||||
obj.Placement = placement
|
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:
|
class ViewProviderComponent:
|
||||||
|
|
|
@ -568,6 +568,8 @@ class _Structure(ArchComponent.Component):
|
||||||
if obj.Base.Shape.isNull():
|
if obj.Base.Shape.isNull():
|
||||||
return
|
return
|
||||||
if not obj.Base.Shape.isValid():
|
if not obj.Base.Shape.isValid():
|
||||||
|
if not obj.Base.Shape.Solids:
|
||||||
|
# let pass invalid objects if they have solids...
|
||||||
return
|
return
|
||||||
if hasattr(obj,"Tool"):
|
if hasattr(obj,"Tool"):
|
||||||
if obj.Tool:
|
if obj.Tool:
|
||||||
|
|
|
@ -413,6 +413,8 @@ class _Wall(ArchComponent.Component):
|
||||||
if obj.Base.Shape.isNull():
|
if obj.Base.Shape.isNull():
|
||||||
return
|
return
|
||||||
if not obj.Base.Shape.isValid():
|
if not obj.Base.Shape.isValid():
|
||||||
|
if not obj.Base.Shape.Solids:
|
||||||
|
# let pass invalid objects if they have solids...
|
||||||
return
|
return
|
||||||
|
|
||||||
if hasattr(obj,"Face"):
|
if hasattr(obj,"Face"):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user