delaunay

CGAL: Help getting triangles coordinates from Delaunay Triangulation

爱⌒轻易说出口 提交于 2019-12-23 13:08:56
问题 I'm new with CGAL, i'm sure my question is very simple. I am trying to use CGAL to do some Delaunay triangulation. I have a grid with N 3D points over a sphere and I want to triangulate the sphere using those points as the vertex of the triangles. I just need to get a list of the vertex of the resulting triangles like that: id_triangle1 vertex_1 vertex_2 vertex_3 id_triangle2 vertex_1 vertex_2 vertex_3 ....... I have done that to perform the triangulation: std::vector<Point> P; for(i=0;i

CGAL Using Locate() to Find Cell on Triangulation Surface

丶灬走出姿态 提交于 2019-12-23 04:32:15
问题 Using CGAL, I have a 3D Delaunay Triangulation of a set of random points on the unit sphere, that I obtained via: Delaunay T(points.begin(), points.end()); Now, what I would like to be able to do is query T (using locate() or something like that) to find the three vertices of the surface facet that an arbitrary point (also on the unit sphere) is contained inside. When I use locate(), I get interior cells as results sometimes, which include the infinite vertex. I don't want any of these. I

Filling triangles in Matplotlib triplot with individual colors

无人久伴 提交于 2019-12-22 14:58:06
问题 Is it possible to plot a list of triangles generated by scipy.spatial.Delaunay using pyplot's triplot function so that each triangle can be drawn and filled with an individual color? The basic python script I've created is import numpy as np import matplotlib.pyplot as plt from scipy.spatial import Delaunay import matplotlib.image as mpimg h = 300 w = 1000 npts = 30 pts = np.zeros((npts,2)) pts[:,0] = np.random.randint(0,w,npts) pts[:,1] = np.random.randint(0,h,npts) tri = Delaunay(pts) plt

Filling triangles in Matplotlib triplot with individual colors

被刻印的时光 ゝ 提交于 2019-12-22 14:55:05
问题 Is it possible to plot a list of triangles generated by scipy.spatial.Delaunay using pyplot's triplot function so that each triangle can be drawn and filled with an individual color? The basic python script I've created is import numpy as np import matplotlib.pyplot as plt from scipy.spatial import Delaunay import matplotlib.image as mpimg h = 300 w = 1000 npts = 30 pts = np.zeros((npts,2)) pts[:,0] = np.random.randint(0,w,npts) pts[:,1] = np.random.randint(0,h,npts) tri = Delaunay(pts) plt

Triangulate a set of points with a concave domain

瘦欲@ 提交于 2019-12-21 12:14:14
问题 Setup Given some set of nodes within a convex hull, assume the domain contains one or more concave areas: where blue dots are points, and the black line illustrates the domain. Assume the points are held as a 2D array points of length n , where n is the number of point-pairs. Let us then triangulate the points, using something like the Delaunay method from scipy.spatial: As you can see, one may experience the creation of triangles crossing through the domain. Question What is a good

Regularly spaced orthogonal grid Delaunay triangulation (Computing the paraboloid coeficients)

六眼飞鱼酱① 提交于 2019-12-21 05:38:11
问题 I'm trying to construct a Delaunay triangulation for the very specific case where the input x and y coordinates are orthogonal and relatively equidistant. Given the data size is relatively large (1000x1200 triangulation points) and that the Qhull algorithm doesn't know about my extra orthogonal condition, the triangulation is relatively slow (25 seconds on my machine). As such, I'd like to manually construct a Delaunay triangulation with each of my known quads subdivided into two triangles. I

Interpolation with Delaunay Triangulation

旧时模样 提交于 2019-12-21 04:53:31
问题 Having a cloud point shaped like some sort of distorted paraboloid, I would like to use Delaunay Triangulation to interpolate the points. I have tried other techniques (f.ex. splines) but did not manage to enforce the desired behavior. I was wondering if there's a quick way to use the results of scipy.spatial.Delaunay in a way where I can give the (x,y) coords and get the z-coord of the point on the simplex (triangle). From the documentation looks like I can pull out the index of the simplex

python scipy Delaunay plotting point cloud

旧城冷巷雨未停 提交于 2019-12-21 00:23:32
问题 I have a pointlist=[p1,p2,p3...] where p1 = [x1,y1],p2=[x2,y2] ... I want to use scipy.spatial.Delaunay to do trianglation on these point clouds and then plot it How can i do this ? The documentation for the Delaunay is really scarce so far i have this code from subprocess import Popen, PIPE import os os.environ['point_num'] = "2000" cmd = 'rbox $point_num D2 | tail -n $point_num' sub_process = Popen(cmd, shell=True,stdout=PIPE,stderr=PIPE) output = sub_process.communicate() points = [line

MATLAB: Create Delaunay Triangulation with Opening

守給你的承諾、 提交于 2019-12-18 08:49:32
问题 I have a polygon with V vertices and n number of openings. How can I create a mesh using Delaunay triangulation for this polygon in MATLAB? I know I can use the delaunay function, but I don't know how to input the opening. 回答1: Note: Newer versions of MATLAB recommend using the delaunayTriangulation class and its associated methods. The solution below is valid for older versions, and should be easy to adapt to the newer class. You can use the function DelaunayTri to create a Delaunay

How do I derive a Voronoi diagram given its point set and its Delaunay triangulation?

笑着哭i 提交于 2019-12-17 22:16:59
问题 I'm working on a game where I create a random map of provinces (a la Risk or Diplomacy). To create that map, I'm first generating a series of semi-random points, then figuring the Delaunay triangulations of those points. With that done, I am now looking to create a Voronoi diagram of the points to serve as a starting point for the province borders. My data at this point (no pun intended) consists of the original series of points and a collection of the Delaunay triangles. I've seen a number