Questions tagged [convex-polygon]

A convex polygon is a simple polygon whose interior is a convex set. In a convex polygon ,every internal angle is less than or equal to 180 degrees and every line segment between two vertices remains inside or on the boundary of the polygon.

99 questions
2
votes
4 answers

How to test if a line intersects a convex polygon?

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…
elexhobby
  • 2,588
  • 5
  • 24
  • 33
2
votes
1 answer

Java2D: Fill a convex rounded polygon (QuadCurves)

If I have a QuadCurve like this (+ = node): + + \ ./ +--⁻⁻ And I fill it in Java 2D the result is something like this: (x = colored) +xxxxxxxxx+ \xxxxxx./ +--⁻⁻ But I want to color the other side: + + x\ ./x xxx…
Martijn Courteaux
  • 67,591
  • 47
  • 198
  • 287
2
votes
1 answer

Physijs - ConvexMesh wall collision detection issue

I'm using Three.js and Physijs. I have a wall that should act as a boundary, but objects (especially boxes) often pass through it, if the force is sufficient. The collision is detected, as they do not do so cleanly, but they start spinning or bounce…
user2623008
  • 311
  • 3
  • 13
2
votes
1 answer

Find polygon perimeter of points quickly in Javascript

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…
user54580
  • 375
  • 2
  • 8
2
votes
1 answer

Detecting rectangles in maze environment

[This is my first post on this site, I'll try to be as complete as possible but forgive me if my problem statement is unclear or the code formatting is not up to standards] I am trying to detect the largest possible rectangles in a maze environment,…
Wouter Kuijsters
  • 840
  • 6
  • 20
1
vote
0 answers

How to create a hollowed polygon in USD without using diving it into convex polygons or triangulation?

I am using python API to write USDA scripts, a human-readable USD (Universal Scene Description) file format. The task is to render a polygon with holes in it. The closest attribute in the openUSD repository is holeIndices, as shown here:…
1
vote
0 answers

Optimal Way of Verifying a 3D Mesh Convex

There are numerous questions on stack overflow similar to this problem already, but most are creating a convex hull, or checking in 2D Space. I already have created an algorithm to create a 3D Convex Hull given the original Mesh's vertices, and…
1
vote
1 answer

Get convex hull indices

I would like to calculate the convex hull of a set of points. Most algorithms I've found online return a list of points but I need a list of indices to the points. To do this I've taken some existing code that calculates the points and tried…
Michael
  • 3,411
  • 4
  • 25
  • 56
1
vote
0 answers

Efficient sorting of integer vertices of a convex polygon

I am given as input n pairs of integers which describe points in the 2D plane that are known ahead of time to be vertices of some convex polygon. I'd like to efficiently sort these points in a clockwise or counter-clockwise fashion. At first I…
1
vote
1 answer

Evaluate the weights of a convex combination

I'm using the scipy.spatial.ConvexHull API for evaluating the convex hull of a set of points and it works well. Given the code below: p1 = points[11] hull = ConvexHull(points) vertices = [points[i] for i in hull.vertices] how can I evaluate the…
Moshe
  • 555
  • 3
  • 14
1
vote
0 answers

how to convert a near orthogonal-edge polygon to a mimum inbounding orthogonal-edge polygon?

Let's consider there is a polygon with near orthogonal edges that is in the range of (70, 89)° or (91, 110)°. We know the sum of angles in a polygon is multiple of 180°. The question is how to convert a polygon with customized shape to a minimum…
Majid Azimi
  • 907
  • 1
  • 11
  • 29
1
vote
0 answers

Is there an function or algorithm to get outermost surface by using information of node & element connectivity?

Is there an function or algorithm to get outermost surface by using information of node & element connectivity? Since the general convex hull algorithm uses only node information, only the triangular surface can be obtained by searching the…
1
vote
2 answers

reduce side-count of a polygon

Suppose we have image of a simple graphic, and we know it is a polygon, slightly distorted. Is there an image processing way to approximate the original parameters of the graphic object? The matrix below was created by code and then reduced in size…
Crowley
  • 2,279
  • 6
  • 22
  • 36
1
vote
1 answer

Multiple convex shape corner connection

I have an immutable array structure holding convex shapes as in the image above (they may vary in size and count, however they are always convex and never overlapping). What I want to do is connect the corners between them that can be connected…
Lorago
  • 161
  • 8
1
vote
1 answer

Algorithm to find a best fit line for set of points using convex hull algorithm

A line is a best fit for a point set S in the plane if it minimizes the sum of the distances between the points in S and the line. Assuming a convex hull algorithm is available, find the best fit line for a given point set S in the plane. This is an…