

# store the edges in a matrix (giving the indices of the points)įor i,indices in enumerate(adjacencies): # get the adjacent vertices of each vertexĪdjacencies = Mat = pcdd.Matrix(vertices, linear=False, number_type="fraction") You will also need to comment out setAlpha (), as this is not applicable to convex. If you would like the CONVEX hull for a plane model, just replace concave with convex at EVERY point in this tutorial, including the source file, file names and the CMakeLists.txt file. Vertices = np.hstack((np.ones((8,1)), points)) This tutorial is written for assuming you are looking for the CONCAVE hull. # to get the convex hull with cdd, one has to prepend a column of ones To get a convex hull and its edges, use pycddlib (the cdd library): # -*- coding: utf-8 -*. S = np.append(s, s) # Here we cycle back to the first coordinateĪx.plot(pts, pts, pts, "r-")Įval("ax.set_')".format(i, i))Īs I understand, you want the edges only (so I don't understand Thorben's answer). # 12 = 2 * 6 faces are the simplices (2 simplices per square face) One simplex is a nD triangle defined by 3 points.īut the plotting function must cycle back to the last point, otherwise only 2 of 3 simplex edges are drawn. The problem is only in the plotting method you use. I know this is old, but I came here from Google so I think others might too. I don't understand why plot lines across faces.Īx = fig.add_subplot(111, projection='3d')
#Point cloud convex hull scilab code#
I made a script in python with scipy.spatial ConvexHull for plot 8 points and plot a cube, the plot of the point cloud is ok, but the cube is not ok, because the code puts two lines going across the diagonal face of the cube in addition to the edge lines. I need to plot a 3D point cloud (number of points: N), then a convex hull (actually a polyhedron with N vertices) from the points.
