r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[AGG] to discus new Rebol/View with AGG

Oldes
5-Mar-2007
[940]
this code draws nothing: 
view layout [
	box 400x400 effect [draw [
		rotate -90
		fill-pen red    arc 200x200 90x90 0   108 closed
		fill-pen green  arc 200x200 90x90 108 252 closed
	]]
]
Rebolek
5-Mar-2007
[941]
use 'transform instead. you need center point woith rotation and 
it's not clear where it is with 'rotate keyword (0x0 probably?)
Oldes
5-Mar-2007
[942x2]
never mind, I already used my rebol/flash dialect to make the chart. 
I just wanted to say, that there is probably a bug, because this 
is working:
view layout [
	box 400x400 effect [draw [
		rotate 15
		fill-pen red    arc 200x200 90x90 0   108 closed
		fill-pen green  arc 200x200 90x90 108 252 closed
	]]
]
Ach... ok my fault - the center point is in zero - that's why it 
was not visible - so it's probably not a bug
Rebolek
5-Mar-2007
[944]
that's what I wrote :)
Oldes
6-Mar-2007
[945]
I was just looking for some Rebol/draw (agg) manual and found this 
interesting project made using AGG (not Rebol related) http://www.contextfreeart.org/gallery/
Steeve
6-Mar-2007
[946x5]
what about a library of draw snipsets handled by rebol.org ?
they could be indexed like scripts, with keywords and other usefull 
tricks
so we could download them into draw tools using rebservices
we could think too about a standardized form for draw animations
yes we should...
Sunanda
7-Mar-2007
[951]
90+% of what you need to do that, Steeve, is already in the Library:

[1] we could (in minutes) add extra valid domains or types so a script 
could be categorised as draw-snippet


[2] the LIbrary doesn't use rebservices for an API. It has an API 
called LDS that predates rebservices (basically, the library team 
got there first). You can use it to download any script (among other 
things too)

http://www.rebol.org/cgi-bin/cgiwrap/rebol/documentation.r?script=lds-local.r#toc-50


[3] using LS to download a snippet every time it is needed would 
be slow and wasteful.....But you could easily write get-draw-snippet 
that caches results locally.
****

That would not be perfect as it would be good to have a page/pages 
showing the images the snippets produce. But if there were enough 
snippets, we could add that.....And, before we do someone else could 
beat us to it on their own website -- they could use LDS to get all 
the snippets and display the images. It'd be a neat bit of Community 
interaction.

====> Perhaps switch to Library for any detailed discussion.
Maxim
7-Mar-2007
[952]
Steve, I am about to release in the next few weeks a dataflow draw 
engine called glob.  its allows selectable layers of assembled draw 
blocks, can VERY easily animate too.
Jean-François
11-Apr-2007
[953x2]
Oldes, I also love that app.
Contextfreeart. I always thought it wouldn't be that hard for one 
of you guys to implement it in Rebol/AGG.
Cyphre
11-Apr-2007
[955]
Yep, I wanted to make Contextfree parser  in Rebol couple of years 
ago but still don't get to it. Anyway it would be a nice PARSE/DRAW 
exercise :)
Dockimbel
20-May-2007
[956x3]
In the new DRAW/AGG dialect, it seems that the 'reset-matrix command 
just don't work with 'matrix or 'translate. I've tried the examples 
from TRANSLATE command found in the online DRAW documentation, the 
2nd and 3rd examples are supposed to reset the translation, it just 
don't work (unless I've missed something obvious). Tested with View 
1.3.2.3.1 and View 2.7.5.3.1. Examples URL: http://www.rebol.com/docs/draw-ref.html#section-3.33
Whatever method I use in my DRAW code, I keep having the cumulative 
effect on TRANSLATE (and also on MATRIX).
BTW, I'm working on a DRAW-based visual CAPTCHA for web forms. I 
guess that if these commands are buggy, I'll have to  do it the old-fashion 
way, making all the calculations in REBOL (instead of letting DRAW 
do the maths).
Steeve
20-May-2007
[959]
use PUSH command instead
Anton
21-May-2007
[960]
Oldes, ContextFreeArt is nice.
Dockimbel
21-May-2007
[961]
PUSH is used the 3rd example I was refering to and doesn't work too, 
TRANSLATE still cumulates.
Cyphre
21-May-2007
[962x4]
Dockimbel: the examples you are refering to are working OK. Notice 
the beginnign coordinate of third box. I think this is what confused 
you.
(ie the third box 'offset' starts at 100x100 so after reset-matrix 
it is at 150x150)
To clarify it have a look at result this example:

