Coder Social home page Coder Social logo

issacchan26 / mesh-processing Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 1.0 32 KB

Python scripts for converting mesh formats, mesh simplification and mesh rigid transformation

Python 100.00%
mesh-editing mesh-formats mesh-processing mesh-simplification mesh-transform point-cloud point-cloud-processing point-cloud-segmentation

mesh-processing's Introduction

Mesh processing

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

Getting Started

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

Usage

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

Mesh simplification

reduce the mesh to target vertices
You may adjust the the number of vertices by changing the parameter TARGET (default=10000)

Mesh format convert

obj to pcd format
obj to ply format

Convert txt file into obj mesh

txt to obj format
xyz to obj format

Mesh rigid transform

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)

Point cloud annotation operation

output the annotation to simplified txt
add rgb value into ply file
Please refer to point-cloud-annotation for more details

Invisible spaces in .ply file

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

mesh-processing's People

Contributors

cpii3dprocessing avatar issacchan26 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

letturl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.