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

Anton
8-Nov-2008
[1219]
site: http://anton.wildit.net.au/rebol/gfx/
old-file: %intersection-points-of-circle-and-line.r

if exists? cache-file: path-thru site/:old-file [delete cache-file]

if exists? cache-file: path-thru site/(join %demo- old-file) [delete 
cache-file]
Henrik
9-Nov-2008
[1220x2]
Did we ever get a successful SVG -> DRAW shape converter?
I need a basic function to convert a monochrome SVG drawing to SHAPE.
Rebolek
9-Nov-2008
[1222]
Ask Cyphre, he has some converter.
Pekr
9-Nov-2008
[1223]
there were some attempts ... dunno if done by Cyphre or Ashley .... 
one other thing was to be able to replay Flash shapes. Unfortunately 
- there are some differences, e.g. in how gradients are being specified. 
Maybe if we could adapt, we could reuse some Flash stuff? Dunno if 
it would be worth the changes ...
Henrik
9-Nov-2008
[1224]
I don't need gradients.
Pekr
9-Nov-2008
[1225]
That was just an example. If you want to use some existing SVG drawing, 
you surely want the result to be displayed identically, don't you? 
But - I know nothing about it, so let's better wait for what those 
who tried to experiment with SVG conversion will say ...
Henrik
9-Nov-2008
[1226x2]
I may have figured it out.
it works. :-)
Pekr
9-Nov-2008
[1228]
your latest screenshot - is it done in draw manually, or just your 
attempt to convert SVG? :-)
Henrik
9-Nov-2008
[1229x2]
The questionmark is done in Inkscape, and then I copied its path 
description into a small parser made in R3 as a string, which converts 
it to DRAW.
Not optimal, but at least we can allow a bit complicated artwork 
now.
Pekr
9-Nov-2008
[1231]
it's all one drawing? Or is question mark separate object/draw shape, 
which you can e.g. move?
Henrik
9-Nov-2008
[1232]
question mark is a separate shape. the background is pure DRAW.
Pekr
9-Nov-2008
[1233]
... something like make-gobs was - combining multiple separate gobs 
... hmm, in such a case, we can always use separate gobs (draw type 
gobs) and combine them, right?
Henrik
9-Nov-2008
[1234x3]
not necessary. DRAW is powerful enough to handle multiple shapes 
in a fairly simple fashion.
i.e. I don't have to specify the paths inside the DRAW block.
svg-question-mark: to-shape {SVG path}

draw: [
	scale 0.000002 0.000002 ; for required precision
	shape svg-question-mark
]
Pekr
9-Nov-2008
[1237]
that was easy, heh? :-)
Henrik
9-Nov-2008
[1238]
the scaling is the only tricky part. I need to simplify it.
Pekr
9-Nov-2008
[1239]
Is there any conclusion towards draw enhancements/options? You were 
discussing quite usefull additions ...
Henrik
9-Nov-2008
[1240]
none yet.
Pekr
9-Nov-2008
[1241]
Henrik - how complex shapes are we able to transform? My friend uses 
Inkscape to make business card. I wonder if I would be able to get 
it displayed in draw? :-)
Henrik
9-Nov-2008
[1242x2]
Right now: Only one path at a time and it's monochrome. I'm not sure 
which path types are supported. You can't load XML files with it, 
only pure path data.
I will leave it up to someone else to make the rest work. :-) It 
wasn't that hard to get working.
Ashley
9-Nov-2008
[1244]
I had a simple SVG -> Draw script which Shadwolf took and enhanced, 
but it barfed on more complex SVG's due to some inherent limits in 
draw ... Shadwolf can tell you exactly what the issues are. If they've 
already been solved or lessened under v3 then that's great news indeed.
Anton
10-Nov-2008
[1245x3]
Here's a line and ellipse intersection function:
load-thru/update http://anton.wildit.net.au/rebol/gfx/intersection-points-of-line-and-ellipse.r

do-thru/update http://anton.wildit.net.au/rebol/gfx/demo-intersection-points-of-line-and-ellipse.r
It's got some debugging lines still in it, so console will fill up.

The demo also has a problem with control of the ellipse - which turns 
out to be a tough math problem to solve. More difficult than the 
line/ellipse intersection. Maybe it will take me a week to do... 
 but anyway the demo works well enough for now.
Steeve
21-Nov-2008
[1248x14]
i have a question related to the futur draw engine.

will exist a way to capture the current offset inside a draw block 
?
i give an example:
draw [ text ["test" red :off "red text"]]

having the variable off returning the offset between the 2 strings
would be a fantastic feature
i precise: the real offset inside the gob (not the carret)
i'm talking about that because i currently try to do a draw editor 
with R3 (like my old easy-drawer).
but to intercativly move or deform a draw block, i need to construct 
a serie of handles (gobs) at some calculated points. and so it's 
currently a tragedy to have to simulate the draw engine to get th
... to get th
... to get these coordinates.
i don't know if i'm clear....
in fact it would be the same feature than in parsing
offset: (to get the cur
...the current offset)
a set-word!
another question: in the current alpha, the matrix command seems 
not working like anounced in the wiki, is it normal ?
Henrik
22-Nov-2008
[1262]
Steeve, if you can make some examples with the matrix command, we 
can make an entry in the bug tracker.
Steeve
24-Nov-2008
[1263]
i have no examples, it doesn't work at all
Henrik
25-Nov-2008
[1264x2]
Steeve, can you try it also in the public R3 release?
Sorry, it seems that you are.
shadwolf
4-Jan-2009
[1266x3]
well My svg engine is working and got trouble only with matrix calulations 
due to an odd bug in the adapted version. Next i don't like the way 
my SVG works  I wish to be able to do it  in plain parse way (My 
method in not really elegant but it works fine  in most cases SVG 
is an XML file so the XML data is converted to REBOL  objects using 
parse and then i process those objects to convert into draw/Agg instructions). 
That was the fastest way i found at that time since what was important 
to me was the result not the beauty of the processing way.
to tell you the truth parse gives me powerfull head haches  ^^ so 
if i can't use it I don't use it ... I know that's bad !!
http://shadwolf.free.fr/svg-demo-shad06.ris the lastest version 
of my SVG engine. Well in fact parse gives me head haches only when 
i have to parse XML  datas ...