def delaunay_numpy(vertices):
    """Delaunay triangulation from numpy.

	Parameters
	----------
	vertices : list
		List of vertex coordinates.

	Returns
	-------
	list
		List of face vertices.

	"""

    from compas.geometry import delaunay_from_points_numpy
    return delaunay_from_points_numpy(vertices)
Пример #2
0
        plotter.show()

    """
    points = asarray(points)
    voronoi = Voronoi(points)
    return voronoi


# ==============================================================================
# Main
# ==============================================================================

if __name__ == "__main__":

    from compas.datastructures import Mesh
    from compas.geometry import pointcloud_xy
    from compas.geometry import delaunay_from_points_numpy
    from compas_plotters import MeshPlotter

    points = pointcloud_xy(20, (0, 50))
    faces = delaunay_from_points_numpy(points)

    delaunay = Mesh.from_vertices_and_faces(points, faces)

    plotter = MeshPlotter(delaunay, figsize=(12, 8))

    plotter.draw_vertices(radius=0.1)
    plotter.draw_faces()

    plotter.show()