Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/bonsai/bonsai/bim/module/model/wall.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,14 +468,16 @@
existing_x_angle = 0 if tool.Cad.is_x(existing_x_angle, 0, tolerance=0.001) else existing_x_angle
existing_x_angle = 0 if tool.Cad.is_x(existing_x_angle, pi, tolerance=0.001) else existing_x_angle

coord_list = builder.get_polyline_coords(extrusion.SweptArea.OuterCurve)
coord_list = [
(p[0], p[1] * abs(cos(existing_x_angle))) for p in coord_list
] # Reset the transformation and returns to the original points with 0 degrees
coord_list = [
(p[0], p[1] * abs(1 / cos(x_angle))) for p in coord_list
] # Apply the transformation for the new x_angle
builder.set_polyline_coords(extrusion.SweptArea.OuterCurve, coord_list)
profiles = extrusion.SweptArea.Profiles if extrusion.SweptArea.is_a("IfcCompositeProfileDef") else [extrusion.SweptArea]

Check failure on line 471 in src/bonsai/bonsai/bim/module/model/wall.py

View workflow job for this annotation

GitHub Actions / lint-formatting

Black Format Issue

Black formatting issue in /home/runner/work/IfcOpenShell/IfcOpenShell/src/bonsai/bonsai/bim/module/model/wall.py

Check failure on line 471 in src/bonsai/bonsai/bim/module/model/wall.py

View workflow job for this annotation

GitHub Actions / lint-formatting

Black Format Issue

Black formatting issue in /home/runner/work/IfcOpenShell/IfcOpenShell/src/bonsai/bonsai/bim/module/model/wall.py
for profile in profiles:
coord_list = builder.get_polyline_coords(profile.OuterCurve)
coord_list = [
(p[0], p[1] * abs(cos(existing_x_angle))) for p in coord_list
] # Reset the transformation and returns to the original points with 0 degrees
coord_list = [
(p[0], p[1] * abs(1 / cos(x_angle))) for p in coord_list
] # Apply the transformation for the new x_angle
builder.set_polyline_coords(profile.OuterCurve, coord_list)

# The extrusion direction calculated previously default to the positive direction
# Here we set the extrusion direction to negative if that's the case
Expand Down
Loading