Points of Graphic Oval

Mark Waddingham mark at livecode.com
Wed Aug 2 15:43:02 EDT 2017


A general arc (which an oval is an example of) is represented in LiveCode like elsewhere as a maximum of four cubic Bézier curves.

These Bézier curves are then flattened to polynomials relative to a notion of 'flatness' - which means that the you iterate (using the de Casteljeu method) until you reach a point that the maximum perpendicular distance that the curve lies from the line segment (imagine drawing lines at 90deg up from the line to hit the arc - you are looking for the longest or equal, which always exists). 

Basically if you set flatness to be 0.5 pixels then the human eye cannot distinguish the difference (when taking into account the visual quantisation that occurs - resolution of the screen and antialiasing more than makes up for it).

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.

Whether that means the engine works in true ovals or not, I'll leave to whatever existential proclivities you hold ;)

Warmest Regards,

Mark.

Sent from my iPhone

> On 2 Aug 2017, at 05:51, Sannyasin Brahmanathaswami via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Sequently found "effectivePoints" and used that and it works fine on Mobile.
> 
> But this thread became something more, it became about generating a polygon object that "looks like" an oval. 
> 
> But is an oval such an object at all?
> 
> Mark Wieder via use-livecode" <use-livecode-bounces at lists.runrev.com on behalf of use-livecode at lists.runrev.com> wrote:
> 
>    How many points would you guess are in an oval?
> 
> BR Ahhh, programmatically perhaps it has no "points" as such… being a single continuous line shaped only by its changing arc-radius values.?
> i.e.  a mystic conundrum: "infinite number of points and not points at all"
> 
> SCOTT  Rossi wrote:
> 
> You can use the effectivePoints to get the points of any graphic shape, but depending on the size, your oval may produce too many points.
> 
> In any event, your source oval doesn't need to be perfect. If you reference a "decent" number of points along the shape of the oval, your image will have the appearance of moving along an elliptical path.
> 
> 
> BR: But using "The effectivePoints" seems to work as if there were no points (as such), but only a contiguous line… 
> 
> Which takes us back to Marks first question…"how many points in an oval"   which I will re cast as: 
> 
> At the depths of the LC engine imaging algorithms… is a circle or oval made up of points at all?
> 
> br
> 
> 
> 
> 
> 
> _______________________________________________
> 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