How to generate this kind of random curves?

后端 未结 3 1776
被撕碎了的回忆
被撕碎了的回忆 2021-02-03 14:32

Is it possible to generate this kind of random curves?

\"enter

I\'ve tried IMagick

3条回答
  •  清歌不尽
    2021-02-03 15:25

    I bet you could write an algorithm which would basically take x number of random twists before going straight to the exit coordinates. This also assumes that algorithm is smart enough to check the angle of the turn. (assuming you don't want to endup in knot-web)

    However, assuming that this isn't your graduation task or that you are paid on per-hour basis to work on this, this would be a waste of time and success is highly doubtful.

    Even if you'd manage to generate single line algorithm, doing it so that the lines wouldn't come too close to each other is close to impossible. You will end up with something like this: knot-web

提交回复
热议问题