Draft: fix Draft_Trimex boundary subelement selection

Fixes #19614

Instead of using the whole object, the hovered subelement should be used for the boundary.

With this PR the handling of the boundary is also  'nesting-aware'. This is however still not the case for the object being extended/trimmed. That object has to be in the global space.
This commit is contained in:
Roy-043
2025-03-02 18:56:46 +01:00
committed by Yorik van Havre
parent cff2d4f8fb
commit bc430234d2

View File

@@ -323,10 +323,16 @@ class Trimex(gui_base_original.Modifier):
# snapping
if snapped:
snapped = self.doc.getObject(snapped['Object'])
if hasattr(snapped, "Shape"):
parent = snapped.get("ParentObject", None)
if parent:
subname = snapped["SubName"]
else:
parent = self.doc.getObject(snapped["Object"])
subname = snapped["Component"]
shape = Part.getShape(parent, subname, needSubElement=True, noElementMap=True)
if shape.Edges:
pts = []
for e in snapped.Shape.Edges:
for e in shape.Edges:
int = DraftGeomUtils.findIntersection(edge, e, True, True)
if int:
pts.extend(int)