This commit is contained in:
Andrej730
2025-03-17 11:57:21 +05:00
parent 37ec2bf0e4
commit 210257de8e
7 changed files with 23 additions and 10 deletions
+1 -1
View File
@@ -322,7 +322,7 @@ class DumbSlabPlaner:
abs(existing_x_angle) < (pi / 2) and direction_ratios.z < 0
):
# The extrusion direction is negative. If the layer_parameter is set to positive,
# then the we change the extrusion direction. And the offset direction should remain positive
# then the we change the extrusion direction. And the offset direction should remain positive
# for either direction sense, so we change it.
offset_direction *= -1
if layer_params["direction_sense"] == "POSITIVE":
+1 -1
View File
@@ -343,7 +343,7 @@ class ChangeExtrusionXAngle(bpy.types.Operator, tool.Ifc.Operator):
):
# The extrusion direction is negative. If the layer_parameter is set to positive,
# then the we change the extrusion direction.
# then the we change the extrusion direction. And the offset direction should remain positive
# then the we change the extrusion direction. And the offset direction should remain positive
# for either direction sense, so we change it.
offset_direction *= -1
if layer_params["direction_sense"] == "POSITIVE":
@@ -654,6 +654,7 @@ class DisableEditingWorkCalendar(bpy.types.Operator):
core.disable_editing_work_calendar(tool.Sequence)
return {"FINISHED"}
class ImportCSV(bpy.types.Operator, tool.Ifc.Operator, ImportHelper):
bl_idname = "bim.import_csv"
bl_label = "Import CSV"
+3 -3
View File
@@ -678,13 +678,13 @@ class BIM_OT_add_section_plane(bpy.types.Operator):
continue
# In EEVEE rendering engine, `blend_mode` is deprecated and replaced by `surface_render_method`
# https://developer.blender.org/docs/release_notes/4.2/eevee_migration/#materials
if (hasattr(material, "surface_render_method")):
if hasattr(material, "surface_render_method"):
material.surface_render_method = "DITHERED"
else:
material.blend_method = "HASHED"
# TODO: Find an alternative to `shadow_method` for EEVEE engine
if (hasattr(material, "shadow_method")):
if hasattr(material, "shadow_method"):
material.shadow_method = "HASHED"
material_output = tool.Blender.get_material_node(material, "OUTPUT_MATERIAL", {"is_active_output": True})
-1
View File
@@ -47,7 +47,6 @@ class Collector(bonsai.core.tool.Collector):
if element.is_a("IfcSlab"):
tool.Geometry.lock_rotation(obj, x=True)
if element.is_a("IfcGridAxis"):
if tool.Geometry.is_locked(element):
tool.Geometry.lock_object(obj)
+7 -1
View File
@@ -178,7 +178,13 @@ class Geometry(bonsai.core.tool.Geometry):
obj.lock_scale = (False, False, False)
@classmethod
def lock_rotation(cls, obj: bpy.types.Object, x: bool=False, y: bool=False, z: bool=False,) -> None:
def lock_rotation(
cls,
obj: bpy.types.Object,
x: bool = False,
y: bool = False,
z: bool = False,
) -> None:
obj.lock_rotation = (x, y, z)
@classmethod
+10 -3
View File
@@ -245,9 +245,14 @@ class Snap(bonsai.core.tool.Snap):
# Then it sorts them to get the shortest first
intersections = []
if snap_point["type"] == "Face":
face_normal = snap_point["object"].rotation_euler.to_matrix() @ snap_point["object"].data.polygons[snap_point["face_index"]].normal
face_normal = (
snap_point["object"].rotation_euler.to_matrix()
@ snap_point["object"].data.polygons[snap_point["face_index"]].normal
)
if face_normal.z == 0:
intersections.append(tool.Cad.intersect_edge_plane(axis_start, axis_end, snap_point["point"], face_normal.normalized()))
intersections.append(
tool.Cad.intersect_edge_plane(axis_start, axis_end, snap_point["point"], face_normal.normalized())
)
if not intersections:
x_axis = tool.Polyline.use_transform_orientations(Vector((1, 0, 0)))
y_axis = tool.Polyline.use_transform_orientations(Vector((0, 1, 0)))
@@ -358,7 +363,9 @@ class Snap(bonsai.core.tool.Snap):
face_index = result[2]
if hit is not None:
# Wireframes
if snap_obj.type in {"EMPTY", "CURVE"} or (snap_obj.type == "MESH" and len(snap_obj.data.polygons) == 0):
if snap_obj.type in {"EMPTY", "CURVE"} or (
snap_obj.type == "MESH" and len(snap_obj.data.polygons) == 0
):
snap_points = tool.Raycast.ray_cast_by_proximity(context, event, snap_obj)
if snap_points:
for point in snap_points: