views:

27

answers:

1

Hi!

I'm trying to make a plug-in for Inkscape for cnc machining.

And I need to make Bezier offset function.

Inkscape operates with cubic Beziers.

So here's what I've done.

  1. Offset of a single segment.

  2. Join of a two offseted segments.

  3. Splitting by intersection points of the offsetted curve.

And I've stopped at clipping.

My plug-in is not a realtime application, so execution time is not the main parameter.

I've done basic clipping procedure. For all splitted subcurves that have more than one segment I can say for sure if this subcurve belongs to final offset by checking the distance between it's middle control point original curve.

But if subcurve has less than two segments the problem appears.

Offset of cubic Bezier curve can not be expressed as a cubic Bezier so we can only approximate it by several cubic Bezier segments. And this approximation will be accurate only at start and end points of each segment.

I can not imagine appropriate criteria for clipping procedure.

Any ideas?

Thanks in advance and pardon my English :).

A: 

See http://stackoverflow.com/questions/408457/outline-of-cubic-bezier-curve-stroke/408491#408491 and http://stackoverflow.com/questions/3205819/bezier-path-widening/3220819#3220819

lhf
Thanks! But they have not solved the problem I've mentioned. I've already have done the offset or outline, and now I need to write a clipping procedure which they do not use.
Nick