Points of Graphic Oval
mark at livecode.com
Wed Aug 2 16:44:17 EDT 2017
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.
Sent from my iPhone
On 2 Aug 2017, at 22:18, hh via use-livecode <use-livecode at lists.runrev.com> wrote:
>> Mark wrote:
>> So, at the level of the graphic object it is a true arc, at the level of instructing
>> the graphics library it is a Bézier approximation but at the level of working out what
>> pixels to render it is a polygon.
> Thanks for arriving from your previous post at this very clear statement.
> You will have to do a lot of such approximations by simple polygons when you implement
> to move along an SVG path for your SVG widget... ;-)
> p.s. The 360 points of Mark are really good enough for very large circles in order to
> move along such points in 2 seconds. These are 3 points per tick!
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode