12 votes

How can I determine if two vertices on a polygon are consecutive?

As the polygon is convex, it is simple! Two vertices are consecutive if all other vertices are located on the same side of the line that goes through these two points. This means that the cross ...
user avatar
  • 3,512
6 votes
Accepted

Partial polygon matching

There is quite a bit of work on this important problem. Some of the most insightful work is by Helmut Alt and collaborators. He wrote a survey in 2009: Helmut Alt. "The computational geometry of ...
user avatar
5 votes

How can I determine if two vertices on a polygon are consecutive?

Given that the polygon is convex, its centroid $C$ is in its interior. Test the gradients of the lines $CV$ for each vertex $V$. This gives a linear time test.
user avatar
  • 2,072
4 votes

How can I determine if two vertices on a polygon are consecutive?

An alternative to OmG's answer (which is great) would be to sort your points into an ordered array where you can find any points neighbors by looking at the points on either side. This method would be ...
user avatar
3 votes

Merging rectangles into rectilinear polygon

Form a list of the $4n$ edges making up the $n$ rectangles. Delete every edge that appears twice. The edges that remain describe the outside of the polygon. If you want to list these edges in ...
user avatar
3 votes
Accepted

Check if intersection of several 2D half-planes is empty

Your problem can be solved in linear time. This paper describes a method to solve a system of $n$ linear inequalities with at most two variables per inequality and $m$ distinct variables in total in $...
user avatar
  • 23.4k
3 votes
Accepted

How to efficiently find line-segment intersections between two sets?

The problem you describe is known as the red-blue intersection problem. Here, we have a red set of $n_1$ segments and a blue set of $n_2$ segments and we know that there are only intersections between ...
user avatar
  • 6,978
3 votes
Accepted

Compute visible vertices of a polygon

