Skip to content

Commit a7b089b

Browse files
authored
[MISC] Remove fast_simplification submodule. (#1497)
1 parent a03870c commit a7b089b

File tree

20 files changed

+29
-3254
lines changed

20 files changed

+29
-3254
lines changed

MANIFEST.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ include LICENSE
33
recursive-include genesis/assets *
44
recursive-include genesis/ext/pyrender/fonts *
55
recursive-include genesis/ext/pyrender/shaders *
6-
include genesis/ext/VolumeSampling
7-
include genesis/ext/fast_simplification/*.h
6+
include genesis/ext/VolumeSampling

genesis/engine/mesh.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import pickle as pkl
33

4+
import fast_simplification
45
import numpy as np
56
import numpy.typing as npt
67
import pyvista as pv
@@ -14,7 +15,6 @@
1415
import genesis.utils.gltf as gltf_utils
1516
import genesis.utils.usda as usda_utils
1617
import genesis.utils.particle as pu
17-
from genesis.ext import fast_simplification
1818
from genesis.repr_base import RBC
1919

2020

@@ -93,15 +93,23 @@ def decimate(self, decimate_face_num, decimate_aggressiveness, convexify):
9393
"""
9494
if self._mesh.vertices.shape[0] > 3 and self._mesh.faces.shape[0] > decimate_face_num:
9595
self._mesh.process(validate=True)
96-
self._mesh = trimesh.Trimesh(
97-
*fast_simplification.simplify(
98-
self._mesh.vertices,
99-
self._mesh.faces,
100-
target_count=decimate_face_num,
101-
agg=decimate_aggressiveness,
102-
lossless=(decimate_aggressiveness == 0),
96+
# TODO: lossless option support is pending on fast_simplification package.
97+
# NOTE: https://github.com/pyvista/fast-simplification/pull/71
98+
if decimate_aggressiveness == 0:
99+
gs.logger.debug("Lossless simplification is not supported yet. Not applying simplification.")
100+
self._mesh = trimesh.Trimesh(
101+
vertices=self._mesh.vertices,
102+
faces=self._mesh.faces,
103+
)
104+
else:
105+
self._mesh = trimesh.Trimesh(
106+
*fast_simplification.simplify(
107+
self._mesh.vertices,
108+
self._mesh.faces,
109+
target_count=decimate_face_num,
110+
agg=decimate_aggressiveness,
111+
)
103112
)
104-
)
105113

106114
# need to run convexify again after decimation, because sometimes decimating a convex-mesh can make it non-convex...
107115
if convexify:

genesis/ext/fast_simplification/LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)