Fix issue where walls are created with obtuse x_angle. See #5938

This commit is contained in:
Bruno Perdigão
2025-02-26 13:00:11 -03:00
parent e68c47a897
commit 2609a8293c
2 changed files with 3 additions and 2 deletions
@@ -85,6 +85,7 @@ def get_wall_preview_data(context, relating_type):
if x_angle > radians(90) or x_angle < radians(-90): if x_angle > radians(90) or x_angle < radians(-90):
height *= -1 height *= -1
angle_distance = height * tan(x_angle) angle_distance = height * tan(x_angle)
thickness *= 1 / cos(x_angle)
data = {} data = {}
data["verts"] = [] data["verts"] = []
@@ -18,7 +18,7 @@
import ifcopenshell.util.element import ifcopenshell.util.element
import ifcopenshell.util.unit import ifcopenshell.util.unit
from math import sin, cos from math import sin, cos, pi
from typing import Optional, Union, Any from typing import Optional, Union, Any
from ifcopenshell.util.data import Clipping from ifcopenshell.util.data import Clipping
@@ -112,7 +112,7 @@ class Usecase:
self.file.createIfcDirection((1.0, 0.0, 0.0)), self.file.createIfcDirection((1.0, 0.0, 0.0)),
), ),
extrusion_direction, extrusion_direction,
self.convert_si_to_unit(self.settings["height"]) * (1 / cos(self.settings["x_angle"])), self.convert_si_to_unit(self.settings["height"]) * abs((1 / cos(self.settings["x_angle"]))),
) )
if self.settings["booleans"]: if self.settings["booleans"]:
extrusion = self.apply_booleans(extrusion) extrusion = self.apply_booleans(extrusion)