mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 14:31:39 +00:00
shapebuilder - replace y extrusion args with shortcut for readibility
This commit is contained in:
@@ -274,9 +274,7 @@ class FilledOpeningGenerator:
|
|||||||
get_curve_2d_from_3d(profile),
|
get_curve_2d_from_3d(profile),
|
||||||
magnitude=thickness / unit_scale,
|
magnitude=thickness / unit_scale,
|
||||||
position=Vector([0.0, -thickness * 0.5 / unit_scale, 0.0]),
|
position=Vector([0.0, -thickness * 0.5 / unit_scale, 0.0]),
|
||||||
position_x_axis=Vector((1, 0, 0)),
|
**shape_builder.extrude_kwargs("Y")
|
||||||
position_z_axis=Vector((0, -1, 0)),
|
|
||||||
extrusion_vector=Vector((0, 0, -1)),
|
|
||||||
)
|
)
|
||||||
return shape_builder.get_representation(context, [extrusion])
|
return shape_builder.get_representation(context, [extrusion])
|
||||||
|
|
||||||
@@ -309,9 +307,7 @@ class FilledOpeningGenerator:
|
|||||||
shape_builder.rectangle(size=opening_size),
|
shape_builder.rectangle(size=opening_size),
|
||||||
magnitude=thickness / unit_scale,
|
magnitude=thickness / unit_scale,
|
||||||
position=opening_position,
|
position=opening_position,
|
||||||
position_z_axis=Vector((0.0, -1.0, 0.0)),
|
**shape_builder.extrude_kwargs("Y")
|
||||||
position_x_axis=Vector((1.0, 0.0, 0.0)),
|
|
||||||
extrusion_vector=Vector((0.0, 0.0, -1.0)),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return shape_builder.get_representation(context, [extrusion])
|
return shape_builder.get_representation(context, [extrusion])
|
||||||
|
|||||||
@@ -68,9 +68,7 @@ def update_simple_openings(element, opening_width, opening_height):
|
|||||||
shape_builder.rectangle(size=Vector([opening_width, 0.0, opening_height]).xz),
|
shape_builder.rectangle(size=Vector([opening_width, 0.0, opening_height]).xz),
|
||||||
magnitude=thickness / unit_scale,
|
magnitude=thickness / unit_scale,
|
||||||
position=Vector([0.0, -0.1 / unit_scale, 0.0]),
|
position=Vector([0.0, -0.1 / unit_scale, 0.0]),
|
||||||
position_x_axis=V(1, 0, 0),
|
**shape_builder.extrude_kwargs("Y")
|
||||||
position_z_axis=V(0, -1, 0),
|
|
||||||
extrusion_vector=V(0, 0, -1),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
new_representation = shape_builder.get_representation(context, extrusion)
|
new_representation = shape_builder.get_representation(context, extrusion)
|
||||||
|
|||||||
@@ -1134,8 +1134,7 @@ class LibraryGenerator:
|
|||||||
back_wall_extruded = builder.extrude(
|
back_wall_extruded = builder.extrude(
|
||||||
back_wall,
|
back_wall,
|
||||||
back_wall_depth + back_wall_border_mask_depth,
|
back_wall_depth + back_wall_border_mask_depth,
|
||||||
position_z_axis=V(0, -1, 0),
|
**builder.extrude_kwargs("Y")
|
||||||
extrusion_vector=V(0, 0, -1),
|
|
||||||
)
|
)
|
||||||
items_3d_to_center.append(back_wall_extruded)
|
items_3d_to_center.append(back_wall_extruded)
|
||||||
|
|
||||||
|
|||||||
@@ -66,9 +66,7 @@ def create_ifc_door_lining(
|
|||||||
door_lining = builder.extrude(
|
door_lining = builder.extrude(
|
||||||
door_lining,
|
door_lining,
|
||||||
size.y,
|
size.y,
|
||||||
position_x_axis=V(1, 0, 0),
|
**builder.extrude_kwargs("Y")
|
||||||
position_z_axis=V(0, -1, 0),
|
|
||||||
extrusion_vector=V(0, 0, -1),
|
|
||||||
)
|
)
|
||||||
builder.translate(door_lining, position)
|
builder.translate(door_lining, position)
|
||||||
|
|
||||||
|
|||||||
@@ -59,10 +59,8 @@ def create_ifc_window_frame_simple(
|
|||||||
return builder.extrude(
|
return builder.extrude(
|
||||||
profile,
|
profile,
|
||||||
size.y,
|
size.y,
|
||||||
position_x_axis=V(1, 0, 0),
|
|
||||||
position_z_axis=V(0, -1, 0),
|
|
||||||
extrusion_vector=V(0, 0, -1),
|
|
||||||
position=position,
|
position=position,
|
||||||
|
**builder.extrude_kwargs("Y")
|
||||||
)
|
)
|
||||||
|
|
||||||
# if all lining sides are present then we can just use two rectangles
|
# if all lining sides are present then we can just use two rectangles
|
||||||
@@ -212,10 +210,8 @@ def create_ifc_window(
|
|||||||
glass = builder.extrude(
|
glass = builder.extrude(
|
||||||
glass_rect,
|
glass_rect,
|
||||||
glass_thickness,
|
glass_thickness,
|
||||||
position_x_axis=V(1, 0, 0),
|
|
||||||
position_z_axis=V(0, -1, 0),
|
|
||||||
extrusion_vector=V(0, 0, -1),
|
|
||||||
position=glass_position,
|
position=glass_position,
|
||||||
|
**builder.extrude_kwargs("Y")
|
||||||
)
|
)
|
||||||
|
|
||||||
output_items = [lining_items, frame_extruded_items, [glass]]
|
output_items = [lining_items, frame_extruded_items, [glass]]
|
||||||
|
|||||||
Reference in New Issue
Block a user