More consistent default and current units for stair and window modifiers

This commit is contained in:
Andrej730
2023-01-30 12:38:28 +05:00
parent 7a185e7f7c
commit 978f362073
5 changed files with 152 additions and 113 deletions
+24
View File
@@ -243,6 +243,30 @@ def close_operator_panel(event):
bpy.app.timers.register(move_back, first_interval=0.01) bpy.app.timers.register(move_back, first_interval=0.01)
def convert_property_group_from_si(property_group, skip_props=()):
"""Method converts property group values from si to current ifc project units
based on default values of the properties.
List of properties to skip can be supplied in `skip_props`."""
conversion_k = 1.0 / ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
skip_props = ("rna_type", "name") + skip_props
for prop_name in property_group.bl_rna.properties.keys():
if prop_name in skip_props:
continue
prop_bl_rna = property_group.bl_rna.properties[prop_name]
if prop_bl_rna.array_length > 0:
prop_value = prop_bl_rna.default_array
else:
prop_value = prop_bl_rna.default
if type(prop_value) is float:
prop_value = prop_value * conversion_k
elif type(prop_value) is bpy.types.bpy_prop_array:
prop_value = [el * conversion_k for el in prop_value]
setattr(property_group, prop_name, prop_value)
class IfcHeaderExtractor: class IfcHeaderExtractor:
def __init__(self, filepath: str): def __init__(self, filepath: str):
self.filepath = filepath self.filepath = filepath
@@ -263,6 +263,7 @@ class BIMStairProperties(PropertyGroup):
("WOOD/STEEL", "Wood / Steel", ""), ("WOOD/STEEL", "Wood / Steel", ""),
) )
stair_added_previously: bpy.props.BoolProperty(default=False)
is_editing: bpy.props.IntProperty(default=-1) is_editing: bpy.props.IntProperty(default=-1)
width: bpy.props.FloatProperty(name="Width", default=1.2, soft_min=0.01) width: bpy.props.FloatProperty(name="Width", default=1.2, soft_min=0.01)
height: bpy.props.FloatProperty(name="Height", default=1.0, soft_min=0.01) height: bpy.props.FloatProperty(name="Height", default=1.0, soft_min=0.01)
@@ -275,27 +276,27 @@ class BIMStairProperties(PropertyGroup):
stair_type: bpy.props.EnumProperty(name="Stair type", items=stair_types, default="CONCRETE") stair_type: bpy.props.EnumProperty(name="Stair type", items=stair_types, default="CONCRETE")
def get_props_kwargs(self): def get_props_kwargs(self):
stair_kwargs = {
"stair_type": self.stair_type,
"width": self.width,
"height": self.height,
"number_of_treads": self.number_of_treads,
"tread_depth": self.tread_depth,
"tread_run": self.tread_run,
}
if self.stair_type == "CONCRETE": if self.stair_type == "CONCRETE":
return { stair_kwargs.update(
"stair_type": self.stair_type, {
"width": self.width, "base_slab_depth": self.base_slab_depth,
"height": self.height, "top_slab_depth": self.top_slab_depth,
"number_of_treads": self.number_of_treads, "has_top_nib": self.has_top_nib,
"tread_depth": self.tread_depth, }
"tread_run": self.tread_run, )
"base_slab_depth": self.base_slab_depth, return stair_kwargs
"top_slab_depth": self.top_slab_depth,
"has_top_nib": self.has_top_nib,
}
elif self.stair_type == "WOOD/STEEL": elif self.stair_type == "WOOD/STEEL":
return { return stair_kwargs
"stair_type": self.stair_type,
"width": self.width,
"height": self.height,
"number_of_treads": self.number_of_treads,
"tread_depth": self.tread_depth,
"tread_run": self.tread_run,
}
class BIMSverchokProperties(PropertyGroup): class BIMSverchokProperties(PropertyGroup):
@@ -305,9 +306,8 @@ class BIMSverchokProperties(PropertyGroup):
def window_type_prop_update(self, context): def window_type_prop_update(self, context):
number_of_panels, panels_data = self.window_types_panels[self.window_type] number_of_panels, panels_data = self.window_types_panels[self.window_type]
si_coversion = 0.001 / ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get()) si_coversion = 1.0 / ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
panels_data = [[v * si_coversion for v in data] for data in panels_data] panels_data = [[v * si_coversion for v in data] for data in panels_data]
self.first_mullion_offset, self.second_mullion_offset = panels_data[0] self.first_mullion_offset, self.second_mullion_offset = panels_data[0]
self.first_transom_offset, self.second_transom_offset = panels_data[1] self.first_transom_offset, self.second_transom_offset = panels_data[1]
@@ -328,15 +328,15 @@ class BIMWindowProperties(PropertyGroup):
# number of panels and default mullion/transom values # number of panels and default mullion/transom values
window_types_panels = { window_types_panels = {
"SINGLE_PANEL": (1, ((0, 0 ), (0, 0 ))), "SINGLE_PANEL": (1, ((0, 0 ), (0, 0 ))),
"DOUBLE_PANEL_HORIZONTAL": (2, ((0, 0 ), (450, 0 ))), "DOUBLE_PANEL_HORIZONTAL": (2, ((0, 0 ), (0.45, 0 ))),
"DOUBLE_PANEL_VERTICAL": (2, ((300, 0 ), (0, 0 ))), "DOUBLE_PANEL_VERTICAL": (2, ((0.3, 0 ), (0, 0 ))),
"TRIPLE_PANEL_BOTTOM": (3, ((300, 0 ), (450, 0 ))), "TRIPLE_PANEL_BOTTOM": (3, ((0.3, 0 ), (0.45, 0 ))),
"TRIPLE_PANEL_TOP": (3, ((300, 0 ), (450, 0 ))), "TRIPLE_PANEL_TOP": (3, ((0.3, 0 ), (0.45, 0 ))),
"TRIPLE_PANEL_LEFT": (3, ((300, 0 ), (450, 0 ))), "TRIPLE_PANEL_LEFT": (3, ((0.3, 0 ), (0.45, 0 ))),
"TRIPLE_PANEL_RIGHT": (3, ((300, 0 ), (450, 0 ))), "TRIPLE_PANEL_RIGHT": (3, ((0.3, 0 ), (0.45, 0 ))),
"TRIPLE_PANEL_HORIZONTAL": (3, ((0, 0 ), (300, 600))), "TRIPLE_PANEL_HORIZONTAL": (3, ((0, 0 ), (0.3, 0.6))),
"TRIPLE_PANEL_VERTICAL": (3, ((200, 400), (0, 0 ))), "TRIPLE_PANEL_VERTICAL": (3, ((0.2, 0.4), (0, 0 ))),
} }
window_added_previously: bpy.props.BoolProperty(default=False) window_added_previously: bpy.props.BoolProperty(default=False)
@@ -344,25 +344,25 @@ class BIMWindowProperties(PropertyGroup):
window_type: bpy.props.EnumProperty( window_type: bpy.props.EnumProperty(
name="Window Type", items=window_types, default="SINGLE_PANEL", update=window_type_prop_update name="Window Type", items=window_types, default="SINGLE_PANEL", update=window_type_prop_update
) )
overall_height: bpy.props.FloatProperty(name="Overall Height", default=900) overall_height: bpy.props.FloatProperty(name="Overall Height", default=0.9)
overall_width: bpy.props.FloatProperty(name="Overall Width", default=600) overall_width: bpy.props.FloatProperty(name="Overall Width", default=0.6)
# lining properties # lining properties
lining_depth: bpy.props.FloatProperty(name="Lining Depth", default=50) lining_depth: bpy.props.FloatProperty(name="Lining Depth", default=0.050)
lining_thickness: bpy.props.FloatProperty(name="Lining Thickness", default=50) lining_thickness: bpy.props.FloatProperty(name="Lining Thickness", default=0.050)
lining_offset: bpy.props.FloatProperty(name="Lining Offset", default=50) lining_offset: bpy.props.FloatProperty(name="Lining Offset", default=0.050)
lining_to_panel_offset_x: bpy.props.FloatProperty(name="Lining to Panel Offset X", default=25) lining_to_panel_offset_x: bpy.props.FloatProperty(name="Lining to Panel Offset X", default=0.025)
lining_to_panel_offset_y: bpy.props.FloatProperty(name="Lining to Panel Offset Y", default=25) lining_to_panel_offset_y: bpy.props.FloatProperty(name="Lining to Panel Offset Y", default=0.025)
mullion_thickness: bpy.props.FloatProperty(name="Mullion Thickness", default=50) mullion_thickness: bpy.props.FloatProperty(name="Mullion Thickness", default=0.050)
first_mullion_offset: bpy.props.FloatProperty(name="First Mullion Offset", default=300) first_mullion_offset: bpy.props.FloatProperty(name="First Mullion Offset", default=0.3)
second_mullion_offset: bpy.props.FloatProperty(name="Second Mullion Offset", default=450) second_mullion_offset: bpy.props.FloatProperty(name="Second Mullion Offset", default=0.45)
transom_thickness: bpy.props.FloatProperty(name="Transom Thickness", default=50) transom_thickness: bpy.props.FloatProperty(name="Transom Thickness", default=0.050)
first_transom_offset: bpy.props.FloatProperty(name="First Transom Offset", default=300) first_transom_offset: bpy.props.FloatProperty(name="First Transom Offset", default=0.3)
second_transom_offset: bpy.props.FloatProperty(name="Second Transom Offset", default=600) second_transom_offset: bpy.props.FloatProperty(name="Second Transom Offset", default=0.6)
# panel_properties # panel_properties
frame_depth: bpy.props.FloatVectorProperty(name="Frame Depth", size=3, default=[35] * 3) frame_depth: bpy.props.FloatVectorProperty(name="Frame Depth", size=3, default=[0.035] * 3)
frame_thickness: bpy.props.FloatVectorProperty(name="Frame Thickness", size=3, default=[35] * 3) frame_thickness: bpy.props.FloatVectorProperty(name="Frame Thickness", size=3, default=[0.035] * 3)
def get_general_kwargs(self): def get_general_kwargs(self):
return { return {
@@ -28,7 +28,7 @@ import ifcopenshell
import blenderbim import blenderbim
import blenderbim.tool as tool import blenderbim.tool as tool
from blenderbim.bim.module.model.prop import BIMStairProperties from blenderbim.bim.module.model.prop import BIMStairProperties
from blenderbim.bim.helper import convert_property_group_from_si
from mathutils import Vector from mathutils import Vector
from pprint import pprint from pprint import pprint
@@ -180,9 +180,15 @@ def generate_stair_2d_profile(
def update_stair_modifier(context): def update_stair_modifier(context):
obj = context.active_object obj = context.active_object
props = obj.BIMStairProperties props_kwargs = obj.BIMStairProperties.get_props_kwargs()
si_conversion = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
for prop_name in props_kwargs:
if prop_name in ("is_editing", "number_of_treads", "has_top_nib", "stair_type"):
continue
prop_value = props_kwargs[prop_name]
props_kwargs[prop_name] = prop_value * si_conversion
props_kwargs = props.get_props_kwargs()
vertices, edges, faces = generate_stair_2d_profile(**props_kwargs) vertices, edges, faces = generate_stair_2d_profile(**props_kwargs)
obj = context.object obj = context.object
@@ -200,7 +206,7 @@ def update_stair_modifier(context):
bm.faces.ensure_lookup_table() bm.faces.ensure_lookup_table()
faces = bm.faces faces = bm.faces
extruded = bmesh.ops.extrude_face_region(bm, geom=faces) extruded = bmesh.ops.extrude_face_region(bm, geom=faces)
extrusion_vector = Vector((0, 1, 0)) * props.width extrusion_vector = Vector((0, 1, 0)) * props_kwargs["width"]
translate_verts = [v for v in extruded["geom"] if isinstance(v, BMVert)] translate_verts = [v for v in extruded["geom"] if isinstance(v, BMVert)]
bmesh.ops.translate(bm, vec=extrusion_vector, verts=translate_verts) bmesh.ops.translate(bm, vec=extrusion_vector, verts=translate_verts)
@@ -259,12 +265,18 @@ class AddStair(bpy.types.Operator, tool.Ifc.Operator):
def _execute(self, context): def _execute(self, context):
obj = context.active_object obj = context.active_object
element = tool.Ifc.get_entity(obj) element = tool.Ifc.get_entity(obj)
props = obj.BIMStairProperties
if not element.is_a("IfcStairFlight"): if not element.is_a("IfcStairFlight"):
self.report({"ERROR"}, "Object has to be IfcStairFlight type to add a stair.") self.report({"ERROR"}, "Object has to be IfcStairFlight type to add a stair.")
return {"CANCELLED"} return {"CANCELLED"}
props = obj.BIMStairProperties # need to make sure all default props will have correct units
if not props.stair_added_previously:
convert_property_group_from_si(
props,
skip_props=("stair_added_previously", "is_editing", "number_of_treads", "has_top_nib", "stair_type"),
)
stair_data = props.get_props_kwargs() stair_data = props.get_props_kwargs()
psets = ifcopenshell.util.element.get_psets(element) psets = ifcopenshell.util.element.get_psets(element)
@@ -360,6 +372,12 @@ class EnableEditingStair(bpy.types.Operator, tool.Ifc.Operator):
for prop_name in data: for prop_name in data:
setattr(props, prop_name, data[prop_name]) setattr(props, prop_name, data[prop_name])
# need to make sure all props that weren't used before
# will have correct units
skip_props = ("stair_added_previously", "is_editing", "number_of_treads", "has_top_nib", "stair_type")
skip_props += tuple(data.keys())
convert_property_group_from_si(props, skip_props=skip_props)
props.is_editing = 1 props.is_editing = 1
return {"FINISHED"} return {"FINISHED"}
@@ -371,12 +389,14 @@ class RemoveStair(bpy.types.Operator, tool.Ifc.Operator):
def _execute(self, context): def _execute(self, context):
obj = context.active_object obj = context.active_object
props = obj.BIMStairProperties
element = tool.Ifc.get_entity(obj) element = tool.Ifc.get_entity(obj)
obj.BIMStairProperties.is_editing = -1 obj.BIMStairProperties.is_editing = -1
pset = ifcopenshell.util.element.get_psets(element) pset = ifcopenshell.util.element.get_psets(element)
pset = tool.Ifc.get().by_id(pset["BBIM_Stair"]["id"]) pset = tool.Ifc.get().by_id(pset["BBIM_Stair"]["id"])
ifcopenshell.api.run("pset.remove_pset", tool.Ifc.get(), pset=pset) ifcopenshell.api.run("pset.remove_pset", tool.Ifc.get(), pset=pset)
props.stair_added_previously = True
return {"FINISHED"} return {"FINISHED"}
@@ -29,6 +29,7 @@ from ifcopenshell.api.geometry.add_window_representation import DEFAULT_PANEL_SC
import blenderbim import blenderbim
import blenderbim.tool as tool import blenderbim.tool as tool
import blenderbim.core.geometry as core import blenderbim.core.geometry as core
from blenderbim.bim.helper import convert_property_group_from_si
from blenderbim.bim.ifc import IfcStore from blenderbim.bim.ifc import IfcStore
from mathutils import Vector from mathutils import Vector
@@ -209,7 +210,7 @@ def update_window_modifier_bmesh(context):
first_transom_offset = props.first_transom_offset * si_conversion first_transom_offset = props.first_transom_offset * si_conversion
second_transom_offset = props.second_transom_offset * si_conversion second_transom_offset = props.second_transom_offset * si_conversion
glass_thickness = 10 * 0.001 * si_conversion glass_thickness = 0.01 * si_conversion
bm = bmesh.new() bm = bmesh.new()
panel_schema = list(reversed(panel_schema)) panel_schema = list(reversed(panel_schema))
@@ -371,17 +372,8 @@ class AddWindow(bpy.types.Operator, tool.Ifc.Operator):
props = obj.BIMWindowProperties props = obj.BIMWindowProperties
# need to make sure all default props will have correct units # need to make sure all default props will have correct units
si_conversion = 0.001 / ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
if not props.window_added_previously: if not props.window_added_previously:
for prop_name in props.bl_rna.properties.keys(): convert_property_group_from_si(props, skip_props=("is_editing", "window_type", "window_added_previously"))
if prop_name in ("rna_type", "name", "is_editing", "window_type", "window_added_previously"):
continue
prop_value = getattr(props, prop_name)
if type(prop_value) is float:
prop_value = prop_value * si_conversion
elif type(prop_value) is bpy.types.bpy_prop_array:
prop_value = [el * si_conversion for el in prop_value]
setattr(props, prop_name, prop_value)
window_data = props.get_general_kwargs() window_data = props.get_general_kwargs()
lining_props = props.get_lining_kwargs() lining_props = props.get_lining_kwargs()
@@ -478,18 +470,13 @@ class EnableEditingWindow(bpy.types.Operator, tool.Ifc.Operator):
# required since we could load pset from .ifc and BIMWindowProperties won't be set # required since we could load pset from .ifc and BIMWindowProperties won't be set
for prop_name in data: for prop_name in data:
setattr(props, prop_name, data[prop_name]) setattr(props, prop_name, data[prop_name])
# need to make sure all props that weren't used before # need to make sure all props that weren't used before
# will have correct units # will have correct units
si_conversion = 0.001 / ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get()) skip_props = ("is_editing", "window_type", "window_added_previously")
props_bl_rna = props.bl_rna.properties skip_props += tuple(data.keys())
for prop_name in props_bl_rna.keys(): convert_property_group_from_si(props, skip_props=skip_props)
if prop_name in data:
continue
if prop_name in ("rna_type", "name", "is_editing", "window_added_previously"):
continue
setattr(props, prop_name, props_bl_rna[prop_name].default*si_conversion)
props.is_editing = 1 props.is_editing = 1
return {"FINISHED"} return {"FINISHED"}
@@ -514,4 +501,4 @@ class RemoveWindow(bpy.types.Operator, tool.Ifc.Operator):
def add_object_button(self, context): def add_object_button(self, context):
self.layout.operator(BIM_OT_add_window.bl_idname, icon="PLUGIN") self.layout.operator(BIM_OT_add_window.bl_idname, icon="PLUGIN")
@@ -43,58 +43,66 @@ DEFAULT_PANEL_SCHEMAS = {
class Usecase: class Usecase:
def __init__(self, file, **settings): def __init__(self, file, **settings):
"""units in settings expected to be in ifc project units"""
self.file = file self.file = file
# http://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcWindow.htm # http://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcWindow.htm
# http://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcWindowTypePartitioningEnum.htm # http://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcWindowTypePartitioningEnum.htm
# http://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcWindowLiningProperties.htm # http://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcWindowLiningProperties.htm
# http://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcWindowPanelProperties.htm # http://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcWindowPanelProperties.htm
self.settings = { self.settings = {"unit_scale": ifcopenshell.util.unit.calculate_unit_scale(self.file)}
"context": None, # IfcGeometricRepresentationContext self.settings.update(
# SINGLE_PANEL, DOUBLE_PANEL_HORIZONTAL, DOUBLE_PANEL_VERTICAL, {
# TRIPLE_PANEL_BOTTOM, TRIPLE_PANEL_HORIZONTAL, TRIPLE_PANEL_LEFT, TRIPLE_PANEL_RIGHT, TRIPLE_PANEL_TOP, TRIPLE_PANEL_VERTICAL "context": None, # IfcGeometricRepresentationContext
"partition_type": "SINGLE_PANEL", # SINGLE_PANEL, DOUBLE_PANEL_HORIZONTAL, DOUBLE_PANEL_VERTICAL,
"overall_height": 900, # TRIPLE_PANEL_BOTTOM, TRIPLE_PANEL_HORIZONTAL, TRIPLE_PANEL_LEFT,
"overall_width": 600, # TRIPLE_PANEL_RIGHT, TRIPLE_PANEL_TOP, TRIPLE_PANEL_VERTICAL
"lining_properties": { "partition_type": "SINGLE_PANEL",
"LiningDepth": 50, "overall_height": self.convert_si_to_unit(0.9),
"LiningThickness": 50, "overall_width": self.convert_si_to_unit(0.6),
"LiningOffset": 50, # offset to the wall "lining_properties": {
"LiningToPanelOffsetX": 25, "LiningDepth": self.convert_si_to_unit(0.050),
"LiningToPanelOffsetY": 25, "LiningThickness": self.convert_si_to_unit(0.050),
# applies to DoublePanelVertical, TriplePanelBottom, TriplePanelTop, TriplePanelLeft, TriplePanelRight "LiningOffset": self.convert_si_to_unit(0.050), # offset to the wall
# mullion - horizontal distance between panels "LiningToPanelOffsetX": self.convert_si_to_unit(0.025),
"MullionThickness": 50, "LiningToPanelOffsetY": self.convert_si_to_unit(0.025),
"FirstMullionOffset": 300, # distance from the first lining to the mullion center # applies to DoublePanelVertical, TriplePanelBottom, TriplePanelTop,
# applies to TriplePanelVertical # TriplePanelLeft, TriplePanelRight
"SecondMullionOffset": 450, # distance from the first lining to the second mullion # mullion - horizontal distance between panels
# applies to DoublePanelHorizontal, TriplePanelBottom, TriplePanelTop, TriplePanelLeft, TriplePanelRight "MullionThickness": self.convert_si_to_unit(0.050),
# works similar way to mullion # distance from the first lining to the mullion center
"TransomThickness": 50, "FirstMullionOffset": self.convert_si_to_unit(0.3),
"FirstTransomOffset": 300, # applies to TriplePanelVertical
# applies to TriplePanelHorizontal # distance from the first lining to the second mullion
"SecondTransomOffset": 600, "SecondMullionOffset": self.convert_si_to_unit(0.45),
"ShapeAspectStyle": None, # DEPRECATED # applies to DoublePanelHorizontal, TriplePanelBottom, TriplePanelTop,
}, # TriplePanelLeft, TriplePanelRight
"panel_properties": [ # works similar way to mullion
{ "TransomThickness": self.convert_si_to_unit(0.050),
"FrameDepth": 35, # by Y "FirstTransomOffset": self.convert_si_to_unit(0.3),
"FrameThickness": 35, # by X # applies to TriplePanelHorizontal
# BOTTOM, LEFT, MIDDLE, RIGHT, TOP "SecondTransomOffset": self.convert_si_to_unit(0.6),
"PanelPosition": ...,
# defines the basic ways to describe how window panels operate
# how it's hanged, how it opens
"OperationType": None,
"ShapeAspectStyle": None, # DEPRECATED "ShapeAspectStyle": None, # DEPRECATED
}, },
], "panel_properties": [
} {
"FrameDepth": self.convert_si_to_unit(0.035), # by Y
"FrameThickness": self.convert_si_to_unit(0.035), # by X
# BOTTOM, LEFT, MIDDLE, RIGHT, TOP
"PanelPosition": ..., # NEVER USED
# defines the basic ways to describe how window panels operate
# how it's hanged, how it opens
"OperationType": None, # NEVER USED
"ShapeAspectStyle": None, # DEPRECATED
},
],
}
)
for key, value in settings.items(): for key, value in settings.items():
self.settings[key] = value self.settings[key] = value
self.settings["panel_schema"] = DEFAULT_PANEL_SCHEMAS[self.settings["partition_type"]] self.settings["panel_schema"] = DEFAULT_PANEL_SCHEMAS[self.settings["partition_type"]]
def execute(self): def execute(self):
self.settings["unit_scale"] = ifcopenshell.util.unit.calculate_unit_scale(self.file)
builder = ShapeBuilder(self.file) builder = ShapeBuilder(self.file)
overall_height = self.settings["overall_height"] overall_height = self.settings["overall_height"]
overall_width = self.settings["overall_width"] overall_width = self.settings["overall_width"]
@@ -115,7 +123,7 @@ class Usecase:
lining_offset = self.settings["lining_properties"]["LiningOffset"] lining_offset = self.settings["lining_properties"]["LiningOffset"]
lining_panel_offset_x = self.settings["lining_properties"]["LiningToPanelOffsetX"] lining_panel_offset_x = self.settings["lining_properties"]["LiningToPanelOffsetX"]
lining_panel_offset_y = self.settings["lining_properties"]["LiningToPanelOffsetY"] lining_panel_offset_y = self.settings["lining_properties"]["LiningToPanelOffsetY"]
glass_thickness = self.convert_si_to_unit(10) glass_thickness = self.convert_si_to_unit(0.01)
mullion_thickness = self.settings["lining_properties"]["MullionThickness"] / 2 mullion_thickness = self.settings["lining_properties"]["MullionThickness"] / 2
first_mullion_offset = self.settings["lining_properties"]["FirstMullionOffset"] first_mullion_offset = self.settings["lining_properties"]["FirstMullionOffset"]
@@ -331,4 +339,4 @@ class Usecase:
return representation return representation
def convert_si_to_unit(self, value): def convert_si_to_unit(self, value):
return value * 0.001 / self.settings["unit_scale"] return value / self.settings["unit_scale"]