How to offset a cubic bezier curve?

后端 未结 4 1532
感动是毒
感动是毒 2020-12-01 02:33

I\'m trying to create a \"parrallel\" bezier curve. In my attempts I\'ve gotten close but no cigar. I\'m trying to keep a solid 1px offset between the 2 curves (red,blue).

4条回答
  •  误落风尘
    2020-12-01 02:42

    From wikipedia: ( http://en.wikipedia.org/wiki/B%C3%A9zier_curve )

    The curve at a fixed offset from a given Bézier curve, often called an offset curve (lying "parallel" to the original curve, like the offset between rails in a railroad track), cannot be exactly formed by a Bézier curve (except in some trivial cases). However, there are heuristic methods that usually give an adequate approximation for practical purposes.

    You might also see the paper indicated here: Outline of cubic bezier curve stroke

提交回复
热议问题