mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Fix #3547. Bug where using existing clippings were not preserved when editing profile or wall representations.
This commit is contained in:
@@ -63,7 +63,11 @@ class Usecase:
|
||||
def apply_clippings(self, first_operand):
|
||||
while self.settings["clippings"]:
|
||||
clipping = self.settings["clippings"].pop()
|
||||
if clipping["operand_type"] == "IfcHalfSpaceSolid":
|
||||
if isinstance(clipping, ifcopenshell.entity_instance):
|
||||
new = ifcopenshell.util.element.copy(self.file, clipping)
|
||||
new.FirstOperand = first_operand
|
||||
first_operand = new
|
||||
elif clipping["operand_type"] == "IfcHalfSpaceSolid":
|
||||
matrix = clipping["matrix"]
|
||||
second_operand = self.file.createIfcHalfSpaceSolid(
|
||||
self.file.createIfcPlane(
|
||||
@@ -81,7 +85,7 @@ class Usecase:
|
||||
),
|
||||
False,
|
||||
)
|
||||
first_operand = self.file.create_entity(clipping["type"], "DIFFERENCE", first_operand, second_operand)
|
||||
first_operand = self.file.create_entity(clipping["type"], "DIFFERENCE", first_operand, second_operand)
|
||||
return first_operand
|
||||
|
||||
def convert_si_to_unit(self, co):
|
||||
|
||||
@@ -95,7 +95,11 @@ class Usecase:
|
||||
def apply_clippings(self, first_operand):
|
||||
while self.settings["clippings"]:
|
||||
clipping = self.settings["clippings"].pop()
|
||||
if clipping["operand_type"] == "IfcHalfSpaceSolid":
|
||||
if isinstance(clipping, ifcopenshell.entity_instance):
|
||||
new = ifcopenshell.util.element.copy(self.file, clipping)
|
||||
new.FirstOperand = first_operand
|
||||
first_operand = new
|
||||
elif clipping["operand_type"] == "IfcHalfSpaceSolid":
|
||||
matrix = clipping["matrix"]
|
||||
second_operand = self.file.createIfcHalfSpaceSolid(
|
||||
self.file.createIfcPlane(
|
||||
@@ -113,7 +117,7 @@ class Usecase:
|
||||
),
|
||||
False,
|
||||
)
|
||||
first_operand = self.file.create_entity(clipping["type"], "DIFFERENCE", first_operand, second_operand)
|
||||
first_operand = self.file.create_entity(clipping["type"], "DIFFERENCE", first_operand, second_operand)
|
||||
return first_operand
|
||||
|
||||
def convert_si_to_unit(self, co):
|
||||
|
||||
Reference in New Issue
Block a user