delaunay

Is it possible to enforce edges (constrained delaunay triangulation) in scipy.spatial's Delaunay?

点点圈 提交于 2021-02-19 04:52:05
问题 I am experimenting with scipy.spatial's implementation of Qhull's Delaunay triangulation. Is it possible to generate the triangulation in a manner that preserves the edges defined by the input vertices? (EDIT: i.e. a constrained Delaunay triangulation.) As can be done with the triangle package for Python. For example, in the picture below there are several triangles (blue) that disregard the location of the edges (red) that are defined by the vertices. Is there a way to enforce these edges

Getting the circumcentres from a delaunay triangulation generated using matplotlib

安稳与你 提交于 2021-02-19 02:24:05
问题 If I use matplotlib to generate a delaunay triangulation for a group of points, what is the most appropraite way of getting the circumcentres of the triangles that have been geenrated? I haven't yet managed to find an obvious method in the Triangulation library to do this. 回答1: You should be able to calculate it using matplotlib.delaunay.triangulate.Triangulation : Triangulation(x, y) x, y -- the coordinates of the points as 1-D arrays of floats . . . Attributes: (all should be treated as

2D Delaunay triangulation in CGAL using an arbitrary plane

…衆ロ難τιáo~ 提交于 2020-12-29 07:44:21
问题 I am new to using CGAL, and I was wondering if CGAL supports 2D Delaunay triangulation of 3D points using an arbitrary plane. The example on CGAL's documentation lists only Projection_traits_xy_3<R> , Projection_traits_yz_3<R> , and Projection_traits_xz_3<R> , in other words, projection on the xy plane, the yz plane and the xz plane. Is there any way I can define an arbitrary projection plane instead of using the xy, yz and xz planes? thanks, 回答1: There is a template < class Kernel > class

A Brute-Force Constrained Delaunay Triangulation?

只谈情不闲聊 提交于 2020-01-21 05:30:30
问题 I need to create a triangle mesh from a set of points. The set has very few points so it doesn't need to be fast or optimised (I will deal with 100 points maximum). The mesh needs to be a constrained "delaunay triangulation". In the image below I showed (on the left) the set of points I start from (blue and red dots). I also know the connections between these points (the outline in black). The mesh needs to look like the example on the right (including the edges in grey that form outside and

Duplicate edges not being removed in Delaunay Triangle construction

瘦欲@ 提交于 2020-01-03 04:38:08
问题 I'm trying to implement Delaunay Triangulation. However, I seem to be having a problem with edges creating overlapping triangles: I'm basing my implementation as described on this site. I'm just using a brute force loop to check whether or not an edge already exists in the set. v = vertex to be added edgeBuffer = []; for each triangle if v is in the triangle's circumscribed circle for each edge in the triangle check if it's already in edgeBuffer if not, add it remove triangle I suspect that

Bad automatic Triangulation with Mayavi for coloring a surface known only by its corner

梦想的初衷 提交于 2020-01-03 03:13:13
问题 I trying to color a surface known only by its corner according to its Y value with Mayavi. Original, I I succeed in making the same thing with matplotlib (here) but I put back this canonical on my real data, the rendering was not sufficient and therefore I am trying now with Mayavi. I found the example from Surface from irregular data example which is quite helpful. However when applied to my case, reproduce here on this simple case, the triangulation gets wrong as seen on the figure below

how to plot non-convex surface from set of n x 3 data

本秂侑毒 提交于 2020-01-02 07:32:07
问题 Is there a straight forward way to plot a non-convex surface in R? I have used something like the following for convex surfaces and it works fine: xyz <- cbind(y,x,z) tbr <- t(surf.tri(xyz, delaunayn(xyz))) rgl.triangles(xyz[tbr,1], xyz[tbr,2], xyz[tbr,3]) However, for non-convex surfaces, concave areas become filled. I think this is a problem with the function delaunayn() as it uses the Qhull library which does not support constrained Delaunay triangulations or mesh generation of non-convex

Find the projection of a point on the convex hull with Scipy

情到浓时终转凉″ 提交于 2020-01-01 16:48:29
问题 From a set of points, I'm getting the convex hull with scipy.spatial , either with Delaunay or ConvexHull (from the qhull library). Now I would like to get the projection of a point outside this convex hull onto the hull (i.e. the point on the hull that is the smallest distance from the point outside). This is the code I have so far: from scipy.spatial import Delaunay, ConvexHull import numpy as np hu = np.random.rand(10, 2) ## the set of points to get the hull from pt = np.array([1.1, 0.5])

How to find all neighbors of a given point in a delaunay triangulation using scipy.spatial.Delaunay?

六月ゝ 毕业季﹏ 提交于 2019-12-30 00:36:53
问题 I have been searching for an answer to this question but cannot find anything useful. I am working with the python scientific computing stack (scipy,numpy,matplotlib) and I have a set of 2 dimensional points, for which I compute the Delaunay traingulation (wiki) using scipy.spatial.Delaunay . I need to write a function that, given any point a , will return all other points which are vertices of any simplex (i.e. triangle) that a is also a vertex of (the neighbors of a in the triangulation).

CGAL: 2D Constrained Delaunay Triangulation - Adding information to constraints

强颜欢笑 提交于 2019-12-24 03:01:07
问题 It is possible to attach informations (like ints) to points before adding them up to the triangulator object. I do this since I need on the one hand an int-flag that I use lateron to define my texture coordinates and on the other hand an index which I use so that I can create a indexed VBO. http://doc.cgal.org/latest/Triangulation_2/Triangulation_2_2info_insert_with_pair_iterator_2_8cpp-example.html But instead of points I only want to insert constraint-edges. If I insert both CGAL returns