Points of Graphic Oval

Mark Waddingham mark at livecode.com
Wed Aug 2 18:09:37 EDT 2017


File an enhancement - it's not something we have gotten round to doing yet but a 'flattened path' api was always on the cards to do but we hadn't gotten around to it yet.

Warmest Regards,

Mark.

P.S. 'Flattening' is the term used to describe the process of turning paths into sequences of line segments.

Sent from my iPhone

> On 2 Aug 2017, at 23:24, hh via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> I have already done what you describe in a HTML5 standalone for displaying
> progress along a Bezier curve, using LC Script only.
> http://hh.on-rev.com/html5/hhProgressHTML5_2-8.0.2X.html
> 
> And it is done for all LC's SVG icons using the jquery-drawsvg plugin in
> a browser widget (incl. optional affine transformations of the SVG icons).
> http://livecodeshare.runrev.com/stack/833/AutoDraw_SVGicon
> 
> What I meant is to have such a tricky translation of model elements
> (arc, curve etc.) of an SVG path into an appropriate points-only path
> in LCB? Perhaps one could use parts of LC-Ian's SVG work for that?
> 
>> Mark wrote:
>> Heh - sometimes it takes a relative tome of justification to arrive at a
>> simple explanation!
>> 
>> However the beauty of Bézier curves is that arcs are just a small subset
>> of what they can represent 'well enough'.
>> 
>> For moving along an arbitrary (Bézier - you can represent a straight line
>> segment as one trivially) path, what you actually need is first the length
>> of the path (annoyingly not a representable function - iirc) and a parametric
>> form of a Bézier curve (which is how they are best expressed).
>> 
>> Then to step along the path at fixed distance at each step you use
>> f(n * fixeddist / length) (here f is the parametric form of the Bézier
>> - returning a 2d point). You'd need some adjustment (+/- 1 pix) to account
>> for rounding error - but I think the idea is sound.
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list