mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:23:53 +00:00
Remove dead code join_walls_TZ, join_T, join_Z superseded in acdc40fb4
This commit is contained in:
@@ -1268,27 +1268,6 @@ class DumbWallJoiner:
|
|||||||
bonsai.core.root.copy_class(tool.Ifc, tool.Collector, tool.Geometry, tool.Root, obj=wall2)
|
bonsai.core.root.copy_class(tool.Ifc, tool.Collector, tool.Geometry, tool.Root, obj=wall2)
|
||||||
return wall2
|
return wall2
|
||||||
|
|
||||||
def join_Z(self, wall1, slab2):
|
|
||||||
element1 = tool.Ifc.get_entity(wall1)
|
|
||||||
element2 = tool.Ifc.get_entity(slab2)
|
|
||||||
|
|
||||||
for rel in element1.ConnectedFrom:
|
|
||||||
if rel.is_a() == "IfcRelConnectsElements" and rel.Description == "TOP":
|
|
||||||
ifcopenshell.api.geometry.disconnect_element(
|
|
||||||
tool.Ifc.get(),
|
|
||||||
relating_element=rel.RelatingElement,
|
|
||||||
related_element=element1,
|
|
||||||
)
|
|
||||||
|
|
||||||
ifcopenshell.api.geometry.connect_element(
|
|
||||||
tool.Ifc.get(),
|
|
||||||
relating_element=element2,
|
|
||||||
related_element=element1,
|
|
||||||
description="TOP",
|
|
||||||
)
|
|
||||||
|
|
||||||
tool.Model.recreate_wall(element1, wall1)
|
|
||||||
|
|
||||||
def set_axis(self, wall, p1, p2):
|
def set_axis(self, wall, p1, p2):
|
||||||
axis = ifcopenshell.util.representation.get_context(tool.Ifc.get(), "Plan", "Axis", "GRAPH_VIEW")
|
axis = ifcopenshell.util.representation.get_context(tool.Ifc.get(), "Plan", "Axis", "GRAPH_VIEW")
|
||||||
builder = ifcopenshell.util.shape_builder.ShapeBuilder(tool.Ifc.get())
|
builder = ifcopenshell.util.shape_builder.ShapeBuilder(tool.Ifc.get())
|
||||||
@@ -1333,29 +1312,6 @@ class DumbWallJoiner:
|
|||||||
self.set_axis(element1, p1, p2)
|
self.set_axis(element1, p1, p2)
|
||||||
tool.Model.recreate_wall(element1, wall1)
|
tool.Model.recreate_wall(element1, wall1)
|
||||||
|
|
||||||
def join_T(self, wall1: bpy.types.Object, wall2: bpy.types.Object) -> None:
|
|
||||||
element1 = tool.Ifc.get_entity(wall1)
|
|
||||||
element2 = tool.Ifc.get_entity(wall2)
|
|
||||||
axis1 = tool.Model.get_wall_axis(wall1)
|
|
||||||
axis2 = tool.Model.get_wall_axis(wall2)
|
|
||||||
intersect = tool.Cad.intersect_edges(axis1["reference"], axis2["reference"])
|
|
||||||
if intersect:
|
|
||||||
intersect, _ = intersect
|
|
||||||
else:
|
|
||||||
return
|
|
||||||
connection = "ATEND" if tool.Cad.edge_percent(intersect, axis1["reference"]) > 0.5 else "ATSTART"
|
|
||||||
|
|
||||||
ifcopenshell.api.geometry.connect_path(
|
|
||||||
tool.Ifc.get(),
|
|
||||||
related_element=element1,
|
|
||||||
relating_element=element2,
|
|
||||||
relating_connection="ATPATH",
|
|
||||||
related_connection=connection,
|
|
||||||
description="BUTT",
|
|
||||||
)
|
|
||||||
|
|
||||||
tool.Model.recreate_wall(element1, wall1, axis1["reference"], axis1["reference"])
|
|
||||||
|
|
||||||
def connect(self, obj1: bpy.types.Object, obj2: bpy.types.Object) -> None:
|
def connect(self, obj1: bpy.types.Object, obj2: bpy.types.Object) -> None:
|
||||||
wall1 = tool.Ifc.get_entity(obj1)
|
wall1 = tool.Ifc.get_entity(obj1)
|
||||||
wall2 = tool.Ifc.get_entity(obj2)
|
wall2 = tool.Ifc.get_entity(obj2)
|
||||||
|
|||||||
@@ -159,48 +159,6 @@ def extend_wall_to_slab(
|
|||||||
model.reload_body_representation(wall_objs)
|
model.reload_body_representation(wall_objs)
|
||||||
|
|
||||||
|
|
||||||
def join_walls_TZ(
|
|
||||||
ifc: type[tool.Ifc],
|
|
||||||
blender: type[tool.Blender],
|
|
||||||
geometry: type[tool.Geometry],
|
|
||||||
joiner: DumbWallJoiner,
|
|
||||||
model: type[tool.Model],
|
|
||||||
) -> None:
|
|
||||||
selected_objs = [
|
|
||||||
o
|
|
||||||
for o in blender.get_selected_objects()
|
|
||||||
if (e := ifc.get_entity(o)) and model.get_usage_type(e) in ("LAYER2", "LAYER3")
|
|
||||||
]
|
|
||||||
if len(selected_objs) < 2:
|
|
||||||
raise RequireAtLeastTwoLayeredElements(
|
|
||||||
"Two or more vertically or horizontally layered elements must be selected to connect their paths together"
|
|
||||||
)
|
|
||||||
|
|
||||||
for obj in selected_objs:
|
|
||||||
geometry.clear_scale(obj)
|
|
||||||
|
|
||||||
elements = [ifc.get_entity(o) for o in blender.get_selected_objects()]
|
|
||||||
layer2_elements = []
|
|
||||||
layer3_elements = []
|
|
||||||
for element in elements:
|
|
||||||
usage = model.get_usage_type(element)
|
|
||||||
if usage == "LAYER2":
|
|
||||||
layer2_elements.append(element)
|
|
||||||
elif usage == "LAYER3":
|
|
||||||
layer3_elements.append(element)
|
|
||||||
if layer3_elements:
|
|
||||||
target = ifc.get_object(layer3_elements[0])
|
|
||||||
for element in layer2_elements:
|
|
||||||
joiner.join_Z(ifc.get_object(element), target)
|
|
||||||
else:
|
|
||||||
if not (active_obj := blender.get_active_object()):
|
|
||||||
active_obj = selected_objs[0]
|
|
||||||
for obj in selected_objs:
|
|
||||||
if obj == active_obj:
|
|
||||||
continue
|
|
||||||
joiner.join_T(obj, active_obj)
|
|
||||||
|
|
||||||
|
|
||||||
class RequireTwoWallsError(Exception):
|
class RequireTwoWallsError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user