From 4b558604cc5c1c47fb5330b5321c0f7d0ebd2ec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Perdig=C3=A3o?= Date: Fri, 8 Nov 2024 10:33:07 -0300 Subject: [PATCH] Remove mathutils dependency from `add_slab_representation.py` --- src/bonsai/bonsai/bim/module/model/slab.py | 2 +- .../ifcopenshell/api/geometry/add_slab_representation.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/model/slab.py b/src/bonsai/bonsai/bim/module/model/slab.py index 30512789eb..90fda177c9 100644 --- a/src/bonsai/bonsai/bim/module/model/slab.py +++ b/src/bonsai/bonsai/bim/module/model/slab.py @@ -84,7 +84,7 @@ class DumbSlabGenerator: polyline_data = bpy.context.scene.BIMPolylineProperties.insertion_polyline polyline_points = polyline_data[0].polyline_points if polyline_data else [] self.location = Vector((polyline_points[0].x, polyline_points[0].y, self.container_obj.location.z)) - self.polyline = [Vector((p.x, p.y, 0.0)) - self.location for p in polyline_points] + self.polyline = [tuple(Vector((p.x, p.y, 0.0)) - self.location) for p in polyline_points] if len(self.polyline) <= 2: return diff --git a/src/ifcopenshell-python/ifcopenshell/api/geometry/add_slab_representation.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/add_slab_representation.py index c30375dd6a..90ebf0df1b 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/geometry/add_slab_representation.py +++ b/src/ifcopenshell-python/ifcopenshell/api/geometry/add_slab_representation.py @@ -19,7 +19,6 @@ import ifcopenshell.util.unit from ifcopenshell.util.data import Clipping from math import sin, cos -from mathutils import Vector from typing import Any, Optional, Union @@ -35,7 +34,7 @@ def add_slab_representation( # Planes are defined either by Clipping objects # or by dictionaries of arguments for `Clipping.parse` clippings: Optional[list[Union[Clipping, dict[str, Any]]]] = None, - polyline: Optional[list[Vector]] = None, + polyline: Optional[list[tuple]] = None, ) -> ifcopenshell.entity_instance: usecase = Usecase() usecase.file = file