Arch: avoid intersecting solids in windows and doors with openings

With the current code, if you place a simple door and change its Opening property to 50, the door leaf and the frame intersect. This PR fixes that issue.
This commit is contained in:
Roy-043
2023-09-19 21:31:09 +02:00
parent fb46c8c6f8
commit 5fa44ae88b

View File

@@ -821,6 +821,8 @@ class _Window(ArchComponent.Component):
pass
elif omode == 10: # -sliding
pass
exv = FreeCAD.Vector()
zov = FreeCAD.Vector()
V = 0
thk = obj.WindowParts[(i*5)+3]
if "+V" in thk:
@@ -844,12 +846,19 @@ class _Window(ArchComponent.Component):
if zof:
zov = DraftVecUtils.scaleTo(norm,zof)
shape.translate(zov)
for symb in ssymbols:
symb.translate(zov)
for symb in vsymbols:
symb.translate(zov)
if rotdata and hinge and omode:
rotdata[0] = rotdata[0].add(zov)
if hinge and omode and 0 < omode < 9:
if DraftVecUtils.angle(chord, norm, enorm) < 0:
if omode%2 == 0:
zov = zov.add(exv)
else:
if omode%2 == 1:
zov = zov.add(exv)
for symb in ssymbols:
symb.translate(zov)
for symb in vsymbols:
symb.translate(zov)
if rotdata:
rotdata[0] = rotdata[0].add(zov)
if obj.WindowParts[(i*5)+1] == "Louvre":
if hasattr(obj,"LouvreWidth"):
if obj.LouvreWidth and obj.LouvreSpacing: