Difference between revisions of "PathEstimation"

From Inkscape Wiki
Jump to navigation Jump to search
m
m (Reverted edits by Od4Btx (Talk); changed back to last version by GigaClon)
 
Line 34: Line 34:
http://www.inkscape.org/magnethead/sample_path/05.5_offsetpath_scalebotch.jpg
http://www.inkscape.org/magnethead/sample_path/05.5_offsetpath_scalebotch.jpg


And here we show an offset path of 5, making a larger shape.
And here we show an offset path of +5, making a larger shape.


http://www.inkscape.org/magnethead/sample_path/06_offsetpath_plus5.jpg
http://www.inkscape.org/magnethead/sample_path/06_offsetpath_plus5.jpg

Latest revision as of 15:46, 20 April 2007

This feature discusses two utility functions that would be central to any Inkscape user's workflow. The ability to outline a selected path or shape, along with offsetting those same shapes provides a simple way for illustrators to edit and create new art very rapidly.

  • Outline Stroke

We begin with a simple path containing a single corner, and a single curve.

http://www.inkscape.org/magnethead/sample_path/01_basepath.jpg

Then we select a stroke for this path: 32 pixels here.

http://www.inkscape.org/magnethead/sample_path/02_strokedpath.jpg

Choosing a menu item "Outline Stroke" results in a new filled shape ( filled with the previous stroke color ) representing the path visually using a bezier shape.

http://www.inkscape.org/magnethead/sample_path/03_outlinedpath.jpg

Here we can see the new path with a stroke of black and a fill of white.

http://www.inkscape.org/magnethead/sample_path/04_outlinedpath_withstroke.jpg


  • Offset Path

Offsetting a path works much like a centrally anchored scale operation, except it will scale away from the control nodes that the base shape is made of. Here we show an offset of -5, making a smaller path within the existing shape. ( Using a simple scale would have caused overlap )

http://www.inkscape.org/magnethead/sample_path/05_offsetpath_minus5.jpg

  • Is there a well-known algorithm for offsetting arbitrary shapes? If not, I've played a bit with beziers in KSEG [1] and I think I found an algorithm that offsets an arbitrary convex bezier acceptably well. If anyone is interested I can post details. -- bb

Here we show the result of attempting a simple scale to achieve this effect:

http://www.inkscape.org/magnethead/sample_path/05.5_offsetpath_scalebotch.jpg

And here we show an offset path of +5, making a larger shape.

http://www.inkscape.org/magnethead/sample_path/06_offsetpath_plus5.jpg

  • I'd be interested in any code or algorithms that show how to create a bezier path that is offset from another bezier path by an arbitrary amount. TIA. -- gwk