Yes, there are more algorithms to do so in $\mathcal O(n)$. The first is dated back to ElGindy and Avis in 1981, Lee 1983 and Joe & Simpson in 1985. The visibility algorithms use stack (the first ...
user avatar
  • 9,325
3 votes

An algorithm to find the area of intersection between a convex polygon and a 3D polyhedron?

You have a 2D convex polygon $G$, and a 3D polyhedron $H$. Let $P_G$ denote the plane that the polygon is contained in. The following should work: Their intersection is a 2D polygon. You can find ...
user avatar
  • 141k
3 votes

Finding all faces in a wireframe mesh

After conducting more research I did find a solution, but first I will examine solutions suggested by posters and considered by myself and review why they didn't work. ...
user avatar
  • 243
2 votes

Is there an efficient algorithm to extract the farthest ends of a thin contour?

Run Flood Fill from any point and the farthest points in the both directions are your result. If you find that the distance in one of the directions is zero it means that it was one of them. ...
user avatar
  • 9,325
2 votes

Partial polygon matching

One reasonable approach is to use RANSAC to find a homography that causes many points to be aligned (or approximately aligned). You'd apply this procedure to align the set of vertices of the first ...
user avatar
  • 141k
2 votes
Accepted

Running time for Testing Polygonal Neighbours for Intersection or Inclusion

In the paper you reference, Theorem 5 is a claim about simple polygons, where Theorem 6 deals with convex polygons, which are a special kind of simple polygons. The 'As we have seen before, ...' ...
user avatar
  • 6,978
2 votes

Convex-hull of a star shaped polygon in O(n)

Graham scan for a convex hull works if you have an ordering of points $a_1,a_2,...a_N$ such that you have a sequence $p_1 < p_2 <...< p_k$ where your convex hull is $a_{p_1}, a_{p_2},...,a_{...
user avatar
  • 201
2 votes
Accepted

Simplex Algorithm: Why must the optimal value of the LP lie on the face or vertex of a polyhedron?

Suppose $P = \lbrace x: Ax \leq b \rbrace$ is the polyhedra, where $x \in \mathbb{R}^n$. Further assume $P$ is full dimensional, then let $x_0$ be some interior point in P. Let $c \in \mathbb{R}^n$ (...
user avatar
2 votes
Accepted

Selecting a polygon within an array of complex polygons

I would use a winding number algorithm. There are a few, but the fastest goes like this:Imagine a line from your point along the positive x-axis. Now, for every edge of your polygon, determine if it ...
user avatar
2 votes

Is Dual Graph of a Triangulation of a Polygon Tree?

Below is an example of a polygon with a single hole. The red area is the interior of the polygon, and the white triangle in the center is the hole (which lies outside the polygon). In the figure, I've ...
user avatar
  • 6,978
2 votes
Accepted

assign points to non-overlapping rectangles

Most spatial indexes should be good, especially if your rectangles are axis aligned. Spatial indexes typically have about $O(log{M})$ insertion time so you could build in index in $O(M * log{M})$. ...
user avatar
  • 689
1 vote
Accepted

Is there a computationally optimal point-in-polygon solution (for a dynamic scenario)?

I can list three candidate approaches. I'm not sure how to choose among them -- you might need to experiment among them to see which will work best in your situation. Approach #1: sweepline algorithm ...
user avatar
  • 141k
1 vote

Find an edge that is completely visible from point outside a polygon (Convex Hull)

It is not too hard. connect the point to the end-point of an edge. If none of these two segments has an intersection with convex-hull, it means you can see that edge completely (as you consider a ...
user avatar
  • 3,512
1 vote

Joining points of polygon in correct order

Start from the leftmost point $x_0$ (the one with minimum $x$-coordinate). If there are ties break them in favor of the point with minimum $y$ coordinate. Suppose for simplicity that there are no ...
user avatar
  • 23.4k
1 vote

Efficient rasterisation of vector image with polygons

The quad tree suggestion by D.W. is interesting. I want to expand on it here. The principle of it is to break the area into big (and then progressively smaller) squares and check whether these squares ...
user avatar
  • 121
1 vote

Efficient rasterisation of vector image with polygons

An alternative approach is to use a quad-tree. One approach is to store each polygon in the deepest node that corresponds to a region that wholly contains the polygon. Given a test point, you ...
user avatar
  • 141k
1 vote

Convert a polygon mesh into a b-spline surface

Without any assumptions on the input mesh, you cannot in general get a single b-spline surface that replicates an arbitrary polygon mesh. You would need the mesh to be connected, but you would also ...
user avatar
1 vote
Accepted

Detecting rotational symmetries of spatial structures

Here is one approach to identify all rotational symmetries of the graph: Pick any three vertices, $v_1,\dots,v_3$. Loop over all possible combinations of three vertices $w_1,\dots,w_3$. For each ...
user avatar
  • 141k
1 vote

Using visible line segments to compute a visibility polygon

First, assume we already have a list $L$ with all segments in $P$ that are at least partially visible from $p$, ordered by the smallest angle $\theta$ such that a segment is visible from $p$ at angle $...
user avatar
  • 6,978
1 vote

Is there an efficient algorithm to extract the farthest ends of a thin contour?

Build a graph, with one vertex per black pixel, and an edge between two pixels if they are adjacent. Compute all-pairs shortest-path distances $d(x,y)$. For each vertex $x$, compute $$f(x) = \max \{...
user avatar
  • 141k
1 vote

Is there an efficient algorithm to extract the farthest ends of a thin contour?

Compute the topological skeleton of the black pixels. This will form a curved line one pixel wide (i.e., it will be isomorphic to a line). Use the two endpoints of this line as your answer. You can ...
user avatar
  • 141k
1 vote

Repeated point in polygon: preprocessing complexity given logarithmic query time?

Your problem is a special case of planar point location. The algorithm/data structure you found by Snarak and Tarjan can answer point location (and thus point in polygon) queries in $O(\log n)$ time ...
user avatar
  • 81

Only top scored, non community-wiki answers of a minimum length are eligible