convex-polygon

How do I find the Pareto-optimal points in O(nh) and O(nlog(h)) complexity?

心已入冬 提交于 2021-01-29 04:00:37
问题 Can anybody suggest an algorithm to find Pareto-optimal points (to form a staircase) just as given in diagram in O(n*h) and O(n*log(h)) time complexity, where h is the number of Pareto-optimal points? I used gift wrapping algorithm to solve this (in O(n*h) ), but it only finds convex hulls type of staircase and misses those points who form concave angles. 回答1: To put suggestion in one place. Idea is to use divide and conquer strategy. If we can find pareto point P which splits rest of pareto

Android Google Maps PolygonOptions not plotted from given set of coordinates

妖精的绣舞 提交于 2020-01-02 05:43:11
问题 I am trying to plot a complex polygon around a route, following its steps with a given radius. To do so I drew 50-sided uniform polygons (which are practically circles) around each step (coordinate) of the route. Now I obtain a set of coordinates of all the plotted circles around the route, and I can see them on the map but they are overlapped which is not very good looking, and it's not a good practice to add such a huge number of overlays on the map. So what I need to do now is to merge all

Find polygon perimeter of points quickly in Javascript

时光毁灭记忆、已成空白 提交于 2019-12-24 00:56:55
问题 I'm making a terrain editor and I need to find the perimeter polygon of a set of points. If I just needed a convex hull then the speed would be no issue. To make a concave hull, I must go through a few hoops. I've figured out that I can triangulate the points and then throw away any triangles with a side longer than the known distance between the points. The next step is the problem: Combining the triangles (as mini polygons) into one large polygon using the JSTS geometry library (http:/

Polygon Decomposition - Removing Concave Points to Form Convex Polygons

我的未来我决定 提交于 2019-12-23 16:43:30
问题 I would like to deconstruct the following polygon shown in blue removing all of the points from the polygon that cause concavity. Currently, what I have been attempting to do is: Take each point out of the polygon Test the point to see if it falls within the polygon created by the rest of the set If true remove the point If false keep the point This works in most cases, but in the previous case the points at (2,3) and (2,4) will not both be removed. In both cases either one of the points will

Get border edges of mesh - in winding order

这一生的挚爱 提交于 2019-12-21 03:42:14
问题 I have a triangulated mesh. Assume it looks like an bumpy surface. I want to be able to find all edges that fall on the surrounding border of the mesh. (forget about inner vertices) I know I have to find edges that are only connected to one triangle, and collect all these together and that is the answer. But I want to be sure that the vertices of these edges are ordered clockwise around the shape. I want to do this because I would like to get a polygon line around the outside of mesh. I hope

Calculating uv texture coords for a procedurally generated polygon

核能气质少年 提交于 2019-12-12 14:22:06
问题 I have a shape like this: and the coordinates of the points are available (Vertices have x and y components) My texture is: A simple planar UV mapping gives me: and what I desire is: How to calculate vertex positions to get the desired mapping? Note that this is a math problem. Also, I can tolerate stretching, as long as the vertices fall on the grassy side. 来源: https://stackoverflow.com/questions/26397115/calculating-uv-texture-coords-for-a-procedurally-generated-polygon

Convex hull in higher dimensions, finding the vertices of a polytope

非 Y 不嫁゛ 提交于 2019-12-09 05:39:23
问题 Suppose I have a point cloud given in 6-dimensional space, which I can make as dense as needed. These points turn out to lie on the surface of a lower-dimensional polytope (i.e. the point vectors (x1, x2, ... x6) appear to be coplanar). I would like to find the vertices of this unknown polytope and my current attempt makes use of the qhull algorithm, via the scipy interface in Python. In the beginning I would only get error messages, apparently caused by the lower dimensional input and/or the

Plot the solution of a system of linear inequalities

浪子不回头ぞ 提交于 2019-12-08 13:22:25
问题 I have two arrays of numbers from [-1,1]: a = 2*np.random.sample(100)-1 and b = 2*np.random.sample(100)-1 . These two arrays define the following system of linear inequalities a[i]*x + b[i]*y <= 1 for i = 0,1,..., 99 The solution-set of this system is a convex polygon. How to draw it using matplotlib? As I understand, fill_between allows to do this only for case of two inequalities. 回答1: You can use the fillplots package (http://fillplots.readthedocs.org) that does exactly what you are

How to test if a line intersects a convex polygon?

可紊 提交于 2019-12-07 19:44:31
问题 Assume you are given the equation of a line (in 2d), and the equations of lines that form a convex polygon (the polygon could be unbounded). How do I determine if the line intersects the polygon? Furthermore, are there computational geometry libraries where such tasks are pre-defined? I ask because I'm interested not just in the 2D version but n-dimensional geometry. 回答1: For the 2D case, I think the problem simplifies a bit. The line partitions the space into two regions. If the polygon is

How to test if a line intersects a convex polygon?

被刻印的时光 ゝ 提交于 2019-12-06 09:37:27
Assume you are given the equation of a line (in 2d), and the equations of lines that form a convex polygon (the polygon could be unbounded). How do I determine if the line intersects the polygon? Furthermore, are there computational geometry libraries where such tasks are pre-defined? I ask because I'm interested not just in the 2D version but n-dimensional geometry. For the 2D case, I think the problem simplifies a bit. The line partitions the space into two regions. If the polygon is present in only one of those regions, then the line does not intersect it. If the polygon is present in both