Giter Site home page Giter Site logo

blender-marching-cubes's Introduction

Marching Cubes for blender

This is an optimized version of Tom Sapiens' marching cubes implementation for blender. It is useful for fabricating a blender mesh approximating an isosurface of a scalar field function.

I found the original at http://blenderartists.org/forum/showthread.php?265240-Generation-of-Isosurfaces-skript-%28Marching-Cubes%29 and made

  • some fixes to compensate for API drift
  • minor stylistic changes
  • and some significant performance improvements.

It is not (strictly speaking) an addon for blender. It is instead a python script which can be executed from blender's text editor to build a mesh for an isosurface of the field function defined inside the python script.

https://www.blender.org/manual/extensions/python/text_editor.html has a section explaining how to execute scripts from blender's text editor.

The script comes with a sample scalarfield function (embedded inside the main() function near the top of the file) you can test with, but you will want to replace this with your own scalarfield function. The most common problem I anticipate is picking p0, p1, or isolevel in such a way that nothing interesting happens in the analysis box (Imagine if you tried to compute the isosurface for a sphere of radius 4 but only used a box of radius 1).

Resolutions of 100x100x100 can be computed in a matter of seconds on modern hardware (depending on how complicated your field function is). Going up to 200x200x200 can easily push your compute times up to a minute on low-end hardware. Going higher than that is recommended only for the patient.

Performance may be improved over the original, but is still inferior to the cython port: https://github.com/Pyroevil/CubeSurfer/blob/master/README.md

Authors: Robert Forsman (API fixes and optimization) Tom Sapiens (blender python port) Paul Bourke (author of source article with C++ code examples)

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.