# Questions tagged [polygons]

The tag has no usage guidance.

96 questions
Filter by
Sorted by
Tagged with
6k views

### How can we make publication-quality PlotMarkers without version 10?

Suppose that for certain reasons we are not yet using Mathematica version 10, or we have a version with buggy PlotMarkers. It is well known that the default markers ...
33 views

### Finding the shared edged between two polygons

Imagine I have two convex polygons pol1 and pol2 with a shared edge. Take, as an example, ...
61 views

### Inner polygon approximation

Suppose you want to perform an inner approximation of a planar semialgebraic set by a finite set of polygons. The following is a quick way to yield an approximation but I am not convinced that it is ...
55 views

### On the geometric transformations of polygons

Each starry set has the following property: ...
261 views

### On the ordering of the vertices of a polygon

Writing: pts = {{1, 0}, {2, 0}, {2, 3}, {3, 3}, {3, 4}, {0, 4}, {0, 3}, {1, 3}, {1, 0}}; Graphics[{Red, Point[pts], Blue, Line[pts]}] we get: and all of this ...
366 views

### Efficiently compute Minkowski sum of a 2D Region and a Disc of radius r?

Given a 2D Mathematica Region, e.g. A = Region[RegionDifference[Disk[{0, 0}, 2], Disk[{2, 0}, 1]]], how can I grow the region by an arbitrary radius r? For example, ...
213 views

### Programming twisted pyramids based on polygon spirals

I'm interested in polygonal spirals and after reading Filling Space with Pursuit Polygons, I was curious if I could extend the program to create twisted pyramids as 3D-objects. My goal is something ...
82 views

### Fix (decompose) Degenerate Polygon (vertex coincides with edge)

The code Polygon[{{0,0},{3,0},{3,3},{1,3},{1,1},{2,2},{2,1},{0,1}}] produces, according to Mathematica, a disconnected polygon with 0 area. The vertex ...
22 views

### How to find points within a polygon region [duplicate]

I have a set of points, and a polygon region, I was wondering how can I used RegionMemmber to find the points that are within or outside the region? like their exact coordinates
44 views

### Failed to compute the area of a polygon or to use a polygon as a region of NMaximize function

I have a polygon generated by some data. Sometimes, I cannot compute the area of some of the generated polygons and I cannot correctly apply function NMaxmize on ...
58 views

### Exact symbolic area of an intersection of two regular pentagons with parameters

The question of finding the area of intwrsection of two regions with parameters has been answered here using and RegionIntersection with delimeter ...
188 views

### Exact symbolic area of an intersection of two polygons with parameters

On the one hand, can handle expressions which include parameters, including polygons, for example: Area[Polygon[{{1, 2}, {-1, 1}, {2, 5}, {1, a}}]] returns ...
170 views

### How to create a simple polygon

I am trying to create a simple (with no self-intersections) polygon having four given points as vertices, for example to calculate its perimeter later. However, it seems there is nothing for this ...
23 views

### Problem NIntegrating over 3D Polygon region with 4 points

I am trying to NIntegrate a non-planar polygonal region defined by 4 points, something like this: ...
194 views

### Polygon with an extended Boundary

I have a (not necessarily convex) Polygon, and want to create another Region that can be seen as an extended boundary of the ...
225 views

### How does CirclePoints function actually work when drawing a polygon?

By reading that CirclePoints gives the positions of n points equally spaced around the unit circle, I understood that : ...
8k views

### Filling a polygon with a pattern of insets

I am trying to fill a shape with diagonal lines. I am aware of Texture, but it rasterizes the fill pattern, which is not desirable. Here was my crack at it: ...
1k views

### Rounding an Irregular Polygon

Consider a random irregular convex polygon, for example, the 6-side polygon I want to define a function that, given a certain parameter r (roundness), rounds each ...
676 views

### A Smooth and Round Voronoi Mesh

I want the edges of a VoronoiMesh to be smooth and round. I have found the following code from this answer ...
43 views

### PolygonCoordinates extract the submits in the “wrong” order

I don't understand why, in the example below, PolygonCoordinates seems unable to correctly extract the summits of a rectangle in the "right" order so we can ...
348 views

### How to draw the outline of an icon made of several polygons?

I have an icon defined like that: speakerIcon = Graphics[{ Triangle[{{0, -1}, {1,1},{-1,1}}], Rectangle[{-1, -1},{1, 0}] }, ImageSize->20] I can ...
57 views

### Workaround for Opacity + Magnify bug in version 12?

Is there a workaround for the following bug in version 12.0.0. This is in MacOSX. ...
82 views

### Order of PolygonCoordinates[] is undefined in Mathematica 12?

