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
5
votes
0 answers

dual marching cubes table

I've just finished building these tables for dual marching cubes (by Nielson). VerticesNumberTable contains the length of the array of vertices to create for each Voxel (1 to 4 internal vertices), while EdgesTable is used to assign every one of…
Fario Bostanzo
  • 121
  • 1
  • 4
5
votes
2 answers

How to interpolate vertex normals?

I am trying to render a 3D model (from volvis.org) with Gouraud shading using the marching cubes algorithm. So far I have the normals for each vertex with: GetNormalForVertex(vertex &b, vertex &a, vertex &c) { u.X = a.X - b.X; u.Y = a.Y -…
Floyd Barber
  • 107
  • 1
  • 3
  • 10
4
votes
0 answers

Scaling vertex coordinates of marching cubes algorithm output in skimage

I am trying to use skimage.measure.marching_cubes_lewiner to resolve some isosurface f(x,y,z)=0. In my case f is strongly nonlinear, and is best mapped when coordinates are given with logarithmic spacing. Because the marching cubes wants a regular…
4
votes
4 answers

Remeshing 3D triangulated surface for better mesh quaility

I am using marching cubes to extract a 2D surface from a volume. In this case a Gyroid. import numpy as np from numpy import sin, cos, pi from skimage import measure import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D def…
DrBwts
  • 3,470
  • 6
  • 38
  • 62
4
votes
2 answers

Scikit Image Marching Cubes

I'm using the Scikit Image implementation of the marching cubes algorithm to generate an isosurface. verts, faces,normals,values = measure.marching_cubes(stack,0) generates the following error: ValueError: need more than 2 values to unpack but…
KRS-fun
  • 696
  • 3
  • 9
  • 20
4
votes
1 answer

Clarification on Marching Cubes Algorithm

In regards of Marching Cubes, i have some doubts regarding its algorithm and implementation. I have gone through the excellent Paul Bourke article of Marching Cubes and also the available source code on the site, yet, i still encountered some…
vincent911001
  • 523
  • 1
  • 6
  • 20
4
votes
1 answer

Sharp Isosurface Extraction from Voxels

I need to generate an isosurface from chunks of voxels in an octree or array that supports both rounded and sharp geometry. I have searched for algorithms that seem to be capable of completing this task and found several, including Dual Contouring,…
user3736210
  • 63
  • 2
  • 7
3
votes
0 answers

Marching Cubes - Holes in Mesh

I am working on the university project of computation graphics, I have implemented the marching cubes algorithm following the guidelines of http://paulbourke.net/geometry/polygonise/. When I test the algorithm without linear interpolation i get an…
3
votes
2 answers

Contour of 2d point clouds

I have scattered point clouds in 2d. My problem is I would like to get the boundary's point to get the contour of the point clouds. I know about this 'marching square' however this algorithm usually used for pixel in 2d. Any one have idea how to…
stephie
  • 39
  • 1
  • 2
3
votes
1 answer

Given a set of triangle vertices and faces, separate objects and form separate meshes

Edit: I have written a more succinct version of this question here but I am keeping this post because it is a full explanation. Given a 3D numpy array, marching cubes can form a 3D object around some threshold. import numpy as np from skimage…
McM
  • 471
  • 5
  • 21
3
votes
3 answers

Marching cubes?

I have an object made of points, lets say its point cloud, i want to render object from those points, i want object to look like those points were wrapped in a sheet of paper. I want to animate it, so first thing that came on my mind was marching…
ZZZ
  • 678
  • 2
  • 10
  • 26
3
votes
1 answer

How to convert 2D DICOM slices to 3D image in Python

I am currently sitting on an task in which I need to plot DICOM slices into one 3D model using NumPy, Matplotlib, (Marchingcubes, Triangulation or Volumemodel) I have tried the method from this website :…
3
votes
1 answer

How to set the origin for the mesh with mplot3d?

Following the example in scikit-image doc I generate a spherical surface mesh with marching cubes algorithm. I want to center the unit sphere shell at the origin defined by the x,y,z grid. However, I cannot do that, since I don't know how to put…
Armut
  • 969
  • 8
  • 22
3
votes
3 answers

How is the marching cubes triangle table generated?

How is the marching cubes triangle table generated? I know, that i can just use a precalculated one, but i am interested in how the tables can be generated. Seems like the original authors generated it by triangulating everything on paper, but is…
allo
  • 3,955
  • 8
  • 40
  • 71
3
votes
4 answers

OpenGL, applying texture from image to isosurface

I have a program in which I need to apply a 2-dimensional texture (simple image) to a surface generated using the marching-cubes algorithm. I have access to the geometry and can add texture coordinates with relative ease, but the best way to…
ssube
  • 47,010
  • 7
  • 103
  • 140
1
2
3
9 10