computational-geometry

How to find polygons in a given set of points and edges?

▼魔方 西西 提交于 2019-12-17 20:57:37
问题 Consider the following problem: Given N points in plane and M line segments connecting them, find all polygons (convex or concave) that do not contain any other polygons inside. For instance: There are 5 polygons founded: 1 - 2 - 5 - 6 2 - 3 - 5 3 - 4 - 5 7 - 8 - 9 10 - 13 - 20 - 12 - 11 How can I identify these polygons and there corresponding vertices and edges? And what is the fastest solution for this? 回答1: Build graph with segment ends as vertices and segments as edges, then find cycles

Detecting arbitrary shapes

ぐ巨炮叔叔 提交于 2019-12-17 19:49:14
问题 Greetings, We have a set of points which represent an intersection of a 3d body and a horizontal plane. We would like to detect the 2D shapes that represent the cross sections of the body. There can be one or more such shapes. We found articles that discuss how to operate on images using Hough Transform, but we may have thousands of such points, so converting to an image is very wasteful. Is there a simpler way to do this? Thank you 回答1: In converting your 3D model to a set of points, you

Graham scan issue at high amount of points

☆樱花仙子☆ 提交于 2019-12-17 19:47:24
问题 I have an issue in graham scan algorithm when my list have a lot of points, but works every time fine with low amount of points. I made some screenshots : working : (300 points) not working (5000 points) angle calculation: public static double angle(MyVector3D vec1, MyVector3D vec2) { return Math.Atan2(vec2.Y - vec1.Y, vec2.X - vec1.X) * 180 / Math.PI; } sorting points by polar angle depend on max Y point : //bubblesort private void sortList() { double temp = 0.0; MyVector3D tempVector = new

Spherical space constrained delaunay triangulation [closed]

萝らか妹 提交于 2019-12-17 19:32:47
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . For the purposes of implementing a high-performance dynamic pathfinding algorithm on a sphere (in C++), I'm interested in performing an incremental constrained delaunay triangulation on the surface of a sphere. Existing libraries do not seem to be sufficient - the closest that I've been able to find so far is

How can I create an internal spiral for a polygon?

大兔子大兔子 提交于 2019-12-17 16:49:22
问题 For any shape how can I create a spiral inside it of a similar shape. This would be a similar idea to bounding (using Minkowski sum). Rather than creating the same shape inside the shape though it would be a spiral of same shape. I found this - http://www.cis.upenn.edu/~cis110/13su/lectures/Spiral.java It creates a spiral based on the parameters passed so it can be for any regular shape. I want the above for all shapes i.e. irregular polygons too. I am not hugely familiar with geometric

Calculate bounding polygon of alpha shape from the Delaunay triangulation

北城以北 提交于 2019-12-17 16:13:20
问题 Given a set of points in the plane, a notion of alpha-shape, for a given positive number alpha, is defined by finding the Delaunay triangulation and deleting any triangles for which at least one edge exceeds alpha in length. Here's an example using d3: http://bl.ocks.org/gka/1552725 The problem is that, when there are thousands of points, simply drawing all the interior triangles is too slow for an interactive visualization, so I'd like to just find the bounding polygons. This isn't so simple

Camera pose estimation (OpenCV PnP)

扶醉桌前 提交于 2019-12-17 15:37:12
问题 I am trying to get a global pose estimate from an image of four fiducials with known global positions using my webcam. I have checked many stackexchange questions and a few papers and I cannot seem to get a a correct solution. The position numbers I do get out are repeatable but in no way linearly proportional to camera movement. FYI I am using C++ OpenCV 2.1. At this link is pictured my coordinate systems and the test data used below. % Input to solvePnP(): imagePoints = [ 481, 831; % [x, y]

Compute the area of intersection between a circle and a triangle?

北战南征 提交于 2019-12-17 10:29:09
问题 How does one compute the area of intersection between a triangle (specified as three (X,Y) pairs) and a circle (X,Y,R)? I've done some searching to no avail. This is for work, not school. :) It would look something like this in C#: struct { PointF vert[3]; } Triangle; struct { PointF center; float radius; } Circle; // returns the area of intersection, e.g.: // if the circle contains the triangle, return area of triangle // if the triangle contains the circle, return area of circle // if

How to check if line segment intersects a rectangle?

眉间皱痕 提交于 2019-12-17 06:45:44
问题 If you have 2 points, (x1, y1) and (x2, y2), which represent two opposite corners of a rectangle, and 2 other points, (x3,y3) and (x4,y4), which represent 2 endpoints of a line segment, how can you check if the line segment intersects the rectangle? (The line segment is just the segment contained between the given endpoints. It is not an infinite length line defined by those two points.) 回答1: One very simple option would be to use a standard algorithm for checking whether two line segments

What is the fastest algorithm to calculate the minimum distance between two sets of points?

喜欢而已 提交于 2019-12-17 03:42:41
问题 I want to find the minimum distance between two polygons. I have to find the minimum of shortest distance between each vertex of first shape with all of the vertices of the other one. Something like the Hausdorff Distance, but I need the minimum instead of the maximum. 回答1: Perhaps you should check out ( PDF warning! Also note that, for some reason, the order of the pages is reversed ) "Optimal Algorithms for Computing the Minimum Distance Between Two Finite Planar Sets" by Toussaint and