Spaces:
Running
on
Zero
Running
on
Zero
try to bug fix trimeshing simplification
Browse files
app.py
CHANGED
@@ -112,7 +112,8 @@ def generate_3d_model(depth, image_path, focallength_px):
|
|
112 |
print("Original mesh - vertices: {}, faces: {}".format(len(mesh.vertices), len(mesh.faces)))
|
113 |
|
114 |
# 1. Mesh simplification
|
115 |
-
|
|
|
116 |
print("After simplification - vertices: {}, faces: {}".format(len(mesh.vertices), len(mesh.faces)))
|
117 |
|
118 |
# 2. Remove small disconnected components
|
|
|
112 |
print("Original mesh - vertices: {}, faces: {}".format(len(mesh.vertices), len(mesh.faces)))
|
113 |
|
114 |
# 1. Mesh simplification
|
115 |
+
target_faces = int(len(mesh.faces) * 0.8) # Simplify to 80% of original faces
|
116 |
+
mesh = mesh.simplify_quadric_decimation(face_count=target_faces)
|
117 |
print("After simplification - vertices: {}, faces: {}".format(len(mesh.vertices), len(mesh.faces)))
|
118 |
|
119 |
# 2. Remove small disconnected components
|