Giter Site home page Giter Site logo

patrickabadi / marchingcubes Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 2.0 18.04 MB

Dynamic optimized mesh-generating Marching Cubes algorithm

License: MIT License

CMake 3.02% C++ 96.98%
marching-cubes mesh-generation triangulation triangle-mesh point-cloud 3d-reconstruction

marchingcubes's Introduction

MarchingCubes

Dynamic optimized mesh-generating Marching Cubes algorithm. The goal of this project is to be able to give MarchingCubes successive point clouds along with a transformation (in world space) and it will continually update the mesh in the quickest amount of time.

Requirements

Building the Project

  • Use cmake to generate the project
  • Steps I took to build on my Windows machine:
> mkdir vcpkg
> cd vcpkg
> git clone https://github.com/microsoft/vcpkg
> .\vcpkg\bootstrap-vcpkg.bat

> .\vcpkg install pcl:x64-windows

/* This command is used so other projects can more easily find and link to VCPKG libraries */
> .\vcpkg integrate install
> cd..

/* Now create your MarchingCubes folder */
> mkdir MarchingCubes
> cd MarchingCubes
> git clone https://github.com/patrickabadi/MarchingCubes
> mkdir build
> cd build
> cmake .. "-DCMAKE_TOOLCHAIN_FILE=D:\src\vcpkg\scripts\buildsystems\vcpkg.cmake"

Running the Project

Note: Debug timing will always be slower because of the debug iterator slowdowns

Note: The debug build will build but fail to run unless you copy libpng16.dll and zlib1.dll from ./MarchingCubes/build/bin/Release to ./MarchingCubes/build/bin/Debug

  • Run the app and on the visualization window rotate the scene until you see the model in front of you. Zoom in/out with the mouse wheel
  • Press spacebar to move to the next frame
  • Press 's' to end early

Algorithm explained

  • Incoming points are placed into a virtualized voxel grid. This saves on space and allows it to be updated on subsequent incoming points, without having to recreate the voxel grid.
  • Points added to each voxel grid now become vertices in a cube grid. Every added point in the voxel grid can affect up to 8 cubes in the cube grids so they need to be checked
  • Followed this example for efficient generation of triangle faces http://paulbourke.net/geometry/polygonise/

Contributers

marchingcubes's People

Contributors

patrickabadi avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

mbeytekin ashishd

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.