Code Monkey home page Code Monkey logo

parallelqslim's Introduction

ParallelQSlim

Shape aware parallel mesh simplification algorithm

This work elaborates a parallel algorithm based on quadric error metric and adaptive thresholding to simplify a triangle mesh. The approach emphasizes planar surfaces as a target to simplify. The main goal was to create a framework able to produce high quality progressive meshes based on reconstructed ones from environment. Those meshes are characterized by constant resoulution of reconstruction, therefore storing vertices for planar surfaces evenly accros the shape, which is not necessary.

output_1

The project implements QSlim algorithm and extends it with parallel approach and global planar surfaces simplification. There are 3 available quadric metrics:

Geometry
Color + Geometry
Normals + Color + Geoemtry

The project needs two libraries:

Installation:
    sudo apt-get install libboost-all-dev libeigen3-dev

Check out discord #general for more info or help. discord

Here you can read the report which summarizes the whole work.
Default reader accepts as an input mesh only those with binary encoding.

Usage:
mkdir build
cd build
cmake ../
make -j 4
./main --in ../resources/armadillo.ply --out ../output/simply.ply -f -a 7.5 -c 2 -t 4 -r 8
Allowed options:
  -h [ --help ]                    Produce help message
  --in arg                         Path fine input mesh
  --out arg                        Output path of simplified mesh
  -v [ --verbose ]                 Show debug output
  -f [ --force ]                   Enable file overwrite
  -s [ --smooth ]                  Smooth the mesh using Taubin
  -w [ --weight ] arg (=0)         Quadric error weighting strategy
                                    0 = none
                                    1 = area
                                   
  -r [ --reduction ] arg (=75)      The percentage reduction which we want to 
                                   achieve; e.g. 10 of the input mesh
  -i [ --max-iter ] arg (=10)       Max iterations to perform
  -t [ --threads ] arg (=1)        Number of threads
  -q [ --quadric ] arg (=3)        Type of quadric metric
                                    3 = [geometry]
                                    6 = [geometry, color]
                                    9 = [geometry, color, normal]
                                   
  -c [ --clusters ] arg (=2)       Number of clusters e.g.
                                    2 will be 2x2x2=8, 3x3x3=27 clusters
  -m [ --attributes ] arg (=1)     Input mesh attributes
                                    1 = [geometry]
                                    2 = [geometry, color, normal]
  -a [ --aggressiveness ] arg (=3) Aggressiveness (directly relates to the 
                                   maximum permissive error) [1.0-10.0]

parallelqslim's People

Contributors

radialdistortion avatar zielon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

parallelqslim's Issues

Algorithms do not perform well for large model

Hi @Zielon thanks for you share this amazing code for mesh simplification. For my test it works well on small model, but for large model the result seem not very well. Can you help me see where is the problem?
cmd line: ./main --in ~/data/qslim/test.ply --out ~/data/qslim/simply.ply -f -a 7.5 -c 2 -t 4 -r 8
test_data

[WARN] Forced to overwrite existing mesh '/home/ubuntu/data/qslim/simply.ply'.
[INFO] INPUT MESH
    Faces: 1629384
    Vertices: 1979108
[START] Simplification has begun...
[INFO] ---> Iteration = 1        | step =         24.742% | original = 75.258% | error level = 0.0000327680 | time = 162.63s
[INFO] ---> Iteration = 2        | step =         18.321% | original = 61.470% | error level = 0.0000327680 | time = 113.76s
[INFO] ---> Iteration = 3        | step =          9.769% | original = 55.465% | error level = 0.0001746928 | time = 91.54s
[INFO] ---> Iteration = 4        | step =          3.523% | original = 53.511% | error level = 0.0006857004 | time = 82.57s
[INFO] ---> Iteration = 5        | step =          1.567% | original = 52.672% | error level = 0.0021788900 | time = 79.64s
[INFO] ---> Iteration = 6        | step =          1.132% | original = 52.076% | error level = 0.0059316416 | time = 77.94s
[INFO] ---> Iteration = 7        | step =          1.254% | original = 51.423% | error level = 0.0143489070 | time = 76.57s
[INFO] ---> Iteration = 8        | step =          1.571% | original = 50.616% | error level = 0.0316227766 | time = 76.50s
[INFO] ---> Iteration = 9        | step =          1.992% | original = 49.607% | error level = 0.0646316344 | time = 74.25s
[INFO] ---> Iteration = 10       | step =          2.351% | original = 48.441% | error level = 0.1241250240 | time = 70.37s
[INFO] ---> Iteration = 11       | step =          2.706% | original = 47.130% | error level = 0.2262429955 | time = 67.37s
[INFO] ---> Iteration = 12       | step =          2.935% | original = 45.747% | error level = 0.3944212159 | time = 62.12s
[INFO] ---> Iteration = 13       | step =          3.145% | original = 44.308% | error level = 0.6617355139 | time = 57.60s
[INFO] ---> Iteration = 14       | step =          3.322% | original = 42.837% | error level = 1.0737418240 | time = 53.19s
[INFO] ---> Iteration = 15       | step =          3.469% | original = 41.351% | error level = 1.6918696911 | time = 49.12s
[INFO] ---> Iteration = 16       | step =          3.527% | original = 39.892% | error level = 2.5974296172 | time = 44.51s
[INFO] ---> Iteration = 17       | step =          3.504% | original = 38.494% | error level = 3.8962965788 | time = 40.46s
[INFO] ---> Iteration = 18       | step =          3.421% | original = 37.178% | error level = 5.7243340224 | time = 36.61s
[INFO] ---> Iteration = 19       | step =          3.197% | original = 35.989% | error level = 8.2536245725 | time = 32.49s
[INFO] ---> Iteration = 20       | step =          2.895% | original = 34.947% | error level = 11.6995755485 | time = 28.99s
[END] Simplification of vertices = 65.05%
[INFO] OUTPUT MESH
    Faces: 251707
    Vertices: 691645
[INFO] Mesh has been saved in [/home/ubuntu/data/qslim/simply.ply]

input_mesh
1
output_mesh
2

Segmentation Fault when parsing a .ply with property list uchar uint vertex_indices

Hi, great repo! I was trying to simplify a .ply mesh which is causing a seg fault when executing the script. It seems to crash when it's executing this loop

image

I checked an example ply that I found online (https://www.artec3d.com/3d-models/bearded-guy-hd) vs my .ply and and I noticed that my .ply header is slightly different, in particular the header that doesn't work is like this (notice the uint in line 18)

image

vs the header that works

image

Any ideas as to where the problem might be coming from? thanks!

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.