mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +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
|
||||
|
||||
# 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:
|
||||
start_port, end_port = end_port, start_port
|
||||
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
|
||||
from blenderbim.bim import import_ifc
|
||||
import re
|
||||
from mathutils import Matrix
|
||||
from mathutils import Matrix, Vector
|
||||
|
||||
|
||||
class System(blenderbim.core.tool.System):
|
||||
@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):
|
||||
port = tool.Ifc.run("system.add_port", element=mep_element)
|
||||
port.FlowDirection = "NOTDEFINED"
|
||||
@@ -47,7 +47,10 @@ class System(blenderbim.core.tool.System):
|
||||
if add_start_port:
|
||||
ports.append(add_port(mep_element, obj.matrix_world @ Matrix()))
|
||||
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
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user