qhull

Picture Convex hull in 3D Scatter Plot

筅森魡賤 提交于 2019-12-04 18:13:32
I followed the tutorial about 3D visualization using the package "rgl" here So I was able to draw a 3D Scatter Plot with "iris" data and create an ellipsoid surrounding 95 % of the data points: library("rgl") data(iris) x <- sep.l <- iris$Sepal.Length y <- pet.l <- iris$Petal.Length z <- sep.w <- iris$Sepal.Width plot3d(x, y, z, col="blue", box = FALSE, type ="s", radius = 0.15) ellips <- ellipse3d(cov(cbind(x,y,z)), centre=c(mean(x), mean(y), mean(z)), level = 0.95) plot3d(ellips, col = "blue", alpha = 0.2, add = TRUE, box = FALSE) I know that the first 50 data points belong to a different

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

☆樱花仙子☆ 提交于 2019-12-04 15:00:43
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]) ## a point outside pt2 = np.array([0.4, 0.4]) ## a point inside hull = ConvexHull(hu) ## get only the

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

巧了我就是萌 提交于 2019-12-03 20:20:49
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 appreciate that this won't always result in a valid Delaunay triangulation (e.g. when the x and y step

qhull Library - C++ Interface

我是研究僧i 提交于 2019-12-03 02:11:08
The qhull library ( qhull.org) has several examples to start in his website, but all the information regarding to the C++ is not very useful to me. I am trying to make a simple convex Hull of 3D points that I read from a file, I can´t use the technique that is suggested in the website of calling the qhull.exe as an external application because I need to make several convex hull from some modifications that I made in the data points. I can´t find a simple example for doing this, can someone give me some help in this task? Any information would be useful. Thanks Since I had a hard time using

3d surface plot with xyz coordinates

a 夏天 提交于 2019-11-29 20:09:10
I am hoping someone with experience can help in how one prepares the shape files from xyz data. A great example of a well-prepared dataset can be seen here for the comet Churyumov–Gerasimenko, although the preceding steps in creating the shape file are not provided. I'm trying to better understand how to apply a surface to a given set of XYZ coordinates. Using Cartesian coordinates is straight forward with the R package "rgl", however shapes that wrap around seem more difficult. I found the R package geometry , which provides an interface to QHULL functions. I tried using this to calculate

3d surface plot with xyz coordinates

风格不统一 提交于 2019-11-28 16:00:32
问题 I am hoping someone with experience can help in how one prepares the shape files from xyz data. A great example of a well-prepared dataset can be seen here for the comet Churyumov–Gerasimenko, although the preceding steps in creating the shape file are not provided. I'm trying to better understand how to apply a surface to a given set of XYZ coordinates. Using Cartesian coordinates is straight forward with the R package "rgl", however shapes that wrap around seem more difficult. I found the R

Volume of convex hull with QHull from SciPy

陌路散爱 提交于 2019-11-28 09:13:04
I'm trying to get the volume of the convex hull of a set of points using the SciPy wrapper for QHull . According to the documentation of QHull , I should be passing the "FA" option to get the total surface area and volume. Here is what I get.. What am I doing wrong? > pts [(494.0, 95.0, 0.0), (494.0, 95.0, 1.0) ... (494.0, 100.0, 4.0), (494.0, 100.0, 5.0)] > hull = spatial.ConvexHull(pts, qhull_options="FA") > dir(hull) ['__class__', '__del__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__',

Speedup scipy griddata for multiple interpolations between two irregular grids

大憨熊 提交于 2019-11-26 10:35:59
问题 I have several values that are defined on the same irregular grid (x, y, z) that I want to interpolate onto a new grid (x1, y1, z1) . i.e., I have f(x, y, z), g(x, y, z), h(x, y, z) and I want to calculate f(x1, y1, z1), g(x1, y1, z1), h(x1, y1, z1) . At the moment I am doing this using scipy.interpolate.griddata and it works well. However, because I have to perform each interpolation separately and there are many points, it is quite slow, with a great deal of duplication in the calculation