We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
SVG Import lib (Read 5989 times)
SVG Import lib
Nov 20th, 2005, 5:52am
 
http://www.ghost-hack.com/p5/svgimport


Hey guys. I finally got it to work...

I must say, as someone who has never written anything other than processing apps and simple C++ apps before, it was the must frustrating experience writing a library for processing. I think my next project will be to document the process of making a library so newbies like me can contribute better.

So, back to SVGs.

This library allows you to save paths in illustrator and display them in Processing a'la Manifest (in full color now!)

Much work remains to be done for it to have full compatibility with SVG illustrations, for example... straight lines do not display at the moment. Rectangles do not display at the moment. Ellipses do not dis.. okay you get the point. Only curves/bezier will work. But that is good enough for now.

Please review this so I can make proper adjustments. Thanks for your help guys!
Re: SVG Import lib
Reply #1 - Nov 20th, 2005, 10:22pm
 
Congratulations for releasing this! I suggest making it more obvious that the Library will only work with curves/paths.

Casey

Re: SVG Import lib
Reply #2 - Nov 25th, 2005, 9:05pm
 
Hi, I just played a bit with this one. Good work. A quick request would be, to set the stroke-weight in the svg-object. Obviously you can't use the strokeWeight-fuction in P3D mode. So now you have the choice: detail level or strokeWeight. The other way would be to unse it in openGL-Mode, but this is for some ways sometimes overfashioned.

A future release idea would be to "draw" the objects in a time-floating number: it starts somewhere and then it draws the object along the curve.
Re: SVG Import lib
Reply #3 - Nov 26th, 2005, 10:54am
 
I'm curious why the request for strokeweight info to be stored into the object. Naturally, the thing to do is to strokeWeight() before you draw, much like any custom property of the path (such as stroke color and fill color etc). I don't think it's a good move at the moment though.

As far as your last comment, do you mean using the path as a path for objects to move along? If so, I do plan to release a feature to retrieve any point on any particular curve in your SVG. This would be extremely useful for animators and people dealing with path data.

Thanks for your input.

Casey:
I will make a mod to the site on monday when I'm back from SF. Thanks for the suggestion.
Re: SVG Import lib
Reply #4 - Nov 26th, 2005, 1:28pm
 
mflux wrote on Nov 26th, 2005, 10:54am:
I'm curious why the request for strokeweight info to be stored into the object. Naturally, the thing to do is to strokeWeight() before you draw, much like any custom property of the path (such as stroke color and fill color etc). I don't think it's a good move at the moment though.


Yes, but you can't use strokeWeight with JAVA2D for example. I just thought this could be useful and would be a quick hack to implement into this lib.

Nevertheless. The animation-thing for future releases is really wanted I think.
Re: SVG Import lib
Reply #5 - Dec 18th, 2008, 4:51pm
 
Hi,

I am a beginner and so I apologise about the low level nature of my question.
But I am using processing 0125 and have downloaded the SVG import library above.

However, it says that regarding this line:
 mysvg.draw(LINE_STRIP,35,120);

"No accessible field names LINE_STRIP was found in temporary..."

I'm sure it's me doing something wrong as I noticed that the library was for processing 0097. Does this make a difference.

Thankyou for the library by the way. I can't wait to be able to import illustrator vectors into my sketches.

JHT83
Re: SVG Import lib
Reply #6 - Jun 24th, 2009, 5:17am
 
Is there a possibility to move, let's say an image, along an SVG-Spline, .. .or any other vector format? ...

i looked up the svg-import library, but it looks like it hasn't been added since then....

thanks
dirk
Re: SVG Import lib
Reply #7 - Jun 24th, 2009, 9:34am
 
You can make a shape with Bézier or Curve, then use bezierPoint() or curvePoint() to move something along the shape.
Re: SVG Import lib
Reply #8 - Jun 25th, 2009, 8:53am
 
that would be a possibility...
in my case it would be easier to import some vector made in illustrator...

any idea on that???

Re: SVG Import lib
Reply #9 - Jun 27th, 2009, 4:33pm
 
Maybe you could try with Geomerative:

http://www.ricardmarxer.com/geomerative

It should be simple using RShape's getPoint(float advancement)
Something like:

RShape shp = RG.loadShape("lion.svg");
RPoint p = shp.getPoint(0.3);

And you can even get the rotation at that point using getTangent(float advancement).

RPoint t = shp.getTangent(0.3);
Page Index Toggle Pages: 1