From bf8c3530a1e367ded969c2af4f69a59db63f6155 Mon Sep 17 00:00:00 2001 From: Richard Brice <37087370+RickBrice@users.noreply.github.com> Date: Sat, 2 Nov 2024 14:42:44 -0700 Subject: [PATCH] Fixes piecewise function evaluation in alignment api --- src/ifcopenshell-python/ifcopenshell/alignment.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/alignment.py b/src/ifcopenshell-python/ifcopenshell/alignment.py index 14c9c5e8d5..9b52da0d84 100644 --- a/src/ifcopenshell-python/ifcopenshell/alignment.py +++ b/src/ifcopenshell-python/ifcopenshell/alignment.py @@ -47,8 +47,9 @@ def evaluate_representation(shape_rep: entity_instance, dist_along: float) -> np s = ifcopenshell.geom.settings() piecewise_function = ifcopenshell_wrapper.map_shape(s, shape_rep.wrapped_data) + pwf_evaluator = ifcopenshell_wrapper.piecewise_function_evaluator(piecewise_function,s) - trans_matrix = piecewise_function.evaluate(dist_along) + trans_matrix = pwf_evaluator.evaluate(dist_along) return np.array(trans_matrix, dtype=np.float64).T @@ -68,8 +69,9 @@ def evaluate_segment(segment: entity_instance, dist_along: float) -> np.ndarray: s = ifcopenshell.geom.settings() piecewise_function = ifcopenshell_wrapper.map_shape(s, segment.wrapped_data) + pwf_evaluator = ifcopenshell_wrapper.piecewise_function_evaluator(piecewise_function,s) - trans_matrix = piecewise_function.evaluate(dist_along) + trans_matrix = pwf_evaluator.evaluate(dist_along) return np.array(trans_matrix, dtype=np.float64).T