I have a set of Points [X, Y, Z]
as an interest points of a 3D Object
and I'm searching for an algorithm that used to convert this points into 3D-Model "Triangulation Algorithm"
I just tried "Delaunay Triangulations" algorithm, but its result is the convex hull of my set of points
and this will not work for me as all inner points will be neglected
Any Suggestions?
The Delaunay triangulation in 3D produces a partition of the convex hull into tetrahedra, with all your points becoming vertices of the tetrahedra. Inner points will not be "neglected."
Here is an image from the CGAL manual:
Related
I have a convex polygon in Oxy plane (defined by some vertices and edges). I would like to create a 3D polyhedron from extruding this polygon in z axis for some distance h. How can I do this in bullet physics?
Thank you for your time.
The extrusion is simple to do by hand. For each vertex in the polygon you duplicate it, and set the Z value to the distance h. Then you can create a btConvexHullShape from the points in the set. Since it's a convex hull and not a triangle mesh you don't need to worry about the face information. If you look at the btConvexHullShape constructor you'll notice it only takes a list of points as the parameter.
For a collision check I need to calculate time when two convex polyhedra intersect if one of them is moving along a straight line. Currently, I have:
Input: Convex polyhedron defined as a set of points of one object A and its movement direction.
Input: Convex polyhedron defined as a set of points of second object B
Calculate Minkowski sum of the two sets of points C, |C| = |A| * |B|
Calculate triangulated convex hull of C (using QuickHull)
Line intersection against triangles of the convex hull and store minimum and maximum distance along line.
This all works, but is slow. Especially the step to calculate the triangulated convex hull.
I wonder if there is a faster way to calculate the ray-convex polyhedron intersection from the set of points without calculating the triangulated convex hull. I could get the input as planes (plane equations) if it helps.
Solved by separation axis theorem:
Input: convex collision volumes as both points and plane equations
For each plane in both collision volumes, calculate shift along the movement direction when each plane becomes a separation plane (vertices of the other collision volume are all in front of the plane).
Calculate interval of shift when there is no separation plane. This can be done in place by keeping track of minimum and maximum values encountered.
Compared to the original solution:
Theoretical complexity down from O(N log N) to O(N), where N = |C| = |A| * |B|
Works in place - no memory allocation
My problem is to find if a generic (convex or concave) polygon and a rectangular polygon in 3D space has a not-null intersection. Each polygon is defined by the set of the ordinated contour points (if point p1 is after/before point p2 the edge p1-p2 exists).
It is easy to find the intersection line of the two plane of the polygons so the problem is finding the intersections of a line and the finite polygons and if the resulting intersections have a portion in common. I found algorithms for the intersection of a line and a convex polygon but I can't find anything for the general case of concave polygon.
Any suggestion?
Thank you
find the intersection point of the plane-intersection line with every edge of both figures. From there its s straightforward problem of looking at the ordering of the points on the line to check for any overlap.
Of course the special case where they are coplanar is a whole other problem..
There are usually no fast solutions for concave polygon intersection / containment/ etc queries.
The general solution is always to triangulate the polygon into a series of convex triangles, then run your intersection test with those triangles.
If you can rely on the polygon to be planar, you can first intersect the line with the plane and then transform the intersection point into the coordinate system of the plane.
Assuming you have also transformed all the vertices of the polygon, the problem is now to decide whether the 2D intersection point is within a 2D polygon.
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 are significantly different), but in my case I'm fairly confident that the subdivision approach will produce a good triangulation.
In the following plot, I have labelled each of the triangles with an index, the initial vertex and vertex definition direction:
In this case I have and x and y coordinates of [-1, 1.33, 3.67, 6] and [2, 4.5, 7, 9.5, 12] respectively.
I'm currently using the SciPy wrappers to Qhull, and have been able to construct vertices and appropriate neighbor information, but am having difficulty defining the equations attribute (as briefly mentioned at http://docs.scipy.org/doc/scipy-dev/reference/generated/scipy.spatial.ConvexHull.html).
Essentially, I believe these values are parameters of each triangle's normal to the paraboloid defined by the paraboloid_scale and paraboloid_shift attributes, but cannot come up with the magic numbers suitable for interpretation by Qhull. There should be n_dimensions + 1 values per vertex and there is code in SciPy which computes the distance of each vertex from a given point:
dist = d.equations[isimplex*(d.ndim+2) + d.ndim+1]
for k in xrange(d.ndim+1):
dist += d.equations[isimplex*(d.ndim+2) + k] * point[k]
So my questions are:
Have I interpreted the equation attribute correctly?
Is there a tool out there already which does this for me?
Can I compute the equation parameter values given my orthogonal and mostly-equidistant case without going through Qhull?
To compute a 2D Delaunay triangulation, qhull lifts the 2D points in 3D, onto a paraboloid, then compute the lower convex hull of those 3D points, and the 2D Delaunay triangulation is the projection in the 2D plane of that 3D lower convex hull.
See that image taken from here:
For each face of the 2D Delaunay triangulation, the corresponding 3D hyperplane is the 3D plane that passes through the three lifted 3D points. If the triangulation is Delaunay, that hyperplane corresponds to an empty circle in 2D. See that image taken from here:
I am trying to implement the Bowyer-Watson algorithm for generating a Delaunay Triangulation of a set of points in a plane. The algorithm assumes a presence of a bounding super-triangle, but some alternatives like maintaining the convex hull of the set of points have also been mentioned.
Thus, when we decide to produce a delaunay triangulation of points by assuming a convex hull in an incremental algorithm, if a point lies outside the convex hull, we should draw vertices from the point to all the vertices on the convex hull which comprise the faces of the hull from which the point is visible.
I was wondering how could I approach this problem? Should I initially generate a convex hull of all the points or like in the incremental approach where points are added one at a time, should i maintain a convex hull in the form of a DCEL?
EDIT: In the image above, if I have the point P which is outside the convex hull of a set of points in a plane, I need to calculate the edges of the hull from which the point is visible. [The green edge of the hull]
I hope the image helps in clarifying the question.
Thanks in advance
The edges that see P are those that form a clockwise triangle with P when the hull is traversed counterclockwise (compute the signed area).