A19grey commited on
Commit
8eda443
·
1 Parent(s): 2b69b2a

try to bug fix trimeshing simplification

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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
- mesh = mesh.simplify_quadratic_decimation(target_percent=0.8)
 
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