[cairo] Obtaining two parallel paths from a single curve

Simon Budig simon at budig.de
Tue Jul 29 06:42:27 PDT 2008


archee at 126 (archee at 126.com) wrote:
> Yes, it does work for a simple road. But what if you want to draw two 
> directions of a road? In that case, each direction is actually an independent 
> road but with the same shape.

*If* the two directions are always parallel you could draw a wide line
(maybe also using two strokes for an outline) plus a very thin line
indicating the separation between the two directions.

If this does not fit your problem: Unfortunately it is mathematically
impossible to represent the parallel to a given bezier segment as a
bezier segment, you have to resort back to approximations. There are
solutions for this, you might find example code in inkscape. 

Bye,
        Simon

-- 
              simon at budig.de              http://simon.budig.de/


More information about the cairo mailing list