Questions tagged [polygons]

Polygons are multi-sided objects. This heading should be used when describing issues involving multiple polygons and how they relate to each other, for example, overlap detection.

Polygons are multi-sided objects. This heading should be used when describing issues involving multiple polygons and how they relate to each other, for example, overlap detection.

474 questions
7
votes
2 answers

Produce PDF files, draw polygons with rounded corners

What's the right tool for the job if I want to write a Python script that produces vector graphics in PDF format? In particular, I need to draw filled polygons with rounded corners (i.e., plane figures that are composed of straight lines and…
Jukka Suomela
  • 12,070
  • 6
  • 40
  • 46
7
votes
3 answers

"snapping" polygons together

I have a set of polygons representing administrative districts. The districts were digitized by hand, and there are small spaces between polygons where the polygons should be touching. There are probably also overlapping polygons. How can I have…
zoo
  • 1,901
  • 1
  • 17
  • 25
7
votes
2 answers

Android OpenGL ES - How to draw a filled concave Polygon?

I am creating a 2D Openstreetmap rendering application for Android using OpenGL ES. Unfortunately I am struggling with drawing concave polygons consisting of approximately 50 or more points. In order to accomplish that my polygons are filled, I am…
Philipp Jahoda
  • 50,880
  • 24
  • 180
  • 187
7
votes
4 answers

Detecting clusters of white pixels in an image using openCV

Input Image: Expected Output: I intend to fit three (or some number of) polygons (for this case, rectangles) to signify the "big" white blobs in this image. The rectangles drawn in the output image are as per my perception of the white regions. I…
The mach
  • 101
  • 1
  • 1
  • 3
7
votes
4 answers

Intersection of polygons

There are two polygons given. how can one determine whether one polygon is inside, outside or intersecting the other polygon? Polygons can be Concave or convex.
akash
  • 1,801
  • 7
  • 24
  • 42
6
votes
1 answer

Splitting a rectangular image to polygons to simulate Breaking glass

I am working on some C# code in which I would like to take a 2D rectangle and split it to smaller 2D polygons. I would like the effect to look like the rectangle was made of glass and it was hit with a hammer in a random spot. I was wondering if…
Jeff Lundstrom
  • 1,043
  • 1
  • 8
  • 22
6
votes
2 answers

Editable Polygons in Mapbox

I'm using the mapbox-gl-js library trying to implement a function where the user can add polygons to a mapbox map and edit them if desired. I've been able to add the polygon to the map by adding a layer, but I don't know how to allow users to edit…
user1916817
  • 73
  • 1
  • 8
6
votes
2 answers

How can I create a Polygon with a hole inside in Google Static Maps API?

When I try to create an outer polygon with a hole inside with Static Maps API, the fill color fills the inner polygon, and I see no parameters to draw this. This is how it looks: this is the request:…
Soldeplata Saketos
  • 3,212
  • 1
  • 25
  • 38
6
votes
1 answer

Good algorithm for drawing solid 2-dimensional polygons?

What is the simplest (and easiest, although that's subjective) algorithm for drawing solid (as in a single, solid color--no texture mapping) 2D polygons in memory? What is the most efficient method? I am not interested in using the GPU or any…
Sydius
  • 13,567
  • 17
  • 59
  • 76
6
votes
0 answers

Merge / Dissolve small polygons by size using R

I converted a raster with 4 classes to a SpatialPolygonsDataFrame, where the features representing a class are not always connected. I used disaggregate (package sp) to get single features. I now want to get rid of all those features, smaller than…
Blake
  • 101
  • 1
  • 4
6
votes
1 answer

Generating indexes for triangular mesh for sphere object in openGL Java

Can someone please explain how the indices are generated for triangular mesh? The programme generated array of vertices for sphere object, and indices are generated to be drawn using glDrawElements method. I don't understand how those indices…
user2070333
  • 335
  • 2
  • 11
6
votes
3 answers

How to simplify a single complex UIBezierPath polygon in iOS

Problem: I have a user generated polygon (via registering user's touches on screen) which can be simple or complex (complex means having unknown number of intersections) and I want to have a simple polygon resulting from the same points on the…
M. Porooshani
  • 1,797
  • 5
  • 34
  • 42
6
votes
2 answers

Algorithm for the decomposition of polygons

Does anyone know a relatively fast algorithm for decomposing a set of polygons into their distinct overlapping and non-overlapping regions, i.e. Given a set of n polygons, find all the distinct regions among them? For instance, the input would be 4…
6
votes
2 answers

Convert SpatialPointsDataframe to SpatialPolygons in R

I have a SpatialPointsDataFrame in R that looks like this: coordinates id order hole piece group box_id 326 (-94.4, 27.6586) 47 1 FALSE 1 47.1 1 327 (-93.64, 27.6232) 47 2 FALSE 1 47.1 1 328…
user3306720
  • 93
  • 1
  • 1
  • 5
6
votes
2 answers

Is there a case where the perimeter of a convex poly is greater than the perimeter of its bounding box?

I know that the area of the polygon is always smaller than the area of its bounding box, but can it have a greater perimeter than the perimeter of its bounding box?
1 2
3
31 32