SVG rendering

i’m looking for a method to render 2D vector data in vvvv. the most interesting format is svg as the title says…

looking at the text plugin, it seems to me that the text is rendered as a texture internally, so i’m wondering if the same technique could be applied to shapes too.

any advice, pointing me to c# libs or similar would be much appreciated. my googleling didn’t bring up too much info on that matter…

cheers, chris

try these excellent svg nodes done by defetto…

big up to defetto!

best regards,
(also) chris

thanx but thats the other way…i dont wanna generate SVG but load svgs and render them in a efficient way…

svg’s can contain bezier curve information and that’s the interesting part.

im currently working on this.
right now its ok when using a shape with 4 anchorpoints but it needs some more math to generate nice uv-coordinates.
textures arent lookin very well when im importing shapes with very spiky angles.

anyway, if you dont need the generated shape for showing textures i can upload my testmodules later this evening

alex.

yep that would be most interesting…

oh, sorry. got it all twisted…

thanks m4d! i always thought no one noticed those nice svg exporters ;) cheers

just found some interesting things regarding this topic. first, this problem seems to trouble a few ppl and none has solved it completely yet.

there is a library with some examples which compile fine…after some trouble. at least i can render an svg to png now. but the lib doesn’t understand all svg specs.

SVG Rendering Engine

and an interesting application of the lib…
Link

@defetto: oh yeah, they’re awesome. with these i could even get my gf to use vvvv :) (she does print, so she was very delighted to have vector graphics as an output path)

@wirmachenbunt: sorry, did’nt mean to spam your thread ;)

i have also spent a couple hours with importing svg or any vector format for use with the Box2D nodes, but the document structure is hard for me to handle in vvvv, so i will make a flash based parser in a week or two, it will simply spit out vertices in a Box2D way.

maybe you want to try this and report your findings…

far from complete - implements basic geometry parsing as line, polygon, polyline, path, missing rectangle, circle, ellipse.

no animations, no fancy color stuff, nada
but does read bezier info, so might be interesting

SVGReader.dll (28.7 kB)

mmm its not doing anything with the svg files i have…

plz check tty error or post the svg, so i can debug

hey woei,
great , but for me it only works with .svg generated in illustrator
(i think cs4)
not with inkscape-svg (standard-svg as well as inkscape-svg)

is it possible to rewrite the plugin in a way i get the coordinates of edge-points and anchor-points?

because in vvvv i want to create a grid out of these control-points

@chris: my svg-import-module is so buggy iam still fixing…

but via skype we can talk about it…

.alex.
@ woei : the attached svg doesnt work

@ defetto: thx again great svvg exporter, so many nice works…

testshape024_F_cc_8anc.svg (832 Bytes)

still a good example of 2D vector rendering, i love this demo
video

@h: i’ll dive into that. the syntax of inkscape-svgs is slightly different. getting the shape should be do-able.
though i doubt i’ll start implementing transforms in the near future.

the edge and anchor point way of output is a nice thought, but how to handle lines, which are not cubic bezier curves? inside the path element there are other definitions possible.
still think, that a general rasterization of curves is a better use for a plugin, since its hard to do modulewise.

just did some research on the “ewigkeit schmerzt” demo and they convert the SVG’s to meshes just before the demos starts. seeing the demo the first time, i thought: wow, someone managed to do 2D vector rendering in realtime with “infinite” resolution on curves. well, its business as usual.

svg to meshes is definetely more efficient than loading the svg points into vvvv. i stick to that for now…

@woei:
not cubic bezier curves are indicated by a L or l . if you have a straight line you can output anchorpoint with (0,0)(->relative) or with the absolute position of the belonging edge-point.

the rasterization of the shape is possible (see attached node) but it needs some clever math the generate nice uv-coordinates (see here(sorry german) or maybe here(sorry german again))

oops. here the file.

i made it for vectorbased-projection calibration so its only working with 4 edge points…

and the patch is not cleaned ;)

beziershape.rar (9.9 kB)

besides straight lines there’s also quadric bezier and elliptic arc implementation, which in that case would have to be converted to cubic bezier representation…
anyways, let’s discuss these details on skype. there might also be a nicer solution for your projection calibration ;)