Drawing a curved shape - 2nd attempt

Richard Gaskin ambassador at fourthworld.com
Mon Feb 2 11:08:25 EST 2009

Graham Samuel wrote:
> Yes, but as the originator of this thread, what I'm after is drawing a  
> curve from within a Rev-based standalone based on data which the  
> program is handling, either generated by the program or input by the  
> user, and then let the user print it out at full resolution. I would  
> not want to licence Flash to get this functionality.

Understood.  Jim Hurley replied to your post; my reply was to Andrew's.

Jim's Bezier control is an amazing piece of work, worth considering for 
some applications.  Being limited to Rev's graphic object primitives, it 
won't print with the smoothness of a true Bezier, but may be helpful for 
other some apps needing only screen display.

To clarify, I didn't mention Flex as the sole answer to this question 
(and didn't mention Flash at all; don't much care for Flash myself).  I 
brought it up because it serves two purposes which may be useful here:

1. Those needing to ship vector-intensive apps right now may find Flex a 
satisfying solution for the moment.

2. Driven by a very-high-level scripting language, the properties and 
methods governing the Bezier objects in Flex may provide helpful 
guidance for crafting a similar object in Rev.

Flex is quite rich.  There may be much there worth borrowing from as we 
consider ways to enhance Rev.

> It does seem a perfectly reasonable idea - even a simplified system
> which restricts the kind of curves you can draw would be better
> than nothing. I had assumed that Rev had the ability to draw
> vector-based curves via script but I couldn't find out how to do
> it, therefore I started this thread. I didn't expect the answer
> to be "you can't".

One of the challenges with any sole-source proprietary technology is 
what to do when you hit a wall, when you find yourself with a need 
that's neither addressed in the engine nor can be worked around 
gracefully using combinations of existing engine-based primitives. 
Beziers are such a case.

In such cases, the options are:

- Submit a request and wait for its implementation.
   You could add your votes for this one here:

- Accept a compromise in your app's design and use a workaround,
   such as the nifty scripting Jim Hurley contributed.

- Use another tool.

If there's a fourth option I've overlooked please help me out.

> Incidentally, what is the graphic style 'curve' actually for? I can't  
> work out from the docs what visible properties it bestows on the  
> graphic.

The "curve" style in Rev is misnomer held over from the HyperCard 

In HC, curve meant simply "freehand", meaning that you can move the 
mouse wherever you like to make a line and it'll draw your points 
accordingly. Since Rev also supports vector graphics, this was 
translated to its graphic object styles without enhancement, so that it 
draws a polygon with multiple points reflecting the path of the mouse. 
But each point is just like any other polygon point, lacking the 
metadata and UI to make the vertices behave like what might be a true 
"curve" in other drawing programs, a Bezier.

For some uses the "arc" graphic style may be helpful, and they print 
quite nicely.  But without rotation even grouping sets of arcs together 
will be a limited solution.

  Richard Gaskin
  Fourth World
  Revolution training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com

More information about the Use-livecode mailing list