Difference between revisions of "PathEstimation"

From Inkscape Wiki
Jump to navigation Jump to search
(algorithm for offsetting beziers?)
 
m (Reverted edits by Od4Btx (Talk); changed back to last version by GigaClon)
 
(3 intermediate revisions by 2 users not shown)
Line 28: Line 28:
http://www.inkscape.org/magnethead/sample_path/05_offsetpath_minus5.jpg
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 [http://www.mit.edu/~ibaran/kseg.html] and I think I found an algorithm that offsets an arbitrary convex bezier acceptably well. If anyone is interested I can post details. -- bb
* Is there a well-known algorithm for offsetting arbitrary shapes? If not, I've played a bit with beziers in KSEG [http://www.mit.edu/~ibaran/kseg.html] 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:
Here we show the result of attempting a simple scale to achieve this effect:
Line 37: Line 37:


http://www.inkscape.org/magnethead/sample_path/06_offsetpath_plus5.jpg
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
[[Category:Wiki Attic]]

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