From: Rick DeNatale on 30 Jul 2010 11:59 I've recently started playing with an Epilog laser cutter, and I find myself wanting to programmatically generate SVG files. I googled for ruby and svg this morning and although there seem to be a few old stagnant efforts, there's nothing too useful I could find. I suppose it wouldn't be too hard to start cooking something up using Jim Wierich's xml builder gem, but before I got started I wanted to see if there was anything I missed. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Github: http://github.com/rubyredrick Twitter: @RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale
From: Glen Holcomb on 30 Jul 2010 12:16 On Fri, Jul 30, 2010 at 9:59 AM, Rick DeNatale <rick.denatale(a)gmail.com>wrote: > I've recently started playing with an Epilog laser cutter, and I find > myself wanting to programmatically generate SVG files. > > I googled for ruby and svg this morning and although there seem to be > a few old stagnant efforts, there's nothing too useful I could find. > > I suppose it wouldn't be too hard to start cooking something up using > Jim Wierich's xml builder gem, but before I got started I wanted to > see if there was anything I missed. > > -- > Rick DeNatale > > Blog: http://talklikeaduck.denhaven2.com/ > Github: http://github.com/rubyredrick > Twitter: @RickDeNatale > WWR: http://www.workingwithrails.com/person/9021-rick-denatale > LinkedIn: http://www.linkedin.com/in/rickdenatale > > I had a similar experience a few months ago. I was looking specifically to generate graphs from log data and found a passable library but I don't think it's still active and it is a bit of a pain. It is working for my very specific and not too important needs, but I'd probably go from scratch if it were important or needed to be flexible. -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I cant hear a word youre saying." -Greg Graffin (Bad Religion)
From: William Rutiser on 30 Jul 2010 14:11 Rick DeNatale wrote: > I've recently started playing with an Epilog laser cutter, and I find > myself wanting to programmatically generate SVG files. > > I googled for ruby and svg this morning and although there seem to be > a few old stagnant efforts, there's nothing too useful I could find. > > I suppose it wouldn't be too hard to start cooking something up using > Jim Wierich's xml builder gem, but before I got started I wanted to > see if there was anything I missed. Topher Cyll's book, "Practical Ruby Projects; Ideas for the Eclectic Programmer", has a chapter that generates animations with SVG. SVG is wrapped in an SVGObject class but it is only developed to the extent needed for the example project. It may give you a start. See http://www.cyll.org/
From: Benoit Daloze on 30 Jul 2010 16:04 On 30 July 2010 17:59:31 UTC+2, Rick DeNatale <rick.denatale(a)gmail.com> wrote: > I've recently started playing with an Epilog laser cutter, and I find > myself wanting to programmatically generate SVG files. > > I googled for ruby and svg this morning and although there seem to be > a few old stagnant efforts, there's nothing too useful I could find. > > I suppose it wouldn't be too hard to start cooking something up using > Jim Wierich's xml builder gem, but before I got started I wanted to > see if there was anything I missed. > > -- > Rick DeNatale > > Blog: http://talklikeaduck.denhaven2.com/ > Github: http://github.com/rubyredrick > Twitter: @RickDeNatale > WWR: http://www.workingwithrails.com/person/9021-rick-denatale > LinkedIn: http://www.linkedin.com/in/rickdenatale > I coded my own SVG class a few years ago: http://github.com/eregon/Classes/blob/master/xml/svg.rb It's basically replacing xml tags by their name (as methods) and using arguments in a better way. SVGPath was a fun try to go further, allowing to build step-by-step a path. I wanted to add animations which could be rendered using either <animate> tags or JS. I would enjoy to improve it and/or collaborate. Please say me if this could be a start for what you are looking for. Regards, B.D.
From: Rick DeNatale on 31 Jul 2010 11:38
On Fri, Jul 30, 2010 at 2:11 PM, William Rutiser <wruyahoo05(a)comcast.net> wrote: > Rick DeNatale wrote: >> >> I've recently started playing with an Epilog laser cutter, and I find >> myself wanting to programmatically generate SVG files. >> >> I googled for ruby and svg this morning and although there seem to be >> a few old stagnant efforts, there's nothing too useful I could find. >> >> I suppose it wouldn't be too hard to start cooking something up using >> Jim Wierich's xml builder gem, but before I got started I wanted to >> see if there was anything I missed. > > Topher Cyll's book, "Practical Ruby Projects; Ideas for the Eclectic > Programmer", has a chapter that generates animations with SVG. > SVG is wrapped in an SVGObject class but it is only developed to the extent > needed for the example project. It may give you a start. > > See http://www.cyll.org/ I've been thinking about this a bit more, and for my purposes, which is having an api to describe a static vector graphic for use with things like laser cutters and other cam-like stuff with takes svg input, that it might be interesting to try to use the same API as Prawn for generating the graphics object model. The graphics models for pdf and svg seem to be quite similar, not surprising given Adobe's major input to SVG. I tend to see both as a declarative expression of the Postscript drawing model, or at least starting there. I notice that there's at least one Prawn svg 'renderer' out there, but it goes in the opposite direction I'm pursuing in that it renders svg into prawn calls, rather than generating SVG from the prawn document model. I haven't investigated any of this really deeply, but it may be possible to write something which extends and reuses most of Prawn but with a different class of Document and some associated classes which render SVG rather than PDF. Perhaps Gregory Brown or one of the other core Prawn contributors will see this and comment? -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Github: http://github.com/rubyredrick Twitter: @RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale |