mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix recent regression where util.shape.get_vertices returns a read-only array, so you can't edit in place (e.g. for offsets)
This commit is contained in:
@@ -1040,7 +1040,7 @@ class IfcImporter:
|
||||
if cartesian_point_offset is False:
|
||||
mesh["has_cartesian_point_offset"] = False
|
||||
elif cartesian_point_offset is not None:
|
||||
verts -= cartesian_point_offset
|
||||
verts = verts - cartesian_point_offset
|
||||
|
||||
mesh["has_cartesian_point_offset"] = True
|
||||
mesh["cartesian_point_offset"] = (
|
||||
@@ -1048,9 +1048,8 @@ class IfcImporter:
|
||||
)
|
||||
elif verts.size and tool.Loader.is_point_far_away(verts[0], is_meters=True):
|
||||
# Shift geometry close to the origin based off that first vert it found
|
||||
verts_array = np.array(geometry.verts)
|
||||
offset = verts[0]
|
||||
verts -= offset
|
||||
verts = verts - offset
|
||||
|
||||
mesh["has_cartesian_point_offset"] = True
|
||||
mesh["cartesian_point_offset"] = f"{offset[0]},{offset[1]},{offset[2]}"
|
||||
|
||||
@@ -1759,7 +1759,7 @@ class Geometry(bonsai.core.tool.Geometry):
|
||||
geometry = tool.Loader.create_generic_shape(item)
|
||||
verts = ifcopenshell.util.shape.get_vertices(geometry)
|
||||
if (cartesian_point_offset := cls.get_cartesian_point_offset(rep_obj)) is not None:
|
||||
verts -= cartesian_point_offset
|
||||
verts = verts - cartesian_point_offset
|
||||
tool.Loader.convert_geometry_to_mesh(geometry, obj.data, verts=verts)
|
||||
|
||||
if ios_materials := list(obj.data["ios_materials"]):
|
||||
|
||||
Reference in New Issue
Block a user