Skip to content

Commit

Permalink
fix: re-simplification works
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Nov 2, 2023
1 parent 9b2970e commit e1966c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cMesher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ class CMesher {
triangles,
generate_normals,
simplification_factor,
max_simplification_error
max_simplification_error,
false
);
}

Expand Down
6 changes: 4 additions & 2 deletions zmesh/_zmesh.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class Mesher:
Returns: Mesh
"""
mesher = new CMesher[uint64_t, uint64_t, float](self.voxel_res)
mesher = new CMesher[uint64_t, uint64_t, float]((1,1,1))

cdef size_t ti = 0
cdef size_t vi = 0
Expand All @@ -252,6 +252,8 @@ class Mesher:
(triangles.shape[0], 3), dtype=np.uint64, order='C'
)

max_error //= np.sqrt(np.sum(self.voxel_res ** 2))

triangles /= self.voxel_res
triangles *= 2.0
cdef float min_vertex = np.min(triangles)
Expand Down Expand Up @@ -285,7 +287,7 @@ class Mesher:
for i in range(len(result.points)):
result.points[i] += min_vertex

return self._normalize_simplified_mesh(result, voxel_centered, physical=True)
return self._normalize_simplified_mesh(result, voxel_centered, physical=False)

def clear(self):
self._mesher.clear()
Expand Down

0 comments on commit e1966c9

Please sign in to comment.