Re: Points of Graphic Oval
Mark thanks for an adventure into the clean air of abstract thought…. "This can be seen from the fact that to compute cos/sin/tan (which are the mathematical primitives in some sense acting here) require a 'taylor' expansion which is an infinite polynomial sequence (with order tending to infinity) which converges to the required value. " That not exactly what I thought, but what I "saw" hence my wonderment about "sides" "at the level of working out what pixels to render it is a polygon." OK I can sleep now… at a virtually visually non-existent segment flatness of .5 pixels I give it a "Bézier existential" rating of "true arc" as HH said… moving the puzzle tile through 360 points over 2 seconds looks as smooth as a real "ball toss" in actual space (true arc) Peace at last BR On 8/2/17, 9:43 AM, "use-livecode on behalf of Mark Waddingham via use-livecode" wrote: 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 ;) ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
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 > 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@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
Haha… Fun of having one of those touch bars on top of the keyboard and sausage-fingers… ->Not a good combo... Mark wrote: I strongly suspect Malte's animationEngine does this 'correctly' for this case as it was designed with this kind of use case in mind. Good thing: Due to the Dual license nature anyone who might want to have a peek can: https://github.com/derbrill/animationEngine Cheers! Malte ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
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. Warmest Regards, Mark. Sent from my iPhone On 2 Aug 2017, at 22:18, hh via use-livecode 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@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
> 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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
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 > 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" behalf of use-livecode@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@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
Bézier curves are a polynomial - usually quadratic (2nd degree) or cubic (3rd degree) but the model extends to arbitrary order. With four cubic Bézier curves (so 8 quadratic) you can make an exceptionally good approximation to an oval - but it is not exact. Indeed (anyone who might have a better memory of this than I, please correct me) from memory, to accurately represent an oval (or arc - any general planar quardratic shape written naturally as a quadratic polynomial in TWO not ONE variable - eg x^2 + y^2 = 0) you would require an infinite single variate polynomial (and I think this would only work for a quadrant too). This can be seen from the fact that to compute cos/sin/tan (which are the mathematical primitives in some sense acting here) require a 'taylor' expansion which is an infinite polynomial sequence (with order tending to infinity) which converges to the required value. Enough abstract math over - here the only 'issue' with the effectivePoints for the purpose described is that it does not take into account radius to adjust the number of generated points - hence the 'too many points at certain sizes' problem. Now this is not an error or bug - I remember Mark (not me!) submitting that PR and reviewing it - what he did was entirely reasonable given that there were no apparent use-cases at the time, and without use-case then you can only make things generally useful, and not specifically useful. (After all 360 is a key number as it is the number of DEGREES in a full circle - so is something which is understandable to most). Indeed, what is actually needed here is to approximate the required arc based on a notion of 'flatness' and 'pixel positioning'. Meaning that you want the line segments to have minimal maximal (that is not a typo a for once!) perpendicular distance from the true curve, and still be large enough to sit at pixel positions so as not to cause jitter (a slightly subjective idea). I strongly suspect Malte's animationEngine does this 'correctly' for this case as it was designed with this kind of use case in mind. Anyway I know this thread has gone on a bit and perhaps the above is not really useful anymore but I thought it (1) might be interesting and (2) might perhaps encourage the more mathematically minded among us (and yes, I have one or two specific people in mind!) to maybe find a spare moment to 'do the math' and write up how it should work. And yes, there are those on the team who probably could - but I think all of us have long sinced 'hung up' our mathematician's cowels and are now focused on more concrete day to day endeavours... However, that focus does perhaps mean we could happily implement whatever correct (relative to this use case - which is probably the singularly most important one!) solutions appear. Warmest Regards, Mark. Sent from my iPhone > On 31 Jul 2017, at 22:23, Bob Sneidar via use-livecode > wrote: > > Both are part of the joke. I shouldn't explain it because that is like > disecting a frog. The frog dies and nobody cares. :-) > > But geometrically in any line there are an infinite number of points, because > a point is an infinitely small coordinate. That's if by point you mean > literally points in the geometrical sense. But if you mean how many pixels on > a given display to create a visually smooth curve, well that is another > matter. And if by points you meant anchors in a vector based drawing program, > why typically 4 points, although 3 will do, I just don't know how perfect the > circle can be and I thing an oval would require 4. > > See? The frog died and nobody cares! > > Bob S > > >>> On Jul 31, 2017, at 08:34 , hh via use-livecode >>> wrote: >>> >>> Bob S. wrote: >>> By strict geometry, an infinite amount. Using Bezier, 4. :-) >> >> Just because I am curious which part of your statement is the joke: >> >> How do you define "strict geometry"? >> And what is an "infinite amount"? > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
Actually you don't see "sides" of a regular 360-gon because the engine uses "trunc()" differing from my "round()" used earlier in this thread. So the approximation using "round" may be better in case you are scaling such points lists. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
> BR wrote: >> HH wrote: >> A circle is, just like a Bezier curve, a mathematical model, for thinking, >> doing mathematics. Not realizable in our virtual world. >> What you can have and what you see are (more or less good) approximations >> to that model, here nothing more than simple polygons. > > But then, as the circle/oval got bigger one would see 360 "sides" but we > don't. > So, how is it a "simple polygon" Create a new stack and an oval (=circle) of radius 68 or larger and get the effective points of it (you need to use LC > 6 for that). Then create a polygon with these points and increase the width and height of that graphic to card's size. Then you'll see the 360 sides ... ... IF, yes IF the width and height of the circle is 136 or larger. ELSE the number of lines of the effective points is less than 360. Probably because Mark is filtering without duplicate lines --- to your advantage in case you are going to move along these points list. on mouseUp if there is no grc "demo1" then create grc "demo1" set style of grc "demo1" to "oval" set width of grc "demo1" to 68 set height of grc "demo1" to 68 set loc of grc "demo1" to the loc of this card if there is no grc "demo2" then create grc "demo2" set style of grc "demo2" to the "Polygon" put the effective points of grc "demo1" into ep put the number of lines of ep set the points of grc "demo2" to ep set loc of grc "demo2" to the loc of this card set width of grc "demo2" to -100+the width of this card set height of grc "demo2" to -100+the height of this card end mouseUp Of course the graphics library increases the number of points to draw an oval whenever the width and height increases, also uses antialiasing to create the "optical illusion" of a circle. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
WHOOPS! I mean none of the lines intersect. Bob S > On Aug 2, 2017, at 08:47 , Bob Sneidar via use-livecode > wrote: > > It's simple because all the angles are obtuse. > > Bob S ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
It's simple because all the angles are obtuse. Bob S > On Aug 2, 2017, at 08:44 , Sannyasin Brahmanathaswami via use-livecode > wrote: > > But then, as the circle/oval got bigger one would see 360 "sides" but we > don't. So, how is it a "simple polygon" ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
HH wrote: A circle is, just like a Bezier curve, a mathematical model, for thinking, doing mathematics. Not realizable in our virtual world. What you can have and what you see are (more or less good) approximations to that model, here nothing more than simple polygons. But then, as the circle/oval got bigger one would see 360 "sides" but we don't. So, how is it a "simple polygon" ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
The effective points of an oval (circle) are the 360 points of a regular polygon with 360 vertices (if it's closed). You could look at stack #2 of the Raspi-Collection, runs on Mac/Win/linux using LC 6/7/8/9: http://forums.livecode.com/viewtopic.php?p=98716#p98716 (in LC 8/9 add a semicolon after "origin" in line 66 of the card script). Change there the number of vertices N to 24,32,64 or 360 and you will understand, why Scott said, a "decent" number is enough. A circle is, just like a Bezier curve, a mathematical model, for thinking, doing mathematics. Not realizable in our virtual world. What you can have and what you see are (more or less good) approximations to that model, here nothing more than simple polygons. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
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" 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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
Both are part of the joke. I shouldn't explain it because that is like disecting a frog. The frog dies and nobody cares. :-) But geometrically in any line there are an infinite number of points, because a point is an infinitely small coordinate. That's if by point you mean literally points in the geometrical sense. But if you mean how many pixels on a given display to create a visually smooth curve, well that is another matter. And if by points you meant anchors in a vector based drawing program, why typically 4 points, although 3 will do, I just don't know how perfect the circle can be and I thing an oval would require 4. See? The frog died and nobody cares! Bob S > On Jul 31, 2017, at 08:34 , hh via use-livecode > wrote: > >> Bob S. wrote: >> By strict geometry, an infinite amount. Using Bezier, 4. :-) > > Just because I am curious which part of your statement is the joke: > > How do you define "strict geometry"? > And what is an "infinite amount"? ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
The obvious method for generating the points of an oval—use a loop that generates sin(x) & cos(x) coördinate-pairs—has already been mentioned. What's *not* so obvious, is that the points generated by that method are not evenly spaced! Not unless you're working with a perfect circle, anyway. For non-circle ovals, the distance between any two consecutive points will rise with the distance between those points and the origin. So if you're using those points in a "move [whatever] to the points of"-type command, the thing you're moving will not move at a constant speed… well, not unless your 'oval' is a circle, in which case the distance to the origin will be constant, hence the resulting speed of motion will also be constant. The closer your 'oval' is to a perfect circle, the less obvious the deviations from constant speed will be, of course. You'll have to decide for yourself whether those deviations are of great-enough magnitude to be worth worrying about. If deviations from constant speed *are* worth worrying about? Depending on what you're actually doing, you may actually want to have the oval-path-constrained motion vary in speed, and the particular mode of variance you end up with may be exactly the mode of variance you get from using the obvious method. But in any other case, you may want to look into a different method for generating the set of oval-points you use. "Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length" Read the webcomic at [ http://www.atarmslength.net ]! If you like "At Arm's Length", support it at [ http://www.patreon.com/DarkwingDude ]. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
> Mark wrote: >> How do you define "strict geometry"? > That would be my seventh-grade math teacher >> And what is an "infinite amount"? > For points in an oval, that would be Aleph-one, no? I see. When you selected to return 360 points for the effective points of an oval (what is, TMHO, a 'natural' choice) you did indeed ask HAL, thinking of aleph1. You couldn't accept the answer. And now Scott has to convince BR that a "decent" number [= trunc(27*pi/2)] of points are usually good enough for "move to " ... ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
On 07/31/2017 08:34 AM, hh via use-livecode wrote: Bob S. wrote: By strict geometry, an infinite amount. Using Bezier, 4. :-) Just because I am curious which part of your statement is the joke: How do you define "strict geometry"? That would be my seventh-grade math teacher And what is an "infinite amount"? For points in an oval, that would be Aleph-one, no? -- Mark Wieder ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
> Bob S. wrote: > By strict geometry, an infinite amount. Using Bezier, 4. :-) Just because I am curious which part of your statement is the joke: How do you define "strict geometry"? And what is an "infinite amount"? ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
On 07/31/2017 07:55 AM, Bob Sneidar via use-livecode wrote: By strict geometry, an infinite amount. Using Bezier, 4. :-) Hey, no fair. Using Bezier curves is cheating. But yeah, thus my rather snarky reply which should have had a smiley thing anyway. When I wrote the effective points code I made ovals have 360 points because that seemed logical. Nobody's complained yet, but I'm guessing that Brahmanathaswami is the first one who's tried this. -- Mark Wieder ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
By strict geometry, an infinite amount. Using Bezier, 4. :-) Bob S > On Jul 30, 2017, at 21:46 , Mark Wieder via use-livecode > wrote: > > On 07/30/2017 09:06 PM, Sannyasin Brahmanathaswami via use-livecode wrote: > >> OK, so how can we generate the points of a perfect oval? > > How many points would you guess are in an oval? > > -- > Mark Wieder ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
Personally I would do something I learnt to do in about 1976 in FORTRAN: make yourself an 800 x 800 stack, and a lineField called "POYNTS", and an irregular polygon called "POLLY" put 0 into KOUNT repeat until KOUNT > 6.29 put (KOUNT * 100) + 1 into LYNE put (400 +((sin(KOUNT))*300)) into LR put (400 +((cos(KOUNT))*300)) into UP put LR,UP into line LYNE of fld "POYNTS" add 0.01 to KOUNT end repeat set the points of grc "POLLY" to the lines of fld "POYNTS" I wrote this "straight off" into the e-mail client without checking it in LC: it SHOULD generate a CIRCLE with points; you can them squish the thing to get the Oval you require. Richmond. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
[Once again, without typos (although it works correctly with the typos)] The following runs in LC 6/7/8/9. ### yields points of an 'elliptical' n0-sided polygon, ### for a 'circular' shape set rx=ry. -- n0 is the number of vertices (= n0+1 points for a closed polygon) -- rx is the horizontal radius -- ry is the vertical radius -- x0 is the horizontal coord of the shape's center -- y0 is the vertical coord of the shape's center function ellipticalPoints n0,rx,ry,x0,y0 put 2*pi/n0 into cn -- n0 vertices --> n0+1 points as we want a closed polygon (start=end) -- This is here true as sin(0)=sin(2*pi) and cos(0)=cos(2*pi) put empty into pts repeat with j= 0 to n0 put CR & (round(rx*sin(j*cn)+x0),round(-ry*cos(j*cn)+y0)) after pts end repeat return char 2 to -1 of pts end ellipticalPoints ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
> BR wrote: > 1) draw graphic oval name: "moveClue1" > 2) create small image "word_1" > move image "word_1" to the points of grc "moveClue1" in 2 seconds > OK, so how can we generate the points of a perfect oval? > > Scott 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 > > a "decent" number of points along the shape of the oval, your image > > will have the appearance of moving along an elliptical path. You don't need to create a graphic for that, a ("decent") list of points is enough: on mouseUp put 200 into x0 put 200 into y0 put 100 into rx put 100 into ry put 36 into n0 #<-- usually enough vertices for 1.5 seconds move image 1 to ellipticalPoints(n0,rx,ry,x0,y0) in 1500 millisecs end mouseUp ### yields points of a elliptical n-sided polygon ### circular: set rx=ry -- n0 is the number of vertices (= n+1 points as closed polygon) -- rx is the horizontal radius -- ry is the vertical radius -- x0 is the x-coord of the center -- y0 is the x-coord of the center function ellipticalPoints n0,rx,ry,x0,y0 put 2*pi/n0 into cn -- n0 vertices --> n0+1 points as we want a 'closed' polygon -- This is here true as sin(0)=sin(2*pi) and cos(0)=cos(2*pi) put empty into pts repeat with j= 0 to n0 put CR & (round(rx*sin(j*cn)+x0),round(-ry*cos(j*cn)+y0)) after pts end repeat return char 2 to -1 of of pts end ellipticalPoints ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
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. Regards, Scott Rossi > On Jul 30, 2017, at 9:06 PM, Sannyasin Brahmanathaswami via use-livecode > wrote: > > 1) draw graphic oval name: "moveClue1" > 2) create small image "word_1" > > move image "word_1" to the points of grc "moveClue1" in 2 seconds > > test: > > point the points of graphic "moveClue1" > > result: empty > > check dictionary: yep, oval are not among the objects with points ☹ > > OK, so how can we generate the points of a perfect oval? > > BR > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Points of Graphic Oval
On 07/30/2017 09:06 PM, Sannyasin Brahmanathaswami via use-livecode wrote: OK, so how can we generate the points of a perfect oval? How many points would you guess are in an oval? -- Mark Wieder ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Points of Graphic Oval
This works great: move image "word_1" to the effective points of grc "moveClue1" in 2 seconds Al ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Points of Graphic Oval
1) draw graphic oval name: "moveClue1" 2) create small image "word_1" move image "word_1" to the points of grc "moveClue1" in 2 seconds test: point the points of graphic "moveClue1" result: empty check dictionary: yep, oval are not among the objects with points ☹ OK, so how can we generate the points of a perfect oval? BR ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode