Code Monkey home page Code Monkey logo

mesh-smoothing's Introduction

CatmullClark-Sqrt3-Subdivision

Update:

I converted this project to a command line application, you can build it with CMake:

mkdir build
cd build
cmake ../
cmake --build .

and then go to MeshSubdivider.exe, run MeshSubdivider.exe --help to see options.

Note:

This project runs on CPU, I am open to appending it with CUDA Kernels and would approve any PR who does that or partially help to it (I love writing CUDA Kernels but I do not have time to do it by myself)

Catmull Clark Algorithm

To use it, load mesh with correct method ( use mesh->loadOffTriMesh("mesh.off") for triangulated meshes and use mesh->loadOffQuadMesh("mesh.off") for quad meshes)

If you loaded a triangulated mesh, call the mesh->convertQuadbySplit() method to continue.

Then use mesh->CatmullClarkSubdiv() for Catmull Clark algorithm. Each call corresponds one iteration.

Note: convertQuadbySplit() uses Catmull-Clark split method.

Here are some example results:

Cube:

Cube w/triangles converted to quads by split

### Man

Sqrt3 Subdivision Algorithm

To use it, load mesh with correct method ( use mesh->loadOffTriMesh("mesh.off") because this algorithm only works for triangulated meshes and I dont provide any conversion from quads to triangles right now)

Then use mesh->Sqrt3SubDiv for Sqrt3 Subdivision algorithm. Each call corresponds one iteration.

Here are some example results:

Coffee Cup

Horse

mesh-smoothing's People

Contributors

bertaye avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

telee6789 bachns

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.