From 9778253d21d886639310ed4367a91e4af2062f4d Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 14 Sep 2023 13:15:43 +0500 Subject: [PATCH] bends - support for zero radius bends --- .../ifcopenshell/util/shape_builder.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/shape_builder.py b/src/ifcopenshell-python/ifcopenshell/util/shape_builder.py index ccedb3f107..b85ab7b411 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/shape_builder.py +++ b/src/ifcopenshell-python/ifcopenshell/util/shape_builder.py @@ -1354,7 +1354,6 @@ class ShapeBuilder: return V(profile.Radius, profile.Radius, depth) return None - # TODO: test with 0 radius si_conversion = ifcopenshell.util.unit.calculate_unit_scale(self.file) profile = get_profile(segment) is_circular_profile = profile.is_a("IfcCircleProfileDef") @@ -1397,10 +1396,14 @@ class ShapeBuilder: arc_points = (1,) else: outer_r = r + 2 * profile_dim[lateral_axis] - inner_points = [get_circle_point(cur_theta, r) for cur_theta in theta_segments] outer_points = [get_circle_point(cur_theta, outer_r) for cur_theta in theta_segments[::-1]] - points = inner_points + outer_points - arc_points = (1, 4) + if is_x(r, 0): + points = [get_circle_point(theta, r)] + outer_points + arc_points = (2,) + else: + inner_points = [get_circle_point(cur_theta, r) for cur_theta in theta_segments] + points = inner_points + outer_points + arc_points = (1, 4) points = [p + O for p in points] offset = V(0, 0, 0)