Refactor how offset and direction sense interact for wall and slabs.

This commit is contained in:
Bruno Perdigão
2025-01-25 16:05:04 -03:00
parent c49ca699eb
commit 2b1a59a4f8
5 changed files with 15 additions and 11 deletions
@@ -28,6 +28,7 @@ def add_wall_representation(
context: ifcopenshell.entity_instance,
length: float = 1.0,
height: float = 3.0,
direction_sense: str = "POSITIVE",
offset: float = 0.0,
thickness: float = 0.2,
x_angle: float = 0.0,
@@ -55,6 +56,7 @@ def add_wall_representation(
"context": context,
"length": length,
"height": height,
"direction_sense": direction_sense,
"offset": offset,
"thickness": thickness,
"x_angle": x_angle,
@@ -83,6 +85,8 @@ class Usecase:
length = self.convert_si_to_unit(self.settings["length"])
thickness = self.convert_si_to_unit(self.settings["thickness"])
thickness *= 1 / cos(self.settings["x_angle"])
if self.settings["direction_sense"] == "NEGATIVE":
thickness *= -1
points = (
(0.0, 0.0),
(0.0, thickness),