mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 03:05:33 +00:00
Fix issue where walls are created with obtuse x_angle. See #5938
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user