This repo is to provide a series of algorithm to process mesh and point cloud files.
It provides format transfer, mesh simplification, mesh rigid transform and point cloud (.PCD) annotation transform
Use the pip to install dependencies, you may use conda instead
For PyTorch3D, please follow this link to install: https://github.com/facebookresearch/pytorch3d/blob/main/INSTALL.md
pip install numpy
pip install pandas
pip install pymeshlab
pip install open3d
Create the corresponding folder before you run the script.
For example, in mesh simplification, you need to create two folders: "mesh_data" and "output_mesh"
Make sure the directories are created as below:
├── mesh_data
│ ├── 1_139.obj
│ ├── 1_141.obj
├── output_mesh
└── mesh_reduce.py
reduce the mesh to target vertices
You may adjust the the number of vertices by changing the parameter TARGET (default=10000)
obj to pcd format
obj to ply format
txt to obj format
xyz to obj format
Currently we suppor .obj format as input for meshes
mesh augmentation provides three functions for mesh augmentations:rotation, translation and scaling.
shrink and fatten provides the Blender function: "shrink and fatten", to change the shape of meshes by moving selected vertices along their own normal (perpendicular to the face)
output the annotation to simplified txt
add rgb value into ply file
Please refer to point-cloud-annotation for more details
For each ply file generated, there maybe some spaces randomly generated by the library. It may cause the ply file cannot be read.
To remove the spaces, please run following code with terminal inside the folder:
sed -i 's/[ \t]*$//' *.ply