Probably I am missing something fundamental. I try to get a polygon's ordered coordinates, but PolygonCoordinates[] yields something pretty unordered. Am I missing some essential function? ...
127 views

### Speed-up calculation of Area of Polygons

I have a complicated polygon in the 2d plane, that is an RegionIntersection of RegionUnion of triangles. Finally, I want to ...
200 views

### Parametric equation of rolling polygon (cyclogon)

Abraham Gadalla tried (but failed) to post the following question. Why does the red point not continue to follow the square (and the curve) for the full range $0\le x\le 2\pi$? ...
204 views

### Point lattice leading to triangle lattice

My main purpose is to eventually generate a triangle lattice from one original point, let's say the origin. So I want to start with the origin and generate 6 points around it, which are the vertices ...
52 views

### Deforming a unit square into a cylinder [duplicate]

I am new to Mathematica and I am trying to create a flat unit square in the x-z plane made out of polygons with vertices that divide it into equal-length intervals on each side. Then manipulate this ...
89 views

### Combining MeshRegions of generated 3D shapes and RandomPolygons

I am interested in generating 3D a joint BoundaryMeshRegion or a MeshRegion from different shapes and polygons. This works for <...
100 views

### Discrete Sum of Function over a Region

I might have completely missed something in my search. I want to discretely sum over a function, $f(x_i,y_j)$ multiplied by some other function $g$ over a general region $S$. \sum_{(x,y)\in S}f(x,...
1k views

### Polygons crash kernel?

Having some problems Generating random Polygons and then filtering by Area, specifically filter out degenerated polygons with ...
97 views

### How to remove unwanted lines in Graphics3D [duplicate]

When I run the following code: ...
311 views

### RegionMember[ ] in polygon

Bug introduced in 10.0 and fixed in 12.0. I am seeing a difference in RegionMember[ ] testing a point inside a 3-vertex polygon and testing a point inside a more ...
327 views

### Creating a MeshRegion object from a Graphics object

I am looking to convert a simple Graphics object that is defined by overlapping polygons into a MeshRegion object. For example, here is code that will create three overlapping triangles ...
67 views

### Problem defining a polygon

I have two polygons that are very similar as: ...
167 views

### Area of Generalized Koch Snowflake

I asked on the Math Stack Exchange here how I could find the area of a "generalized Koch snowflake". An $n$th generalized Koch snowflake, in my case, is formed almost the same as the Koch snowflake - ...
274 views

### Unexpected behavior of the procedure Area on the object 'Polygon'

Bug introduced in 11.3 or earlier and fixed on 12.0. Sometimes get a results, sometimes left unevaluated. For instance ...
310 views

### How to get size of each polygon of a Voronoi diagram using Shoelace formula?

The following code gets all vertices of all polygons (mesh cells) of VoronoiMesh[pts]: ...
761 views

### Is it possible to draw a hollow circle using polygon?

The question is simple. I have the following commands ...
2k views

### Calculate the total length of line segments within polygon

So we have a polygon with N vertices located on grid. All vertices are located at the intersection of cells (so their coordinates are integers). The objective is to calculate the total length of line ...
104 views

Is there a nice way I can find all possible triangulations (or quadrangulations) of a polygon (say 10-gon)? I want to have all possible diagrams with the diagonals marked (i.e. with unique name). ...
233 views

### Detect and fix invalid polygon

I have a polygon given by ...
187 views

### Others problems with GraphicsPolygonUtilsPolygonCombine

As a continuation of this question, writing: ...
248 views

### Problem with GraphicsPolygonUtilsPolygonCombine

Writing: Normal@ParametricPlot[{x, x^2 t}, {x, 0, 2}, {t, 0, 1}] /. p : {__Polygon} :> GraphicsPolygonUtilsPolygonCombine[p] I get: but if I write: ...
664 views

### How can I get the vertices of each polygon of a Voronoi diagram?

For the following image; How can I get the vertices (which are highlighted by orange dots) of each Voronoi polygon of the following Voronoi diagram? The picture is from the Internet. It is just for ...
245 views

### Getting random points on a mesh region

So I have a region defined by a MeshRegion,like ...
393 views

### How can I build a 3D slab of hexagons or a thick hexagon mesh?

So I tried this code for 2D, but I would like to have say a slab with a defined thickness The code for 2D is ...
120 views

### Graphics3D ignores EdgeForm

Works great: Graphics[{FaceForm[White], EdgeForm[AbsoluteThickness[10]], Polygon[{{0, 0}, {1, 0}, {0, 1}}]}] Ignores color and thickness: ...
214 views

### Manipulate a polygon

I am an absolute beginner in Mathematica. For a small test project, I am supposed to change the following code such that the corners of the polygon {0, 0, 0}, {1, 1, 1}, {0, 1, 0}, {1, 0, 1} can be ...