How to create an internal spiral for a polygon?

For any shape, how can I create a spiral inside it of a similar shape. It would be a similar idea to limit (using the Minkowski sum). Instead of creating the same form inside the form, although it would be a spiral of the same shape.

I found this - http://www.cis.upenn.edu/~cis110/13su/lectures/Spiral.java

It creates a spiral based on the parameters passed, so it can be for any regular shape.

I want the above for all shapes, for example, irregular polygons.

I am not very familiar with geometric terminology, but I searched for Involutes and the internal spiral search algorithm too, but was not useful to me.

Does anyone know where I will find an algorithm like this or at least ideas about how I came up with one of them?

+3
source share
2 answers

this task is extremely difficult to do.

  • you must have a boundary polygon that you want to fill with a spiral

    I think you already have

  • create a new smaller polygon by moving all the lines inward to the step.

    This is like creating a dash line around a polygon. The pitch is the width of the screw, so at the beginning of the polygon it is 0 , and at the end it is d

  • remove invalid rows from newly created screw

    Some lines at the corners and curvature will intersect. It is very difficult to detect / recover reliably after seeing

  • repeat (make the next screw) ... until a place for the screw is found

    But now, after the first screw, the step is always d , this will not necessarily fill the entire form. For example, if you have a thinner spot on the figure, it will fill up much faster than the rest, so some holes may still remain.

    You must discover them and process, as you see, see

    Know that detection, if the area is full, is also not trivial

Here's what this approach looks like:

overview

[Note]

If you forget about the spiral and want to fill the interior with a zigzag or similar pattern, then this is not so difficult.

Spiral filling creates a lot of difficult geometric problems, and if you do not know geometry and vector math, this task can be too difficult for a beginner or even an average skilled programmer in this field to make it work correctly. This is at least my opinion (as I did before), so treat it as such.

+2
source

I worked on something similar, using offsets from polgyon based on the medial axis of the Voronoi diagram. It is not simple. I can’t share the code, because it belongs to the company I worked for and may not meet your needs.

But here are some similar things I found by other people:

http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf

http://www.cosy.sbg.ac.at/~held/teaching/seminar/seminar_2010-11/hsm.pdf

0
source

Source: https://habr.com/ru/post/1246258/


All Articles