ctlee / gamer

Geometry-preserving Adaptive Mesher
https://gamer.readthedocs.io
Other
32 stars 10 forks source link

Smoothing mesh produces 0 length vectors #57

Closed quasiTriestino closed 1 year ago

quasiTriestino commented 1 year ago

I have a mesh, which I've cleaned to the following stats report:

Volume: 0.37027242
Area: 4.81979153
Wagonwheels: 770
Sharp faces: 14370
Non Manifold Edge: 628
Bad Contig. Edges: 0
Non Manifold Vertices: 0
Intersect Face: 0
Zero Area Faces: 0
Zero Len. Edges: 0

The non-manifold edges (highlighted below) exist only along the uncut edges of the mesh:

Screenshot from 2023-03-08 06-07-57

When smoothing (10 iterations), I get through most of the iterations, before hitting Error: Cannot normalize a vector with a length of 0. Here is an example of the verbose output while smoothing:

Initial Quality: Min Angle = 0.0969765, Max Angle = 179.711, # smaller-than-15 = 14342, # larger-than-165 = 149
Iteration 1:
Min Angle = 0.0557989, Max Angle = 179.657, # smaller-than-15 = 13242, # larger-than-165 = 206
Iteration 2:
Min Angle = 0.0355666, Max Angle = 179.501, # smaller-than-15 = 12008, # larger-than-165 = 272
Iteration 3:
Min Angle = 0.050625, Max Angle = 179.501, # smaller-than-15 = 10072, # larger-than-165 = 287
Iteration 4:
Min Angle = 0.133798, Max Angle = 179.66, # smaller-than-15 = 8008, # larger-than-165 = 258
Iteration 5:
Min Angle = 0.158066, Max Angle = 179.501, # smaller-than-15 = 6134, # larger-than-165 = 222
Iteration 6:
Min Angle = 0.00169172, Max Angle = 179.997, # smaller-than-15 = 4758, # larger-than-165 = 195
Iteration 7:
Min Angle = 0.00169172, Max Angle = 179.997, # smaller-than-15 = 3459, # larger-than-165 = 152

Can you offer any guidance as to what might be leading me to a point where I'm trying to normalize a 0 length vector? I don't have problems in other meshes that are similar to this example, so I'm curious what the difference might be. Thanks!

ctlee commented 1 year ago

Would you be willing a share a file or mesh to help me reproduce the issue?