Skip to main content
Became Hot Network Question
edited tags
Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
edited tags
Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
Changed since not always correct.
Source Link
Teg Louis
  • 74
  • 1
  • 3
  • 23

How to creatively create a random belt polygon or belt polyhedron?

Are there more creative solutions or related illustrations for belt polygons and polyhedrons than what I wrote down below like cvgmt's solution for zonotopes?

A zonogon is a convex polygon that is made up of parallel sides. Generating a random zonogon in Mathematica can be found here. A natural generalization of zonogons is called belt polygons. A belt polygon is a convex polygon that is made up of parallel line segments, but they are not necessarily the same length. I generalized SHuisman's solution to get the Mathematica code below for a random belt polygon (not always correct at making belt polygons):

ClearAll[CreateRandomBeltPolygon]
CreateRandomBeltPolygon[sides_?EvenQ, lendist : {min_, max_}] := 
 Module[{m, angles, dirs, lengths},
  m = sides/2;
  angles = RandomReal[{0, 1}, m];
  angles /= Total[angles]/(Pi);
  angles = Join[angles, angles];
  dirs = Accumulate[angles];
  dirs += RandomReal[{0, 2 Pi}];
  lengths = RandomReal[lendist, 2*m];
  Polygon[Accumulate[MapThread[AngleVector[{#1, #2}] &, {lengths, dirs}]]]
  ]
 Graphics[{EdgeForm[Thick],White,CreateRandomBeltPolygon[6, {0.5, 1}] }, AspectRatio->Automatic]

For example might give:

Belt polygon with 6 sides.

It seems worth having different solutions because it seems typically there are many different ways to approach this same problem, but at the same time all of the approaches are probably valuable.

$\color{magenta}{\star}$ Boltyanski, V., Martini, H., & Soltan, P. S. (1997). [Combinatorial geometry of belt bodies. In Excursions into Combinatorial Geometry (pp. 319–363)]. Springer Berlin Heidelberg. https://doi.org/10.1007/978-3-642-59237-9_7

How to creatively create a random belt polygon or belt polyhedron?

Are there more creative solutions or related illustrations for belt polygons and polyhedrons than what I wrote down below like cvgmt's solution for zonotopes?

A zonogon is a convex polygon that is made up of parallel sides. Generating a random zonogon in Mathematica can be found here. A natural generalization of zonogons is called belt polygons. A belt polygon is a convex polygon that is made up of parallel line segments, but they are not necessarily the same length. I generalized SHuisman's solution to get the Mathematica code below for a random belt polygon (not always correct):

ClearAll[CreateRandomBeltPolygon]
CreateRandomBeltPolygon[sides_?EvenQ, lendist : {min_, max_}] := 
 Module[{m, angles, dirs, lengths},
  m = sides/2;
  angles = RandomReal[{0, 1}, m];
  angles /= Total[angles]/(Pi);
  angles = Join[angles, angles];
  dirs = Accumulate[angles];
  dirs += RandomReal[{0, 2 Pi}];
  lengths = RandomReal[lendist, 2*m];
  Polygon[Accumulate[MapThread[AngleVector[{#1, #2}] &, {lengths, dirs}]]]
  ]
 Graphics[{EdgeForm[Thick],White,CreateRandomBeltPolygon[6, {0.5, 1}] }, AspectRatio->Automatic]

For example might give:

Belt polygon with 6 sides.

It seems worth having different solutions because it seems typically there are many different ways to approach this same problem, but at the same time all of the approaches are probably valuable.

$\color{magenta}{\star}$ Boltyanski, V., Martini, H., & Soltan, P. S. (1997). [Combinatorial geometry of belt bodies. In Excursions into Combinatorial Geometry (pp. 319–363)]. Springer Berlin Heidelberg. https://doi.org/10.1007/978-3-642-59237-9_7

How to create a random belt polygon or belt polyhedron?

A zonogon is a convex polygon that is made up of parallel sides. Generating a random zonogon in Mathematica can be found here. A natural generalization of zonogons is called belt polygons. A belt polygon is a convex polygon that is made up of parallel line segments, but they are not necessarily the same length. I generalized SHuisman's solution to get the Mathematica code below for a random belt polygon (not always correct at making belt polygons):

ClearAll[CreateRandomBeltPolygon]
CreateRandomBeltPolygon[sides_?EvenQ, lendist : {min_, max_}] := 
 Module[{m, angles, dirs, lengths},
  m = sides/2;
  angles = RandomReal[{0, 1}, m];
  angles /= Total[angles]/(Pi);
  angles = Join[angles, angles];
  dirs = Accumulate[angles];
  dirs += RandomReal[{0, 2 Pi}];
  lengths = RandomReal[lendist, 2*m];
  Polygon[Accumulate[MapThread[AngleVector[{#1, #2}] &, {lengths, dirs}]]]
  ]
 Graphics[{EdgeForm[Thick],White,CreateRandomBeltPolygon[6, {0.5, 1}] }, AspectRatio->Automatic]

For example might give:

Belt polygon with 6 sides.

$\color{magenta}{\star}$ Boltyanski, V., Martini, H., & Soltan, P. S. (1997). [Combinatorial geometry of belt bodies. In Excursions into Combinatorial Geometry (pp. 319–363)]. Springer Berlin Heidelberg. https://doi.org/10.1007/978-3-642-59237-9_7

Said the code is not always correct. Now I go to sleep.
Source Link
Teg Louis
  • 74
  • 1
  • 3
  • 23
Loading
Used AspectRatio -> Automatic to make it look like how it is supposed to look.
Source Link
Teg Louis
  • 74
  • 1
  • 3
  • 23
Loading
Source Link
Teg Louis
  • 74
  • 1
  • 3
  • 23
Loading