Created
February 26, 2024 08:19
-
-
Save geyang/5a1aef3dbb4ab9ab7d42cfe690e1ccb5 to your computer and use it in GitHub Desktop.
Python script for simplifying mesh files in a URDF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import trimesh # Replace with your chosen library | |
files = ['obj/calf.obj', | |
'obj/hip.obj', | |
'obj/thigh_mirror.obj', | |
'obj/thigh.obj', | |
'obj/trunk.obj', | |
] | |
for file in files: | |
mesh = trimesh.load(file) | |
simplified_mesh = mesh.simplify_quadratic(target_face_count=1000) # Replace with desired number | |
trimesh.exchange.export.export_mesh(simplified_mesh, "simplified_"+file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment