changed stl to trimesh
This commit is contained in:
parent
5720eca3c3
commit
7329e36bc8
|
@ -4,8 +4,8 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|||
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
||||
"""
|
||||
import numpy as np
|
||||
import stl
|
||||
from helpers.geometry_helper import GeometryHelper
|
||||
from trimesh import Trimesh
|
||||
|
||||
|
||||
class Polyhedron:
|
||||
|
@ -24,7 +24,7 @@ class Polyhedron:
|
|||
|
||||
def _position_of(self, point):
|
||||
vertices = self.vertices
|
||||
for i in enumerate(vertices):
|
||||
for i in range(len(vertices)):
|
||||
if self._geometry.almost_equal(vertices[i], point):
|
||||
return i
|
||||
return -1
|
||||
|
@ -70,10 +70,10 @@ class Polyhedron:
|
|||
@property
|
||||
def _polyhedron_mesh(self):
|
||||
if self._mesh is None:
|
||||
self._mesh = stl.mesh.Mesh(np.zeros(self.faces.shape[0], dtype=stl.mesh.Mesh.dtype))
|
||||
for i, faces in enumerate(self.faces):
|
||||
for j in range(3):
|
||||
self._mesh.vectors[i][j] = self.vertices[faces[j], :]
|
||||
self._mesh = Trimesh(vertices=np.asarray(self.vertices), faces=np.asarray(self.faces))
|
||||
if not self._mesh.is_volume:
|
||||
print('error')
|
||||
return None
|
||||
return self._mesh
|
||||
|
||||
@property
|
||||
|
@ -83,7 +83,7 @@ class Polyhedron:
|
|||
:return: float
|
||||
"""
|
||||
if self._volume is None:
|
||||
self._volume, _, _ = self._polyhedron_mesh.get_mass_properties()
|
||||
self._volume = self._polyhedron_mesh.volume
|
||||
return self._volume
|
||||
|
||||
@property
|
||||
|
@ -92,7 +92,10 @@ class Polyhedron:
|
|||
Polyhedron maximal z value
|
||||
:return: float
|
||||
"""
|
||||
return self._polyhedron_mesh.z.max()
|
||||
bounds = self._polyhedron_mesh.bounds
|
||||
z_max = max(bounds[:, 2])
|
||||
print(z_max)
|
||||
return z_max
|
||||
|
||||
def save(self, full_path):
|
||||
"""
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
# These values are intended as configurable assumptions
|
||||
[convective_fluxes]
|
||||
h_i = 10 # W/m2K
|
||||
h_e = 25 # W/m2K
|
||||
# interior convective coefficient in W/m2K
|
||||
h_i = 10
|
||||
# exterior convective coefficient in W/m2K
|
||||
h_e = 25
|
||||
|
||||
[windows]
|
||||
frame_ratio = 0
|
||||
|
|
Loading…
Reference in New Issue
Block a user