mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 13:36:25 +00:00
Merge pull request #2377 from Martin15135215/v0.7.0
From append methode to use numpy and ifcpatch bug
This commit is contained in:
@@ -25,6 +25,7 @@ import ifcopenshell.api
|
|||||||
import ifcopenshell.api.owner.settings
|
import ifcopenshell.api.owner.settings
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
class Obj2Ifc:
|
class Obj2Ifc:
|
||||||
def __init__(self, path):
|
def __init__(self, path):
|
||||||
@@ -35,9 +36,11 @@ class Obj2Ifc:
|
|||||||
self.create_ifc_file(version)
|
self.create_ifc_file(version)
|
||||||
self.scene = pywavefront.Wavefront(self.path, create_materials=True, collect_faces=True)
|
self.scene = pywavefront.Wavefront(self.path, create_materials=True, collect_faces=True)
|
||||||
for mesh in self.scene.mesh_list:
|
for mesh in self.scene.mesh_list:
|
||||||
ifc_faces = []
|
|
||||||
for face in mesh.faces:
|
faces = mesh.faces
|
||||||
ifc_faces.append(
|
ifc_faces = np.zeros([len(faces)], dtype=object)
|
||||||
|
for i, face in enumerate(faces):
|
||||||
|
ifc_faces[i] = (
|
||||||
self.file.createIfcFace(
|
self.file.createIfcFace(
|
||||||
[
|
[
|
||||||
self.file.createIfcFaceOuterBound(
|
self.file.createIfcFaceOuterBound(
|
||||||
@@ -57,7 +60,7 @@ class Obj2Ifc:
|
|||||||
self.context,
|
self.context,
|
||||||
"Body",
|
"Body",
|
||||||
"Brep",
|
"Brep",
|
||||||
[self.file.createIfcFacetedBrep(self.file.createIfcClosedShell(ifc_faces))],
|
[self.file.createIfcFacetedBrep(self.file.createIfcClosedShell(ifc_faces.tolist()))],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user