GithubHelp home page GithubHelp logo

chaosink / subface Goto Github PK

View Code? Open in Web Editor NEW
5.0 4.0 0.0 14.28 MB

A collection of triangle mesh subdivision/tessellation/decimation implementations.

License: GNU General Public License v3.0

CMake 3.70% GLSL 1.93% C++ 94.37%
subdivision tessellation decimation triangle-mesh

subface's Introduction

subface

build build build

A collection of triangle mesh subdivision/tessellation/decimation implementations.

Compiling

git clone https://github.com/chaosink/subface.git --recursive
cd subface
mkdir build
cd build
cmake ..
cmake --build . --config Debug # Or Release

Usage

  • Command line
Usage: subface [-h] [--cmd] [--export_obj] [--save_png] [--smooth] [--fix_camera] [--cull] [--transparent] [--render VAR] [--method VAR] [--level VAR] OBJ_file_path

Process geometries with one of the following methods:
    1.LoopSubdivideSmooth
    2.LoopSubdivideSmoothNoLimit
    3.LoopSubdivideFlat
    4.Tessellate4
    5.Tessellate4_1
    6.Tessellate3
    7.Decimate_ShortestEdge_V0
    8.Decimate_ShortestEdge_Midpoint
    9.MeshoptDecimate
    10.MeshoptDecimateSloppy
    11.SimplygonDecimate


Positional arguments:
  OBJ_file_path         OBJ file path

Optional arguments:
  -h, --help            shows help message and exits
  -v, --version         prints version information and exits
  -c, --cmd             run in command line mode
  -e, --export_obj      export OBJ in command line mode
  -s, --save_png        save PNG in command line mode
  -n, --smooth          use smooth normal
  -f, --fix_camera      fix camera
  -u, --cull            enable face culling
  -t, --transparent     enable transparent window
  -r, --render          render mode ID [default: 0]
  -m, --method          processing method ID [default: 1]
  -l, --level           processing level [default: 0]
  • Rendering
key function
Tab switch rendering mode: FacesWireframe (default), FacesOnly, WireframeOnly
N enable / disable (default) smooth rendering
C enable / disable (default) face culling
T enable / disable (default) transparent window
F use camera's fixed parameters
R refresh camera's fixed parameters
P print camera's current parameters
F2 save the screenshot as a PNG file
ESC exit
  • Camera controlling
key function
(Shift +) W/S/A/D/Q/E (slowly) move forward / backward / left / right / down / up
(Shift +) J/L/I/K (slowly) turn left / right / up / down
-/= slow down / speed up movement
[/] slow down / speed up turning
Space reset camera and model
mouse left button rotate model
mouse right button change camera direction
mouse scroll wheel adjust field of view
  • Triangle mesh processing
key function
Ctrl + 1,...,6 choose from the subdivision and tessellation methods
1.LoopSubdivideSmooth
2.LoopSubdivideSmoothNoLimit
3.LoopSubdivideFlat
4.Tessellate4
5.Tessellate4_1
6.Tessellate3
Alt + 1,...,5 choose from the decimation methods
1.Decimate_ShortestEdge_V0
2.Decimate_ShortestEdge_Midpoint
3.MeshoptDecimate
4.MeshoptDecimateSloppy
5.SimplygonDecimate
0-9 processing level, 0 for the original mesh (default)
,/. decimate one less/more triangle for the decimation methods
O export the processed mesh as an OBJ file

Results

  • Rendering modes
FacesWireframe FacesOnly
WireframeOnly, Cull_false WireframeOnly, Cull_true
  • LoopSubdivideSmooth, Normal_flat vs Normal_smooth
original mesh, Normal_flat original mesh, Normal_smooth
level=1, Normal_flat level=1, Normal_smooth
level=2, Normal_flat level=2, Normal_smooth
level=3, Normal_flat level=3, Normal_smooth
level=4, Normal_flat level=4, Normal_smooth
  • Processing methods: subdivision and tessellation methods, level=2
LoopSubdivideSmooth LoopSubdivideSmoothNoLimit
LoopSubdivideFlat Tessellate4
Tessellate4_1 Tessellate3
  • Processing methods: decimation methods, level=5 (decimation ratio=50%)
original mesh SimplygonDecimate
Decimate_ShortestEdge_V0 Decimate_ShortestEdge_Midpoint
MeshoptDecimate MeshoptDecimateSloppy

subface's People

Contributors

chaosink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

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