mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 15:07:38 +00:00
black .
This commit is contained in:
@@ -666,7 +666,7 @@ class EnableEditingExtrusionProfile(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
new_rot_mat = local_rot_mat.to_4x4() @ rot_mat
|
new_rot_mat = local_rot_mat.to_4x4() @ rot_mat
|
||||||
new_rot_euler = new_rot_mat.to_euler()
|
new_rot_euler = new_rot_mat.to_euler()
|
||||||
obj.rotation_euler = new_rot_euler
|
obj.rotation_euler = new_rot_euler
|
||||||
|
|
||||||
else:
|
else:
|
||||||
position = Matrix()
|
position = Matrix()
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,9 @@ class Feature(bonsai.core.tool.Feature):
|
|||||||
|
|
||||||
element_had_openings = tool.Geometry.has_openings(featured_element)
|
element_had_openings = tool.Geometry.has_openings(featured_element)
|
||||||
body_context = ifcopenshell.util.representation.get_context(tool.Ifc.get(), "Model", "Body")
|
body_context = ifcopenshell.util.representation.get_context(tool.Ifc.get(), "Model", "Body")
|
||||||
ifcopenshell.api.run("feature.add_feature", tool.Ifc.get(), feature=feature_element, element=featured_element)
|
ifcopenshell.api.run(
|
||||||
|
"feature.add_feature", tool.Ifc.get(), feature=feature_element, element=featured_element
|
||||||
|
)
|
||||||
|
|
||||||
if tool.Ifc.is_moved(feature_obj):
|
if tool.Ifc.is_moved(feature_obj):
|
||||||
bonsai.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=feature_obj)
|
bonsai.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=feature_obj)
|
||||||
|
|||||||
@@ -424,7 +424,11 @@ class Model(bonsai.core.tool.Model):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def convert_curve_to_mesh(
|
def convert_curve_to_mesh(
|
||||||
cls, obj: bpy.types.Object, position: Matrix, curve: ifcopenshell.entity_instance, x_angle: Optional[float] = None,
|
cls,
|
||||||
|
obj: bpy.types.Object,
|
||||||
|
position: Matrix,
|
||||||
|
curve: ifcopenshell.entity_instance,
|
||||||
|
x_angle: Optional[float] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
offset = len(cls.vertices)
|
offset = len(cls.vertices)
|
||||||
|
|
||||||
@@ -1620,7 +1624,11 @@ class Model(bonsai.core.tool.Model):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def auto_detect_profiles(
|
def auto_detect_profiles(
|
||||||
cls, obj: bpy.types.Object, mesh: bpy.types.Mesh, position: Matrix | None = None, x_angle: Optional[float] = None,
|
cls,
|
||||||
|
obj: bpy.types.Object,
|
||||||
|
mesh: bpy.types.Mesh,
|
||||||
|
position: Matrix | None = None,
|
||||||
|
x_angle: Optional[float] = None,
|
||||||
) -> Union[tuple, dict]:
|
) -> Union[tuple, dict]:
|
||||||
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
|
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
|
||||||
|
|
||||||
@@ -1789,7 +1797,7 @@ class Model(bonsai.core.tool.Model):
|
|||||||
else: # Pure straight polyline, no segments required
|
else: # Pure straight polyline, no segments required
|
||||||
coord_list = [list(((position_i @ v.co) / unit_scale).to_2d()) for v in loop_verts]
|
coord_list = [list(((position_i @ v.co) / unit_scale).to_2d()) for v in loop_verts]
|
||||||
if x_angle:
|
if x_angle:
|
||||||
coord_list = [(c[0], c[1] / cos(x_angle)) for c in coord_list]
|
coord_list = [(c[0], c[1] / cos(x_angle)) for c in coord_list]
|
||||||
if is_closed:
|
if is_closed:
|
||||||
coord_list.append(coord_list[0])
|
coord_list.append(coord_list[0])
|
||||||
points = tmp.createIfcCartesianPointList2D(coord_list)
|
points = tmp.createIfcCartesianPointList2D(coord_list)
|
||||||
|
|||||||
Reference in New Issue
Block a user