view layout [
	box 600x400 effect [
		draw [ 
			fill-pen blue box 50x50 150x150
			translate 50x50 fill-pen red box 50x50 150x150
			reset-matrix
			translate 70x70 fill-pen yellow box 0x0 100x100
		]
		draw [
			translate 200x0 
			fill-pen blue box 50x50 150x150
			translate 50x50 fill-pen red box 50x50 150x150
			translate 70x70 fill-pen yellow box 0x0 100x100
		]
	]
]
The same is for the PUSH variant. Let me know if you have any other 
questions regarding this.
Dockimbel
21-May-2007
[966]
Thanks Cyphre, I was hoping I missed something ! You're right your 
example is working ok. The example in the doc was really confusing.
Cyphre
21-May-2007
[967]
Yes, the example is a bit confusing :) I hope we will have better 
DRAW docs for R3.
Dockimbel
21-May-2007
[968x4]
The following code crashes View 2.7.5.3.1 :
view layout [
	box effect [
		draw [
		    pen black red
		    push [shape [move 0x0 line 50x50]]
		]
	]
]
If you comment the 'red argument, it behaves normally.
I'm posting it to RAMBO.
Henrik
21-May-2007
[972x3]
dockimbel: http://usb.brando.com.hk/prod_detail.php?prod_id=00286
<--- related?
oops, wrong link
http://www.rebol.net/cgi-bin/rambo.r?id=4086&
Dockimbel
21-May-2007
[975]
Look similar, seems that the 2nd argument for PEN  triggers the crash.
Rebolek
21-May-2007
[976]
This is known bug, it's already in RAMBO - http://www.rebol.net/cgi-bin/rambo.r?id=4040&
Gabriele
21-May-2007
[977]
bug has been fixed for 2.7.6 (will be released shortly)
Dockimbel
21-May-2007
[978]
That's good news
ICarii
30-May-2007
[979]
Is the AGG implementation capable of drawing filled donuts such as 
the third example in - http://www.w3.org/TR/SVG/painting.html#FillProperties
Geomol
31-May-2007
[980]
view layout [box 400x400 white effect [draw [pen none fill-pen red 
shape [move 100x100 arc 300x300 90 false true arc 100x100 90 false 
true move 150x150 arc 250x250 60 true true arc 150x150 60 true true]]]]


When I run this code under OS X, REBOL/View version 2.7.5, I get 
the effect. I find, that some of the parameters isn't logic. The 
documentation is ambigious, http://www.rebol.com/docs/draw-ref.html#section-5, 
so it may change.
ICarii
31-May-2007
[981x4]
hmm thanks - i often find issues between the docs and the actual 
builds with argument order
in the following example what does the 90 refer to??
shape [move 0x0 arc 200x200 90 false true]
ive experimented with various values and don't have a clue - please 
enlighten me :)
Geomol
31-May-2007
[985]
I guess, Cyphre is the one to ask.
ICarii
31-May-2007
[986x2]
lol - i tried values from 40 - 100 - all the same result :)
hmm.. well 60 - 100 for the outer ring, 40 - 70 for the inner ring
Geomol
31-May-2007
[988]
Maybe this give a clue?

view layout [b: box 400x400 white effect [draw [shape [move 0x200 
arc 90 200x400 false true]]] at 300x20 slider [b/effect/draw/shape/arc: 
to-integer value * 360 show b]]
Gregg
31-May-2007
[989]
From Cyphre:


Yes, the DRAW dialect  has FILL-RULE keyword which should work the 
same as described in the svg documentation. And yes, we need to improve 
the documentation and maybe even change the arc syntax. Any feedback 
on this is welcome.


BTW the ARC shape command should work according the http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands