Questions tagged [marching-cubes]

An algorithm for creating a triangular mesh from a three-dimensional scalar field, or graphing an implicit function of the form f(x,y,z) = c.

Marching cubes is a computer graphics algorithm for creating a triangular mesh from a three-dimensional scalar field, or equivalently, graphing an implicit function of the form f(x,y,z) = c.

For more information, see:

144 questions
1
vote
1 answer

Interpolation in marching square when lines are vertical and horizontal

Marching Square In the "Linear Interpolation" section This article discusses how to interpolate the values when the lines are oblique. For instance, for Case#2 it has the following calculation: I am confused about the cases when lines are either…
user366312
  • 16,949
  • 65
  • 235
  • 452
1
vote
2 answers

Find volume of object given a triangular mesh

I have an object defined by vertices and triangular faces. verts = [[0.1, 1., 1. ] [1., 1., 0.1] [1., 0.1, 1. ] [1., 1., 1.9] [1., 1.9, 1. ] [1.9, 1., 1. ] ] And triangular faces, which define the vertices composing each faces: faces…
McM
  • 471
  • 5
  • 21
1
vote
1 answer

Marching squares and encapsulated contours

Here's an image: Can one, using the marching squares algorithm, write a program that given an input image like above, produces the following output: Two chained line segments, one forming the above contours (hill-like), the other one forming the…
1
vote
1 answer

Clarifying Scikit Image Marching Cubes algorithm "spacing" parameter?

I have a 64x64x64 occupancy grid (0 is the level) on which I'm trying to run marching cubes to generate a mesh. In trying to debug some issues with the generated mesh, I wanted to clarify what the "spacing" parameter means. The documentation here…
Yuerno
  • 751
  • 1
  • 8
  • 27
1
vote
0 answers

From Height Maps to Marching Cubes

i have been working on a project for a while now and have been following Sebastian Lague's tutorial on procedural mesh generation, but need to use marching cubes. My end goal is to have a destructible procedural terrain generation with noise. I…
1
vote
0 answers

Implementing multi-texture shading with the marching cube algorithm (voxels)

I am currently developing an asteroid mining/exploration game with fully deformable, smooth voxel terrain using marching cubes in Unity 3D. I want to implement an "element ID" system that is kind of similar to Minecraft's, as in each type of…
1
vote
1 answer

Adding noise to marching cubes isn't influencing terrain

I'm using marching cubes and 3D noise to generate modifiable/interesting terrain. Why isn't my noise being applied to my marching cubes? Please keep in mind I followed GPU Gems implementation for noise. I've tried using 2D noise to get atleast some…
1
vote
1 answer

"Failed setting triangles. Some indices are referencing out of bounds vertices." when the the edge index is greater than the number of vertices

I'm trying to get the the marching cubes algorithm to work in unity, but when I try to add triangles to my vertices based on a triangulation table I get the error stated in the title If I try drawing the triangle using numbers less than the length…
Christopher Coyle
  • 103
  • 1
  • 2
  • 9
1
vote
1 answer

Interpolating issue during Marching Cube on a scalar field

I have a regular square grid wherein all my data points are stored at the centroid. I have a scalar field(range : 0->1) that indicates the amount of substance inside a cell. I am interested in identifying the interface of this substance inside the…
Some_Guy
  • 169
  • 11
1
vote
1 answer

threejs metaballs with dot shader

I am trying to test a simple dot shader in ThreeJS made by 2pha : https://2pha.com/demos/threejs/shaders/simple_dots.html It seems to not work properly for metaballs using Marching Cubes : https://threejs.org/examples/webgl_marchingcubes.html. Is…
compmonks
  • 647
  • 10
  • 24
1
vote
0 answers

Finding a surface of thin voxelated structures with interpolation artifacts

I have a thin structure represented as a voxelated image. I was using marching cubes from scikit-image but I noticed that it does not handle thin structures well. Example of the same structure shifted by half a voxel: import numpy as np from…
NOhs
  • 2,780
  • 3
  • 25
  • 59
1
vote
2 answers

Sparse Voxel Octree Smooth Meshing

I've been looking over several searches on our God Google, and haven't found any article that explains, in a intuitive way, the following question: "How can i smoothly mesh a Octree of voxels?" I know how a octree works theoretically (never…
Emanuel Kozerski
  • 379
  • 1
  • 2
  • 11
1
vote
1 answer

Indices from Meshgrid matlab

I am stuck here since so long. Please help me. For the following code: Original "I" dimensions are 217x181x181 [nX,nY,nZ] = size(I); [X,Y,Z] = meshgrid(1:nX,1:nY,1:nZ); after Meshgrid X, Y, Z are of dimensions 181x217x181 Now from "I" how to find…
M.B.
  • 110
  • 11
1
vote
2 answers

Marching cube, bitwise and and OR

In order to understand marching cube algorithm, I followed this page: http://paulbourke.net/geometry/polygonise/ I have some questions: what do bitwise & and | mean?, and how they will work with edge table to find the correct tringles? if…
1
vote
1 answer

Visualizing an isosurface generated with marching cubes

I'm currently using OpenGL (more specifically through the VisPy bindings) to do some scientific data visualization. I have a volumetric dataset, and I would like to visualize some isosurfaces present inside of it. I generate the isosurfaces using…
The Wind-Up Bird
  • 661
  • 2
  • 8
  • 17