Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,6 +8,7 @@ import pymesh
|
|
| 8 |
from solid import *
|
| 9 |
from solid.utils import *
|
| 10 |
import os
|
|
|
|
| 11 |
|
| 12 |
def plot_vertices_and_mesh(vertices, faces):
|
| 13 |
fig = plt.figure()
|
|
@@ -28,11 +29,15 @@ def plot_convex_hull(points):
|
|
| 28 |
st.pyplot(plt)
|
| 29 |
|
| 30 |
def create_3d_meshes():
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
st.write("3D meshes saved to files.")
|
| 37 |
|
| 38 |
def create_solid_models():
|
|
|
|
| 8 |
from solid import *
|
| 9 |
from solid.utils import *
|
| 10 |
import os
|
| 11 |
+
import trimesh
|
| 12 |
|
| 13 |
def plot_vertices_and_mesh(vertices, faces):
|
| 14 |
fig = plt.figure()
|
|
|
|
| 29 |
st.pyplot(plt)
|
| 30 |
|
| 31 |
def create_3d_meshes():
|
| 32 |
+
# Create a box mesh
|
| 33 |
+
box_a = trimesh.creation.box(extents=[1, 1, 1])
|
| 34 |
+
box_a.export('pymesh_example_01.stl')
|
| 35 |
+
|
| 36 |
+
# Create another box mesh and perform a boolean operation
|
| 37 |
+
box_b = trimesh.creation.box(extents=[0.2, 0.2, 1], translate=[0.4, 0.4, 0])
|
| 38 |
+
box_c = box_a.difference(box_b)
|
| 39 |
+
box_c.export('pymesh_example_02.stl')
|
| 40 |
+
|
| 41 |
st.write("3D meshes saved to files.")
|
| 42 |
|
| 43 |
def create_solid_models():
|