|
|
trimesh2 is a C++ library and set of utilities for input, output,
and basic manipulation of 3D triangle meshes. The goals of the code are
ease of use and efficiency, possibly at the expense of some generality.
|
|
Features
The library includes the following:
- Support for reading PLY, OFF, 3DS, and Wavefront OBJ files, together with
a few other formats of mostly local interest (SM, RAY).
- Support for writing PLY, OFF, and OBJ files.
- Vec: a templated C++ class for constant-length vectors, with
support for the usual arithmetic operations (add, subtract,
componentwise multiply and divide, dot product, cross product, etc.)
- XForm: a class for rigid-body transformations.
- An OpenGL trackball/arcball implementation, with automatic selection of
rotation center.
- Algorithms for subdivision, smoothing, curvature estimation, triangle
stripping, and various other simple mesh manipulations.
Bundled together with the library are:
In addition, the following utility programs are included:
- mesh_view: a simple 3D mesh viewer
- mesh_make: create arbitrarily-tessellated meshes of various simple shapes
- mesh_filter: applies a variety of simple transformations to a mesh,
such as converting formats, flipping faces, subdivision, smoothing,
rigid-body transformations, etc.
- mesh_cc: list and/or extract connected components from a mesh
- mesh_cat: combine several meshes into a single file
- mesh_align: align 2 meshes using ICP
- mesh_shade: a few procedural shaders for adding per-vertex color
- mesh_check: check for some kinds of topological oddities (e.g.,
more than 2 faces at an edge) in a mesh file. Removes parts of the
mesh to "clean it up" and leave it a manifold.
- mesh_crunch: quick-n-dirty mesh decimation using the
Rossignac-Borrel method of vertex collapse
- mesh_info: print out some information about a mesh
- xf: create or compose transformations in .xf files
The library is distributed under the
GNU
General Public License (GPL), version 2. The various libraries
distributed with trimesh2 are open source, and are believed to be covered
by GPL-compatible licenses. Please see the COPYING file.
The code is written in C++, and is known to compile using a recent (4.x)
version of g++ on several Unix-like OSes (Linux x86 and x86-64, Solaris,
Mac OSX). Compiling under Windows is possible using Cygwin or MinGW32.
Anecdotally, the code compiles with MS Visual Studio .NET or later
(not MSVC 6), but I am not able to support this – you're on
your own. (However, I will gladly accept patches that fix compilation, and
will consider patches that squash warnings.)
Warning: some gcc versions are known to miscompile
trimesh2.
Please avoid version 4.1.2, or anything earlier than 4.0.1.
The author of trimesh2 is Szymon Rusinkiewicz.
Download
Both of these packages include source, as well as Linux (32- and 64-bit),
Windows, and Darwin binaries.
Changes
The most recent version is 2.9
Changes since version 2.8:
- New utilities: mesh_check, mesh_crunch,
mesh_info, and xf
- Many small bugfixes, as well as fixes for compilation errors and warnings
- Bugfixes for OpenMP directives
- Componentwise functions (trigonometric, etc.) for Vec
- Colorspace conversion for Color
- The dist shader of mesh_shade now takes an absolute
distance scale, instead of auto-scaling. (This is useful much more frequently
than the previous behavior.)
- mesh_view now uses glArrayElement instead of
glDrawElements on Intel cards. This provides a considerable
speedup on the machines available to me.
- Provides the ability to install hooks (e.g. for GUI applications)
for status/warning/error messages printed by trimesh2
- Includes Darwin binaries
Changes since version 2.7:
- Many compilation, portability, and bug fixes
- Colors are now stored as floats - this will require updating
external code that uses trimesh2
- Support for maintaining range grids as grids, instead of automatically
converting to meshes upon read
- Rudimentary (possibly broken, incomplete) support for reading VVD files
- mesh_filter: Added bilateral mesh filtering using the method of
[Jones et al. 2003]
- mesh_make: Added Klein bottle, rhombic triacontahedron
- OpenMP directives in a few places for multi-threading
- Many functions moved from utilities into library
Changes since version 2.6:
- Miscellaneous compilation, portability, and bug fixes
- mesh_filter: Added -pcasnap; added -fly
(butterfly subdivision); more robust -orient
- mesh_make: Added trefoil knot
- Linux x86_64 libraries and binaries now go in lib.Linux64/ and bin.Linux64/
Changes since version 2.5:
- mesh_filter: Added -sharpen and -usmooth flags;
bugfixes for Mac compilation, transforming meshes with normals
- mesh_make: Fix for making cubes with tess = 1
- mesh_align: ICP with isotropic or anisotropic (affine) scale
- mesh_cat: Bugfix in handling normals, colors, etc.
- mesh_shade: Added a few shaders, including coloring based on
mesh-to-mesh distance
Changes since version 2.4:
- Fixed bug in curvature computation
- Small bugfix in mesh_view
- Compile fixes
- Added mesh_shade with a few procedural shaders
Changes since version 2.3:
- Added mesh_align
- XForm.h and some of the utility programs should now support
affine transforms (as opposed to just rigid-body)
- Added yet more options to mesh_filter
Changes since version 2.2:
Changes since version 2.1:
- Added a couple of options to mesh_filter
- Bugfix for depth readback on ATI cards with broken drivers
Changes since version 2.0:
- Added mesh_cat utility
- Added several options to mesh_filter
- Many bugfixes, including compilation errors, I/O, and mesh_view
Please contact smr at princeton edu if you have any questions about
the code.