Questions tagged [polygons]
The polygons tag has no usage guidance.
88
questions
62
votes
3answers
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 ...
48
votes
6answers
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:
...
29
votes
5answers
3k views
Rounding the Corners of a Shape
I was wondering whether there is an option in Mathematica that enables me to smooth the corners of a shape. The example I want to start with is the pentagon.
This can be crudely specified as
...
27
votes
2answers
954 views
Filling Space with Pursuit Polygons
I want to make a program which can fill a 2D space with "pursuit polygons".
The following picture will help you understand better what I mean.
You can also look up "pursuit curves" or mice problem or ...
19
votes
3answers
1k views
Pentagonal spiral in Mathematica
I would like to plot an image of what I call a pentagonal spiral with Mathematica. A sample image of what I'd like to obtain is this (sorry for low-quality):
My initial idea was to get some kind of ...
16
votes
1answer
294 views
What is a robust way to determine if two polygons overlap? Possible bug in RegionIntersection or Area
When trying to determine if two polygon objects overlap, I think the intuitive way to do this would be to use the RegionIntersection function to find the ...
15
votes
3answers
942 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 ...
14
votes
1answer
514 views
How could I perform Region or Polygon Clipping in mathematica?
I need to clip several regions reg: like Rectangle, Polygon, Ellipse...
My goal isn't to plot the clipping but to have a representation of each new region.
I searched if there was any package or ...
13
votes
2answers
617 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
...
12
votes
2answers
272 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
...
11
votes
4answers
180 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 ...
10
votes
3answers
290 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 ...
10
votes
2answers
367 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
...
9
votes
2answers
356 views
Plot polygonal surface
I have a list of 120 elements of the form $\{q,x,y,z\}$. In fact, each element of the represents the nuclear charge and 3 coordinates of an atom of some large molecule.
...
9
votes
2answers
472 views
Area of Self-Intersecting Polygon with Repeated Vertices
So Mathematica uses an even-odd rule for self-intersecting polygons, both when rendering them and when calculating their area:
...
8
votes
3answers
956 views
Polygon mesh: Compute vertex normals for smooth shading
MeshRegion has a "SmoothShading" PlotTheme which automatically computes the ...
8
votes
2answers
345 views
How to create a mesh of convex polygons (of maximal size) from a boundary mesh region
I can create a boundary mesh region that consists of a rectangular region with two independently-rotated pentagonal regions excluded using the following code:
...
8
votes
2answers
244 views
Problem with Graphics`PolygonUtils`PolygonCombine
Writing:
Normal@ParametricPlot[{x, x^2 t}, {x, 0, 2}, {t, 0, 1}] /.
p : {__Polygon} :> Graphics`PolygonUtils`PolygonCombine[p]
I get:
but if I write:
...
8
votes
1answer
228 views
8
votes
2answers
211 views
8
votes
0answers
69 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?
...
7
votes
1answer
902 views
Geographics: Can I get a US Map silhouette without the Great Lakes?
I'd like to get a nice silhouette of the land area of the US lower 48 states using Mathematica's GeoGraphics method. I tried:
...
7
votes
1answer
515 views
How to make sure polygon is drawn flat in 3D?
Bug introduced in 8.0 or earlier and fixed in 10.4
I'm working on this SE question about pentagrams on top of dodecahedron for exercising. Both solutions are basically connecting different sets of ...
7
votes
3answers
359 views
PDF export of polygons: How to get rid of polygon boundary lines?
I have the following polygon:
generated using this code (extracted from my previous question):
...
7
votes
1answer
224 views
6
votes
3answers
1k views
Polygons crash kernel?
Having some problems Generating random Polygons and then filtering by Area, specifically filter out degenerated polygons with ...
6
votes
2answers
218 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 :
...
5
votes
1answer
170 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
...
5
votes
3answers
244 views
Graphics option to suppress lines between adjoining polygons
In 10.3.1 there was a Graphics option -- it might be a sub-option of Method -- which erases the thin line visible at the join ...
5
votes
2answers
325 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 ...
5
votes
3answers
269 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]:
...
5
votes
1answer
215 views
RegionIntersection fails for some values with polygons
Bug introduced in 10.1 and fixed in 10.3.0
I want to find the intersection (region) of 2 polygons. I use RegionInstersection but it only works for some sizes, for ...
5
votes
1answer
335 views
Finding non-collinear vertices of a convex hull
I'm fairly new to Mathematica (and programming in general tbh) and need this for a math project I'm working on.
I generate large collections of (rational, 2d) points and need to find which of these ...
4
votes
3answers
225 views
Generate the complement of the Earth's land mass polygons
I would like to get polygon covering of all water area of earth. I though of doing by inverting
Polygon[EntityClass["Country", "LandMasses"]]
How do i invert ...
4
votes
3answers
557 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 ...
4
votes
3answers
663 views
How to color the edges of a triangle?
I'd like to draw a triangle (given the side lengths) with the sides colored separately.
I tried
...
4
votes
1answer
179 views
Others problems with Graphics`PolygonUtils`PolygonCombine
As a continuation of this question, writing:
...
4
votes
1answer
257 views
How to draw a generic 3D closed shape to be analyzed in AceFEM?
I would like to draw a 3D shape to test my AceGen procedure. I will insert the AceFEM part of my code. In this example, I have performed the analysis on a hexahedron element.
...
4
votes
2answers
180 views
Create a square polygon that can be used as the base of a pyramid
For example I want to use the design generated by this code as the base of a pyramid as well as other iterations of the design
...
4
votes
1answer
821 views
Finding area of intersection regions
I want to be able to find the area of the intersection between a hexagon and a slice. I have tried RegionMeasure or Area but I ...
4
votes
1answer
121 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 ...
4
votes
0answers
115 views
When Graphics3D renders a Polygon with non planar points, how does it triangulate to two separate polygons?
If we try to make a Polygon with nonplanar points, the documentation says
Non-planar polygons are accepted in Graphics3D and ...
3
votes
3answers
1k views
intersection between polygon. Algorithm to check it [closed]
I'm working on an algorithm which should check if two polygons, described by their vertex coordinates, are: one inside the other, are intersecting or are separated
image below describe this three ...
3
votes
2answers
519 views
Connecting the points surrounding the adjacent polygons
I'm trying to connect the points surrounding the adjacent polygons. I know how to find the adjacent polygons on a Voronoi mesh. However, I'm unable to adjacent of the adjacent polygons.
What I'm ...
3
votes
2answers
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 ...
3
votes
1answer
145 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 - ...
3
votes
1answer
192 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 ...
3
votes
1answer
329 views
How to display a GeoTIFF raster in GeoGraphics?
I have a GeoTIFF raster file which I would like to display superimposed on a map in GeoGraphics and combine it with other GeoListPlot graphics.
Since I know the corners of the GeoTIFF raster, I am ...
3
votes
0answers
53 views
Graphics3D plot Polygon (Joined Table) gets different results with and without decimal point
Without decimal point
...
2
votes
3answers
682 views
Is it possible to draw a hollow circle using polygon?
The question is simple. I have the following commands
...