Coder Social home page Coder Social logo

peterzs / trimesh2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from forceflow/trimesh2

0.0 0.0 0.0 759 KB

C++ library and set of utilities for input, output, and basic manipulation of 3D triangle meshes

License: GNU General Public License v2.0

Makefile 0.17% C 49.79% Objective-C 3.77% C++ 43.36% Assembly 2.91%

trimesh2's Introduction

TriMesh2 (v2.14)

Build Status License: GPL v3

A C++ library and set of utilities for input, output, and basic manipulation of 3D triangle meshes.

trimesh2 logo

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).

Getting started

  • Download a prebuilt release of trimesh2 or build the library yourself. The static library will be called trimesh.lib, the debug version is trimeshd.lib.
  • For Windows, build solutions for VS2017 and VS2019 are provided in the mscvfolder. All solutions are verified working in the free Community Editions of VS.
    • The built libraries will be placed in a folder named 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 built utilities will be placed in a folder named util.(architecture).(visual studio version) in the trimesh2 root folder. For example, for a 32-bit Visual Studio 2019, they will be in util.win32.vs142.
  • For Linux, a makefile is provided. You might need additional packages before you can build on your system. On Ubuntu these are: mesa-common-dev libglu1-mesa-dev libxi-dev.
  • I'm being told it builds on OSX using the provided makefile too, but I have no way to check. If you encounter problems, please, file an issue report :)
  • In your own project, make sure you include the header include/TriMesh.h, and make sure the static library is in your build path. All Trimesh2 functions will be in the TriMesh namespace.
  • For inspiration on how to use the library and its various features, check out the utilities in the utilsrc folder, or just start by loading a model : TriMesh* themesh = TriMesh::read(filename);.

Info

For the original TriMesh2 project, see the Trimesh2 homepage.

Features:

  • Support for reading/writing PLY, OFF, OBJ files. Read-only: 3DS, SM, RAY.
  • Vec: a templated C++ class for constant-length vectors, with support for the usual arithmetic operations and 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.

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.
  • 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

Fork Details

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.

Notable changes compared to vanilla trimesh2

  • Fixes for MSVC 14.0/15.0 compilation
  • MSVC project for Visual Studio Community Edition 2017 and 2019
  • Fixes for FreeGlut / Gluit compilation in VS 2017 and 2019
  • Fixes for wingetopt replacement in MSVC
  • Added 64-bit MSVC compilation support

For todo/planned features, see todo.txt.

See Also

Other software for importing and manipulating 3D models:

trimesh2's People

Contributors

forceflow avatar

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.