Creating complex graphic objects
jhurley0305 at sbcglobal.net
Thu Apr 2 16:41:43 CDT 2009
> Message: 8
> Date: Thu, 2 Apr 2009 14:52:04 +0100
> From: David Bovill <david at vaudevillecourt.tv>
> Subject: Creating complex graphic objects
> To: How to use Revolution <use-revolution at lists.runrev.com>
> <c1c5836b0904020652u7308dd7ie2f64073c08aa30 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> I've a couple of shapes that I need to create for an app that lend
> themselves to the use of the graphic control - because I want them at
> various sizes and also because they use "markers" on a graphic
> shape. The
> problems is the complexity of tweaking the points by hand. I know of
> experiments importing geometry from apps like Illustrator - but was
> wandering if anyone has any examples / a library of shapes or
> techniques to
> make this easier?
> For instance the shapes I need are "stars" - that I can dynamically
> By roughly drawing a star and then:
> set the editmode of the selectedobject to "polygon"
> I can tweak the shape manually which helps a lot.
> But when it comes to more complex structures it would be good to
> draw them
> in illustrator and import the geometry.
> For instance - I also want to create circles with variable numbers
> of evenly
> spaced marker points(iIdeally the arcs would have arrows on them to
> a clockwise flow). It would be "nice" not to have to create these
> as images
> at different scales and import them from an external app - but
> AFAIK its not
> really practical at the moment. Any suggestions?
Turtle Graphics is simpler but here is another way:
Use the following script to create a circle:
set the style of the templateGraphic to "line"
if there is no grc "circ" then create grc "circ"
put 100 into tR -- the radius
put 0 into tA -- the angle
put 100 into tNumPoints--or whatever you need for your resolution
put round(360/tNumPoints) into da
put the loc of this card into tLoc
put item 1 of tLoc into x0
put item 2 of tLoc into y0
put tR * cos(tA*pi/180) into x
put tR*sin(tA*pi/180) into y
put round(x0+x) & comma & round(y0+y) & cr after results
add da to tA
set the points of grc "circ" to results
Then take the points of the circle (in the variable results) to
extract say the 10th and 14th points.
Create a new graphic using these two points and set the end arrow to
Do this periodically throughout the repeat loop--every so often pick
a pair of points, create a new grc and set the end arrow to true.
Voila, a circle with arrows.
More information about the use-livecode