3 import pyexotica
as exo
8 from nose.plugins.skip
import SkipTest
10 raise SkipTest(
"trimesh is not available, skipping related tests.")
14 print(mesh, mesh.vertex_count, mesh.triangle_count)
15 assert mesh.vertex_count == 33
16 assert mesh.triangle_count == 62
22 print(
">>> Loading STL directly from package-path")
23 mesh = exo.Mesh.createMeshFromResource(
24 "package://exotica_examples/resources/cone.stl"
30 print(
">>> Loading STL from Exotica-resource-path")
31 mesh = exo.Mesh.createMeshFromResource(
"{exotica_examples}/resources/cone.stl")
35 print(
">>> Loading OBJ from Exotica-resource-path")
36 mesh = exo.Mesh.createMeshFromResource(
"{exotica_examples}/resources/cone.obj")
41 print(
">>> Creating mesh from list of vertices")
43 m = trimesh.load(exo.Tools.parse_path(
"{exotica_examples}/resources/cone.obj"))
44 vertices = [m.vertices[i]
for i
in m.faces.flatten()]
45 mesh = exo.Mesh.createMeshFromVertices(vertices)
50 print(
">>> Creating mesh from list of vertices and list of triangles")
51 m = trimesh.load(exo.Tools.parse_path(
"{exotica_examples}/resources/cone.stl"))
52 mesh = exo.Mesh.createMeshFromVertices(m.vertices, m.faces.flatten())
56 if __name__ ==
"__main__":