Coder Social home page Coder Social logo

gp-cli's Introduction

Command Line Tools for Geometry Processing

This repository contains a number of mini command line "apps" written using libigl.

Each xyz.cpp corresponds to a command line program xyz.

convertmesh

Convert between any libigl-readable mesh file format and any libigl-writable mesh file format. E.g.,

convertmesh input.ply output.obj

or

convertmesh /path/of/directories/until/folder/containing/mymesh.{off,obj}

decimate

Decimate a model using quadric error metrics simplification. E.g.,

decimate 0.1 input.ply output.obj

mergestl

Merge triangle soup contained in a .stl file into a triangle mesh (that can be stored in .obj etc.). E.g.,

mergestl model.{stl,obj}

meshboolean

Compute the set union, intersection, difference etc. of two meshes. E.g.,

meshboolean A.obj B.obj union C.obj

meshstatistics

Compute statistics about a given mesh. E.g.,

meshstatistics input.obj

might output something like:

number of edges                                             108300
number of faces                                              72194
number of vertices                                           36178
number of dimensions                                             3
bounding box diagonal                                      2.58919
minimum angle                                             0.010265
maximum angle                                              3.10412
minimum area                                            2.3833e-07
maximum area                                            0.00557518
volume                                                   -0.126813
centroid_x                                             -0.00521342
centroid_y                                            -0.000764107
centroid_z                                              -0.0351105
number of small triangles                                       41
number of small angles                                           0
number of close vertices                                         0
number of connected components                                  25
number of unreferenced vertices                                  0
number of handles                                              -13
Euler characteristic                                            72
number of boundary loops                                         4
number of boundary edges                                       112
number of nonmanifold edges                                     47
number of conflictedly oriented edges                          149
number of duplicate vertices                                     0
number of combinatorially duplicate faces                       25
number of geometrically degenerate faces                         0
number of combinatorially degenerate faces                       0
number of intra-component self-intersecting pairs              513
number of self-intersecting pairs                             2849

resolvemesh

Resolve self-intersections in any libigl-readable mesh.

scrubmesh

Scrub through a sequence/animation of meshes

scrubmesh first.obj second.obj ...

Hint: Hit P to render all meshes from the current view to a ./scrubmesh-%06d.png and then merge them into an animated .gif using:

convert -dispose 2 ./scrubmesh-*.png scrubmesh.gif

or into an .mp4 using

ffmpeg -f image2 -i ./scrubmesh-%06d.png -vcodec libx264 -pix_fmt yuv420p -q:vscale 0 scrubmesh.mp4

Hint: On shell systems, to interleave two animations from different directories A/ and B/ you could use:

scrubmesh `(find A/*.obj | cat -n ; find B/*.obj | cat -n  )  | sort -n  | cut -f2- `

viewmesh

Visualize any libigl-readable mesh using the default libigl viewer. E.g.,

viewmesh input.obj

Precompiled binaries

Located in precompiled/[system]/bin/.

Build from source

Follow the usual cmake build process:

mkdir build
cd build
cmake ../
make
make install

To build the precompiled binaries

Just point cmake to install them there, e.g.,:

cmake ../ -DCMAKE_INSTALL_PREFIX=../precompiled/osx
make 
make install

License

Free for academic, non-commercial use. Contact Alec Jacobson [email protected] about pricing for commercial usage.

gp-cli's People

Contributors

alecjacobson 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

Watchers

 avatar  avatar

gp-cli's Issues

Compiling returns error with igl viewer

Running, as advised

mkdir build
cd build
cmake ..
make

returns

Scanning dependencies of target viewmesh
[ 17%] Building CXX object CMakeFiles/viewmesh.dir/viewmesh.cpp.o
In file included from /Users/silviasellan/Dropbox/lib/gp-cli/viewmesh.cpp:1:
/Users/silviasellan/Dropbox/lib/gp-cli/draw_frame_to_png.h:21:17: error: type 'igl::opengl::ViewerCore' does not
      provide a call operator
  const int w = v.core().viewport(2);
                ^~~~~~
/Users/silviasellan/Dropbox/lib/gp-cli/draw_frame_to_png.h:22:17: error: type 'igl::opengl::ViewerCore' does not
      provide a call operator
  const int h = v.core().viewport(3);
                ^~~~~~
/Users/silviasellan/Dropbox/lib/gp-cli/draw_frame_to_png.h:25:3: error: type 'igl::opengl::ViewerCore' does not
      provide a call operator
  v.core().draw_buffer(v.data(),false,R,G,B,A);
  ^~~~~~
3 errors generated.
make[2]: *** [CMakeFiles/viewmesh.dir/viewmesh.cpp.o] Error 1
make[1]: *** [CMakeFiles/viewmesh.dir/all] Error 2
make: *** [all] Error 2

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.