marching-cubes

Ambiguous cases in Marching square algorithm

ε祈祈猫儿з 提交于 2020-08-08 07:09:59
问题 If we take Wikipedia article on Marching square into account, we see that case#5 and case#10 are said to be ambiguous cases. I have implemented Marching Square as follows and I am not understanding how an ambiguous case can arise: public class LinesRectangle { public Graphics Graphics { get; set; } public Color Color { get; set; } public Pen Pen { get; set; } public int Thickness { get; set; } public LinesRectangle() { Color = Color.Blue; Thickness = 2; Pen = new Pen(Color, Thickness); }

Ambiguous cases in Marching square algorithm

梦想与她 提交于 2020-08-08 07:09:12
问题 If we take Wikipedia article on Marching square into account, we see that case#5 and case#10 are said to be ambiguous cases. I have implemented Marching Square as follows and I am not understanding how an ambiguous case can arise: public class LinesRectangle { public Graphics Graphics { get; set; } public Color Color { get; set; } public Pen Pen { get; set; } public int Thickness { get; set; } public LinesRectangle() { Color = Color.Blue; Thickness = 2; Pen = new Pen(Color, Thickness); }

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

点点圈 提交于 2020-06-23 08:52:25
问题 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 import measure A = np.zeros((12,12,12)) #A[A<1] = -1 for i in np.arange(1,2): for j in np.arange(1,2): for k in np.arange(1,2): A[i,j,k] = 10 for i in np.arange(8,9): for j in np.arange(8,9): for k in np.arange(8,9): A[i,j,k] = 10 verts, faces, normals,

Point Cloud triangulation using marching-cubes in Python 3

浪尽此生 提交于 2020-03-22 03:08:22
问题 I'm working on a 3D reconstruction system and want to generate a triangular mesh from the registered point cloud data using Python 3. My objects are not convex, so the marching cubes algorithm seems to be the solution. I prefer to use an existing implementation of such method, so I tried scikit-image and Open3d but both the APIs do not accept raw point clouds as input (note that I'm not expert of those libraries). My attempts to convert my data failed and I'm running out of ideas since the

Error in Geometry Shader from large array

点点圈 提交于 2020-01-05 03:37:10
问题 When I try to link my Geometry Shader it throws the following error: 0(76) : error C5041: cannot locate suitable resource to bind variable "triTable". Possibly large array. In reference to this array declared in the shader: const int triTable[256][16] = { { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, ... ... ... { -1, -1, -1, -1, -1, -1, -1,

CSG operations on implicit surfaces with marching cubes

不想你离开。 提交于 2020-01-03 08:42:28
问题 I render isosurfaces with marching cubes, (or perhaps marching squares as this is 2D) and I want to do set operations like set difference, intersection and union. I thought this was easy to implement, by simply choosing between two vertex scalars from two different implicit surfaces, but it is not. For my initial testing, I tried with two spheres circles, and the set operation difference . i.e A - B. One circle is moving and the other one is stationary. Here's the approach I tried when

Clarification on Marching Cubes Algorithm

ぃ、小莉子 提交于 2019-12-14 01:06:40
问题 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 problems in term of understanding as well as how to implement the algo in my own way. The questions are as below: Gridcell size - I have read that gridcell size affects the quality of the produced 3D model. For example if i have a stack of xray image set

gradient multicolor metaballs with threejs and marchingcubes

一个人想着一个人 提交于 2019-12-13 04:04:44
问题 I am looking on how to implement something similar than this work: https://vimeo.com/9121195 . But with explicitly attributing colors to each metaball from an array of given colors. As far as I can see, this is done entirely from the shader side in this example but I was wondering if this could not be implemented with Threejs and marchingcubes. By creating a new THREE.ShaderMaterial I assume I can pass positions of each metaball to the shader and then evaluate the distance of each vertex with

how does getdepth function work in MarchingCube algorithm?

南楼画角 提交于 2019-12-12 05:48:09
问题 I am trying to understand Marching Cube Algorithm, so for I think I have understood how triangles are formed and how normals are calculated in each grid. I can see there is a linked list kind of structure that links each grid to another. But when I come across GetDepth(t[m]) which passes each triangles (those triangles of each grid) (t[0],..,..)individually, it returns depth of the node. The function, float GetDepth(TRIANGLE t) { float z; z = t.p[0].z; z = t.p[1].z > z? t.p[1].z: z; z = t.p[2

What can cause glDrawArrays to generate a GL_INVALID_OPERATION error?

纵然是瞬间 提交于 2019-11-28 18:08:32
I've been attempting to write a two-pass GPU implementation of the Marching Cubes algorithm, similar to the one detailed in the first chapter of GPU Gems 3, using OpenGL and GLSL. However, the call to glDrawArrays in my first pass consistently fails with a GL_INVALID_OPERATION . I've looked up all the documentation I can find, and found these conditions under which glDrawArrays can throw that error: GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or to the GL_DRAW_INDIRECT_BUFFER binding and the buffer object's data store is currently mapped. GL