Draft: minor fixes (#17793)

- more tolerance on faultly solids in shape2Dview
- fixed display of dimensions in arch override unit
This commit is contained in:
Yorik van Havre
2024-11-16 17:52:55 +01:00
committed by GitHub
parent f723f36d2a
commit 8f9718ebc6
2 changed files with 9 additions and 4 deletions

View File

@@ -291,15 +291,20 @@ class Shape2DView(DraftObject):
for s in shapes:
shapes_to_cut.extend(s.Faces)
for sh in shapes_to_cut:
if cutv:
if cutv and (not cutv.isNull()) and (not sh.isNull()):
if sh.Volume < 0:
sh.reverse()
#if cutv.BoundBox.intersect(sh.BoundBox):
# c = sh.cut(cutv)
#else:
# c = sh.copy()
c = sh.cut(cutv)
cuts.extend(self._get_shapes(c, onlysolids))
try:
c = sh.cut(cutv)
except ValueError:
print("DEBUG: Error subtracting shapes in", obj.Label)
cuts.extend(self._get_shapes(sh, onlysolids))
else:
cuts.extend(self._get_shapes(c, onlysolids))
else:
cuts.extend(self._get_shapes(sh, onlysolids))
comp = Part.makeCompound(cuts)

View File

@@ -582,7 +582,7 @@ class ViewProviderLinearDimension(ViewProviderDimensionBase):
unit = vobj.UnitOverride
# Special representation if we use 'Building US' scheme
if params.get_param("UserSchema", path="Units") == 5:
if (params.get_param("UserSchema", path="Units") == 5) or (unit == "arch"):
self.string = App.Units.Quantity(length, App.Units.Length).UserString
if self.string.count('"') > 1:
# multiple inch tokens