Tag Info

Hot answers tagged

14

Note that ListContourPlot3D takes the coordinates to be the position indices by default. If you want to keep the coordinates used in generating the data, then you have to include it. data = Flatten[ Table[{x, y, z, x^2 + y^2 + z^2 + RandomReal[0.1]}, {x, -2, 2, 0.2}, {y, -2, 2, 0.2}, {z, -2, 2, 0.2}], 2]; plot = ListContourPlot3D[data, Contours ...


12

Here is a more general approach. It is based on the 2D method from here. It assumes the polyhedron is not self-intersecting but imposes no requirement of convexity or even connectedness, other than that it be closed and bounded. Strictly speaking, I think this will work for an unbounded polyhedron provided it contains no vertical ray. For ease of exposition ...


9

Here is a fast method that will "often" work. Roughly, it requires that the convex polygon have no sharp angles between faces. Preprocessing goes as follows. Create triangles from the polygons. So a 5-gon with vertices {a,b,c,d,e} would become the set of triangles {{a,b,c},{a,c,d},{a,d,e}}. For each vertex we average it's star (set of points connected by ...


9

Here's a possible approach. First use TetGen to tetrahedralize the data: Needs["TetGenLink`"] {pts, tetrahedra} = TetGenDelaunay[data3D]; Next define a function to compute the radius of the circumsphere of a tetrahedron (formula from Wikipedia) csr[{aa_, bb_, cc_, dd_}] := With[{a = aa - dd, b = bb - dd, c = cc - dd}, Norm[a.a Cross[b, c] + b.b ...


9

As pointed out in the comments, there's really no mathematical definition of a concave hull. Of course, just because there's no mathematical definition does not preclude coming up with something that sort of works. I can think of two ways to do this: Easy Way, Not General Your data roughly has axial symmetry parallel to the x-axis. Moreover, all of your ...


6

As I said before, there really isn't such a thing as a concave hull. What you want to do is plot your clusters here. The first problem involves a machine vision problem known as 3D segmentation. Mathematica doesn't have any tools out of the box to do this, as far as I know. One way is to guess how many "clusters" are in your data, although that's hard to ...


5

The procedure I suggested for your other "concave hull" question seems to work reasonably well here, simultaneously isolating the clusters and creating the surfaces. Needs["TetGenLink`"]; {pts,tetrahedra}=TetGenDelaunay[data3D]; csr[{aa_,bb_,cc_,dd_}]:=With[{a=aa-dd,b=bb-dd,c=cc-dd}, Norm[a.a Cross[b,c]+b.b Cross[c,a]+c.c Cross[a,b]]/(2Norm[a.Cross[b,c]])]; ...


2

You can use TetGen and just make a z axis which is set to 0 (or any other constant). The issue with DelaunayTriangulation (if you want to generate a mesh from a list of points) is that it returns an adjacency list of the edges, which is very hard to turn into the polygons. This thread describes the issue with it. Adding a z dimention of 0 is simply: ...


1

Another approach is to use Imtek's package. These deal with both 2 and 3D with interfaces to Shewchuck's triangle and Tetgen respectively. Imtek can be had from the University of Freiburg. Documentation is extensive.



Only top voted, non community-wiki answers of a minimum length are eligible