mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Distance subtype for rl1, rl2 and x/y/z (opening dimensions) in BIM Tool
This commit is contained in:
@@ -91,7 +91,7 @@ class FilledOpeningGenerator:
|
||||
if filling.is_a("IfcDoor"):
|
||||
new_matrix.translation.z = voided_obj.matrix_world.translation.z
|
||||
else:
|
||||
new_matrix.translation.z = voided_obj.matrix_world.translation.z + (props.rl2 * unit_scale)
|
||||
new_matrix.translation.z = voided_obj.matrix_world.translation.z + props.rl2
|
||||
|
||||
filling_obj.matrix_world = new_matrix
|
||||
bpy.context.view_layer.update()
|
||||
@@ -557,7 +557,6 @@ class ShowBooleans(Operator, tool.Ifc.Operator, AddObjectHelper):
|
||||
and obj.data.BIMMeshProperties.ifc_definition_id
|
||||
)
|
||||
|
||||
|
||||
def _execute(self, context):
|
||||
obj = context.active_object
|
||||
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
|
||||
|
||||
@@ -128,11 +128,13 @@ class BIMModelProperties(PropertyGroup):
|
||||
)
|
||||
length: bpy.props.FloatProperty(default=42.0, subtype="DISTANCE")
|
||||
openings: bpy.props.CollectionProperty(type=ObjProperty)
|
||||
x: bpy.props.FloatProperty(name="X", default=0.5)
|
||||
y: bpy.props.FloatProperty(name="Y", default=0.5)
|
||||
z: bpy.props.FloatProperty(name="Z", default=0.5)
|
||||
rl1: bpy.props.FloatProperty(name="RL", default=1) # Used for things like walls, doors, flooring, skirting, etc
|
||||
rl2: bpy.props.FloatProperty(name="RL", default=1) # Used for things like windows, other hosted furniture
|
||||
x: bpy.props.FloatProperty(name="X", default=0.5, subtype="DISTANCE", "Size by X axis for the opening")
|
||||
y: bpy.props.FloatProperty(name="Y", default=0.5, subtype="DISTANCE", "Size by Y axis for the opening")
|
||||
z: bpy.props.FloatProperty(name="Z", default=0.5, subtype="DISTANCE", "Size by Z axis for the opening")
|
||||
# Used for things like walls, doors, flooring, skirting, etc
|
||||
rl1: bpy.props.FloatProperty(name="RL", default=1, subtype="DISTANCE", description="Z offset for walls")
|
||||
# Used for things like windows, other hosted furniture
|
||||
rl2: bpy.props.FloatProperty(name="RL", default=1, subtype="DISTANCE", description="Z offset for windows")
|
||||
x_angle: bpy.props.FloatProperty(name="X Angle", default=0, subtype="ANGLE", min=0, max=pi / 180 * 89)
|
||||
type_page: bpy.props.IntProperty(name="Type Page", default=1, update=update_type_page)
|
||||
type_template: bpy.props.EnumProperty(
|
||||
|
||||
@@ -589,7 +589,7 @@ class DumbWallGenerator:
|
||||
matrix_world = Matrix.Rotation(self.rotation, 4, "Z")
|
||||
matrix_world.translation = self.location
|
||||
if self.collection_obj and self.collection_obj.BIMObjectProperties.ifc_definition_id:
|
||||
matrix_world.location.z = self.collection_obj.location.z + (props.rl1 * self.unit_scale)
|
||||
matrix_world.location.z = self.collection_obj.location.z + props.rl1
|
||||
obj.matrix_world = matrix_world
|
||||
bpy.context.view_layer.update()
|
||||
self.collection.objects.link(obj)
|
||||
|
||||
@@ -176,7 +176,6 @@ class BimToolUI:
|
||||
row.operator("bim.join_wall", icon="X", text="").join_type = ""
|
||||
|
||||
elif AuthoringData.data["active_material_usage"] == "LAYER3":
|
||||
|
||||
if len(context.selected_objects) == 1:
|
||||
add_layout_hotkey_operator(cls.layout, "Edit Profile", "S_E", "")
|
||||
elif "LAYER2" in AuthoringData.data["selected_material_usages"]:
|
||||
@@ -591,7 +590,7 @@ class Hotkey(bpy.types.Operator, tool.Ifc.Operator):
|
||||
bpy.ops.bim.add_opening()
|
||||
else:
|
||||
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
|
||||
bpy.ops.bim.add_potential_opening(x=self.x * unit_scale, y=self.y * unit_scale, z=self.z * unit_scale)
|
||||
bpy.ops.bim.add_potential_opening(x=self.x, y=self.y, z=self.z)
|
||||
self.props.x = self.x
|
||||
self.props.y = self.y
|
||||
self.props.z = self.z
|
||||
|
||||
@@ -138,7 +138,7 @@ class Project(blenderbim.core.tool.Project):
|
||||
props.extrusion_depth = 3
|
||||
props.length = 1
|
||||
props.rl1 = 0
|
||||
props.rl2 = 1 / unit_scale
|
||||
props.x = 0.5 / unit_scale
|
||||
props.y = 0.5 / unit_scale
|
||||
props.z = 0.5 / unit_scale
|
||||
props.rl2 = 1
|
||||
props.x = 0.5
|
||||
props.y = 0.5
|
||||
props.z = 0.5
|
||||
|
||||
@@ -133,7 +133,7 @@ class TestSetDefaultModelingDimensions(NewFile):
|
||||
assert props.extrusion_depth == 3
|
||||
assert props.length == 1
|
||||
assert props.rl1 == 0
|
||||
assert props.rl2 == 1000
|
||||
assert props.x == 500
|
||||
assert props.y == 500
|
||||
assert props.z == 500
|
||||
assert props.rl2 == 1
|
||||
assert props.x == 0.5
|
||||
assert props.y == 0.5
|
||||
assert props.z == 0.5
|
||||
|
||||
Reference in New Issue
Block a user