Merge pull request #21617 from tarman3/profileoutside

CAM: Offer correct side for Profile
This commit is contained in:
sliptonic
2025-06-02 10:28:45 -05:00
committed by GitHub

View File

@@ -131,18 +131,29 @@ class ObjectOp(PathOp.ObjectOp):
if prop in ["AreaParams", "PathParams", "removalshape"]:
obj.setEditorMode(prop, 2)
if prop == "Base" and len(obj.Base) == 1:
(base, sub) = obj.Base[0]
if hasattr(obj, "Side") and prop == "Base" and len(obj.Base) == 1:
(base, subNames) = obj.Base[0]
bb = base.Shape.BoundBox # parent boundbox
subobj = base.Shape.getElement(sub[0])
fbb = subobj.BoundBox # feature boundbox
if hasattr(obj, "Side"):
if "Face" in subNames[0]:
face = base.Shape.getElement(subNames[0])
fbb = face.BoundBox # face boundbox
if bb.XLength == fbb.XLength and bb.YLength == fbb.YLength:
obj.Side = "Outside"
else:
obj.Side = "Inside"
elif "Edge" in subNames[0]:
edges = [
base.Shape.getElement(sub).copy() for sub in subNames if sub.startswith("Edge")
]
wire = Part.Wire(Part.__sortEdges__(edges))
wbb = wire.BoundBox # wire boundbox
if not wire.isClosed() or (bb.XLength == wbb.XLength and bb.YLength == wbb.YLength):
obj.Side = "Outside"
else:
obj.Side = "Inside"
self.areaOpOnChanged(obj, prop)
def opOnDocumentRestored(self, obj):