A C++ library and set of utilities for input, output, and basic manipulation of 3D triangle meshes.
This is a fork of the TriMesh2 library (originally by Szymon Rusinkiewicz), which I use a lot in my other graphics projects. I like TriMesh2 because of the low setup costs required to do model loading, as well as the robust and powerful implementation of various model manipulation techniques.
The original TriMesh2 project is quite Linux/GCC-oriented, and only has limited Win32 support (through MinGW compilation targets). The primary aim of this fork is to add a stable Visual Studio solution, for both x86 and x64 targets, whilst staying as close as possible to the original codebase (and subsequent updates).
trimesh.lib
, the debug version is trimeshd.lib
.include/TriMesh.h
, and make sure the static library is in your build path. All Trimesh2 functions will be in the TriMesh
namespace.TriMesh* themesh = TriMesh::read(filename);
.vertices
which will be filled with all the vertices of your model, and a data member faces
, which will tell you which vertices make up a face.normals
. You can (re)compute them by calling need_normals
on the mesh. There's also need_bbox
for a bounding box, need_dcurv
for curvature, etc.include/TriMesh.h
and the utilities in the utilsrc
folder.
mesh_view
utility has dependencies on OpenGL and Freeglut, because it needs to display a window with a textured modelmscv
folder, verified working with the free Community Editions of Visual Studio. The solutions contain both Debug and Release profiles for 32-bit and 64-bit builds.
lib.(architecture).(visual studio version)
in the trimesh2 root folder. For example, for a 64-bit Visual Studio 2017 build, it will be lib.win64.vs141
. The utilities will be placed in util.(architecture).(visual studio version)
. This naming scheme is in place to avoid clashing trimesh2 versions.mesa-common-dev libglu1-mesa-dev libxi-dev
.For the original TriMesh2 project, see the Trimesh2 homepage.
Features:
The following utility programs are included:
This fork stays as close as possible to the original trimesh2 code, only changing the actual source files when a solution for compilation errors cannot be reached through VS pre-build steps or preprocessor magic.
Notable changes compared to vanilla trimesh2
Other software for importing and manipulating 3D models: