Home > Flex, Math, Portfolio > Arrowed Arcs in Freehand Drawing Library

Arrowed Arcs in Freehand Drawing Library

January 31, 2012

As promised, arrowed (quadratic) arcs are now in the Freehand Drawing Library.  They use the same two-point stroke as arrowed lines, but a different drawing engine.  Since three points are required to draw a quadratic arc, the free constraint is automatically computed based on a curvature parameter and a multiplier of the segment length between the two endpoints.  The curvature parameter controls whether the curve is concave upward or downward and the multiplier controls the overall general curvature (i.e. smaller values produce overall flatter curves).

A screen shot is provided below.

Start and end arrows are optional, so the ArrowedArc engine offers a back-door to creating simple quadratic arcs.

Lines and arcs use the same stroke, i.e.

import net.algorithmist.freehand.twopoint.TwoPoint;

private var __stroke:TwoPoint = new TwoPoint();

Simply inject the desired stroke engine,

__data.drawingEngine = “net.algorithmist.freehand.engine.ArrowedArc”;

__stroke.data = __data;

Then, draw and have fun.  I have not yet coded arc decorators, so only solid-line arcs may be drawn with the current beta.

I’ll add one more stroke to the library before RC1 and hopefully blog about it some time next week.  Thanks for your inquiries to date!

%d bloggers like this: