Fix regressions in MEP joins after switching over to numpy from mathutils

This commit is contained in:
Dion Moult
2025-03-12 23:05:15 +11:00
parent acdc40fb41
commit 6596f5bc4b
2 changed files with 18 additions and 13 deletions
+16 -11
View File
@@ -417,20 +417,25 @@ def i_create_default_mep_types():
model_props = tool.Model.get_model_props() model_props = tool.Model.get_model_props()
# add couple segments types # add couple segments types
model_props.type_class = "IfcDuctSegmentType" i_trigger_operator("Add Element")
model_props.type_name = "RECT1" i_set_the_prop_property_to_value("Name", "RECT1")
model_props.type_template = "FLOW_SEGMENT_RECTANGULAR" i_set_the_prop_property_to_value("Class", "IfcDuctSegmentType")
bpy.ops.bim.add_type() i_set_the_prop_property_to_value("Representation", "Rectangular Distribution Segment")
i_click_button("OK")
model_props.type_template = "FLOW_SEGMENT_CIRCULAR" i_trigger_operator("Add Element")
model_props.type_name = "CIRCLE1" i_set_the_prop_property_to_value("Name", "CIRCLE1")
bpy.ops.bim.add_type() i_set_the_prop_property_to_value("Class", "IfcDuctSegmentType")
i_set_the_prop_property_to_value("Representation", "Circular Distribution Segment")
i_click_button("OK")
# add an actuator type # add an actuator type
model_props.type_class = "IfcActuatorType" i_trigger_operator("Add Element")
model_props.type_template = "MESH" # cube representation i_set_the_prop_property_to_value("Name", "ACTUATOR")
model_props.type_name = "ACTUATOR" i_set_the_prop_property_to_value("Class", "IfcActuatorType")
bpy.ops.bim.add_type() i_set_the_prop_property_to_value("Representation", "Custom Tessellation")
i_click_button("OK")
with bpy.context.temp_override(active_object=bpy.data.objects["IfcActuatorType/ACTUATOR"]): with bpy.context.temp_override(active_object=bpy.data.objects["IfcActuatorType/ACTUATOR"]):
bpy.ops.bim.add_port() bpy.ops.bim.add_port()
# port at cube's left side # port at cube's left side
@@ -1378,7 +1378,7 @@ class ShapeBuilder:
# prevent mutating arguments, deepcopy doesn't work # prevent mutating arguments, deepcopy doesn't work
start_points = np.array(points) start_points = np.array(points)
if offset: if offset is not None and offset.any():
start_points += offset start_points += offset
extrusion_offset = np.multiply(extrusion_vector, magnitude) extrusion_offset = np.multiply(extrusion_vector, magnitude)
end_points = start_points + extrusion_offset end_points = start_points + extrusion_offset
@@ -1573,7 +1573,7 @@ class ShapeBuilder:
circle_points += end_extrusion_offset circle_points += end_extrusion_offset
# circle verts are 0-15, rect verts are 16-19 # circle verts are 0-15, rect verts are 16-19
points = circle_points + rect_points points = np.concatenate((circle_points, rect_points))
transition_faces = [ transition_faces = [
(0, 19, 16), # base (0, 19, 16), # base
(0, 16, 1), (0, 16, 1),