Skip to content

The VCGlib is a C++, templated, no dependency, library for manipulation, processing and cleaning of triangle meshes

License

Notifications You must be signed in to change notification settings

AppliedMathematicsANU/vcglib

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fork

This fork of the Visualization and Computer Graphics Library provides a python API to the tridecimator quadric decimation method.

Install

Requires:

git clone https://github.com/AppliedMathematicsANU/vcglib
SRC_DIR="`pwd`/vcglib"
mkdir vcglib_build
cd vcglib_build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local $SRC_DIR
make install

Example Python

import numpy as np
from vcg.apps import tridecimator as td

verts = np.asarray(...)  # (N, 3) shaped array of vertex coordinates
faces = np.asarray(...)  # (M, 3) shaped array of triangular faces (indices in verts).

mesh = td.Mesh(vertices=verts, faces=faces)
td.clean(mesh)  # In-place removal of duplicate vertices and unreferenced vertices
qparams = td.default_q_params()
qparams.PreserveTopology = True
td.decimate(mesh, final_num_faces=faces.shape[0] // 8, qparams=qparams)  # Decimate to quarter number of faces

verts = mesh.vertices  # Decimated vertices
faces = mesh.faces     # Decimated faces

Original README

The Visualization and Computer Graphics Library (VCGlib for short) is a open source, portable, C++, templated, no dependency, library for manipulation, processing, cleaning, simplifying triangle meshes.

The library, composed by more than 100k lines of code, is released under the GPL license, and it is the base of most of the software tools of the Visual Computing Lab of the Italian National Research Council Institute ISTI , like MeshLab, metro and many others.

The VCG library is tailored to mostly manage triangular meshes: The library is fairly large and offers many state of the art functionalities for processing meshes, like:

  • high quality quadric-error edge-collapse based simplfication,
  • efficient spatial query structures (uniform grids, hashed grids, kdtree, ...) ,
  • advanced smoothing and fairing algorithms,
  • computation of curvature,
  • optimization of texture coordinates,
  • Hausdorff distance computation,
  • geodesic paths,
  • mesh repairing capabilities,
  • isosurface extraction and advancing front meshing algorithms,
  • Poisson Disk sampling and other tools to sample point distributions over meshes,
  • subdivision surfaces

Notable Applications

A number of applications have been developed using the vcglib:

  • MeshLab: the renowed open source mesh processing is based on this library.
  • Metro, the tool for measuring differences between meshes
  • The first high quality out-of-core mesh simplifier that was used by the Stanford Digital Michelangelo project to process their huge 3D scanned models.

Contacts

For any info about licensing (portion of) the library please contact us: Paolo Cignoni ([email protected]) Visual Computing Lab of the Italian National Research Council - ISTI

In case of bugs please report them here .

About

The VCGlib is a C++, templated, no dependency, library for manipulation, processing and cleaning of triangle meshes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 98.9%
  • C 0.6%
  • CMake 0.2%
  • QMake 0.2%
  • GLSL 0.1%
  • Python 0.0%