mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 04:44:37 +00:00
Fixed bug adding ports to the transitions between profiles with an offset
end port ended up located without the offset
This commit is contained in:
@@ -801,7 +801,7 @@ class MEPAddTransition(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
transition_obj.location = start_segment_extend_point if start_port_match else end_segment_extend_point
|
transition_obj.location = start_segment_extend_point if start_port_match else end_segment_extend_point
|
||||||
|
|
||||||
# add ports and connect them
|
# add ports and connect them
|
||||||
ports = tool.System.add_ports(transition_obj)
|
ports = tool.System.add_ports(transition_obj, offset_end_port=profile_offset_ws)
|
||||||
if not start_port_match:
|
if not start_port_match:
|
||||||
start_port, end_port = end_port, start_port
|
start_port, end_port = end_port, start_port
|
||||||
tool.Ifc.run("system.connect_port", port1=ports[0], port2=start_port, direction="NOTDEFINED")
|
tool.Ifc.run("system.connect_port", port1=ports[0], port2=start_port, direction="NOTDEFINED")
|
||||||
|
|||||||
@@ -22,12 +22,12 @@ import blenderbim.core.tool
|
|||||||
import blenderbim.tool as tool
|
import blenderbim.tool as tool
|
||||||
from blenderbim.bim import import_ifc
|
from blenderbim.bim import import_ifc
|
||||||
import re
|
import re
|
||||||
from mathutils import Matrix
|
from mathutils import Matrix, Vector
|
||||||
|
|
||||||
|
|
||||||
class System(blenderbim.core.tool.System):
|
class System(blenderbim.core.tool.System):
|
||||||
@classmethod
|
@classmethod
|
||||||
def add_ports(cls, obj, add_start_port=True, add_end_port=True):
|
def add_ports(cls, obj, add_start_port=True, add_end_port=True, offset_end_port=None):
|
||||||
def add_port(mep_element, matrix):
|
def add_port(mep_element, matrix):
|
||||||
port = tool.Ifc.run("system.add_port", element=mep_element)
|
port = tool.Ifc.run("system.add_port", element=mep_element)
|
||||||
port.FlowDirection = "NOTDEFINED"
|
port.FlowDirection = "NOTDEFINED"
|
||||||
@@ -47,7 +47,10 @@ class System(blenderbim.core.tool.System):
|
|||||||
if add_start_port:
|
if add_start_port:
|
||||||
ports.append(add_port(mep_element, obj.matrix_world @ Matrix()))
|
ports.append(add_port(mep_element, obj.matrix_world @ Matrix()))
|
||||||
if add_end_port:
|
if add_end_port:
|
||||||
ports.append(add_port(mep_element, obj.matrix_world @ Matrix.Translation((0, 0, length))))
|
m = obj.matrix_world @ Matrix.Translation((0, 0, length))
|
||||||
|
if offset_end_port:
|
||||||
|
m.translation += offset_end_port
|
||||||
|
ports.append(add_port(mep_element, m))
|
||||||
return ports
|
return ports
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user