alt text

I do not know how to correctly call this task. Just can not imagine what it is attributed. To graphs or to the packaging of rectangles.

Related algorithms for packing rectangles pack them turning only 90 degrees. And here the points can be located anywhere, as well as the angle of the optimal packaging.

  • Points connected: the nearest to the nearest. That is, it is not a line. There may be branches.
  • The distance between the points can be made uniform. That is always 10 px. It can also be assumed that there can be only 8. (top, right-top, right, right-bottom, bottom, left-bottom, left, left-top) directions (this is for those cases if the algorithm is based on a matrix, a simple 32x32 map , 64x64).
  • It is highly desirable to be able to set the intervals at which the rectangle is to be stirred.

If there is an implementation in C / C ++ somewhere, then this is just great.

Neural networks here can not help?

  • one
    Find the curve line removed from the river for the desired number of pixels, and draw a curved inscription (letter by letter) along this line. It seems not difficult. - Egor Skriptunoff
  • 2
    And what is the optimal position? Without a formal definition, it is not clear what to do. - VladD
  • I still do not really understand. In the atlases where the usual maps, there for roads, rivers, manually the name is placed in a suitable place? Well, maybe this: Sort segments in directions. How many dots of a given segment are in a row with the same direction. And get the starting point of this segment. But in such cases, if the points form an arc or a circle, then the optimal place cannot be obtained. Although .. @Egor Skriptunoff Apply text letter by letter around each point forming an arc can be interesting. Need to think. - manking
  • one
    @manking: maybe try this: 1. build a river neighborhood (10 px?) 2. for each point of the neighborhood (with some steps) try to place the text starting from this point. since the river can curl along a sinusoid, the direction of the "derivative" will not help us, we must go through all possible angles. 3. from all possible positions, choose the one that (1) does not intersect the neighborhood, (2) has the smallest total distance from it 4. from all points choose those where the total distance is the smallest. - VladD
  • + th issue design - Zowie

1 answer 1

From the comment by @VladD :

You can try this:

  1. Building a river (10 px?)

  2. For each point of the neighborhood (with a certain step) we try to place the text, starting from this point. Since the river can curl along a sinusoid, the direction of the "derivative" will not help us, we must go through all possible angles.

  3. From all possible positions, choose the one that (1) does not intersect a neighborhood and (2) has the smallest total distance from it

  4. From all points choose those where the total removal is the smallest.