Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: Wave lines
ryan13mt
Newbie
Posts: 16
Permalink
Post Wave lines
on: March 12, 2014, 23:56
Quote

Hello everyone. I posted on this forum some time ago. So this is a video i made https://www.dropbox.com/s/04dgx24wxq3fb7r/Horsing%20around.mp4

Now Im using the polargraph for my thesis project. The short idea is that im modulating images into AM, FM and Hybrid modulation and then drawing them with the plotter. Here is an example of the Hybrid modulation.
https://www.dropbox.com/s/6my8dv018cu3ekl/HYBRID_Lisa.png

Now here is the problem i have. These images were done in processing which is the same language Sandy used for the polargraph. Now i can save them as pdf or png from processing. If i save them as pdf it creates a file 19mb large which crashes everything i try to run it on. When saved as png it doesnt seem to let me create a path with it using either illustrator or inkscape. And when saved as svg from inkscape and fed to the controller, it seems to stall the program when loading the svg file.

Any ideas how im going to draw these images? Any way i could draw them on the controller itself then let it do its magic?

Since this is for a thesis it's a bit urgent and i will be most grateful for all replies.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Wave lines
on: March 13, 2014, 22:55
Quote

Hi Ryan, glad to see you back. I can't think of an easy way out of this, a 19mb PDF seems pretty big for vector art though - are you sure it doesn't have a bitmap embedded in it too? SVG is really the only language that the polargraph controller understands. I have opened big SVGs with it before (halftone stuff), and it took 10 minutes or so to actually load it - just appears to hang, but is really working away. But probably not 19mb big, and then it is very very slow once it was loaded. So you could try just leaving it for a while (if you haven't already), and you might be able to at least get a queue built.

In future you'd be able to embed the Polargraph library in your own code and get it to generate command queues directly, but that's not there yet, and I'm sorry to say I'm not going to have time to look at that again until next month at the earliest.

Can you use inkscape to simplify / merge vertices, that kind of thing?

sorry - hopefully someone else has some experience of working with really big vectors.

sn

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: Wave lines
on: March 14, 2014, 03:05
Quote

Could you use this library - http://forum.processing.org/one/topic/pgraphicssvg-a-new-renderer-for-svg-graphics.html - to add the ability to export SVGs directly from your sketch?

I don't know anything about Processing, so that's about all I can contribute in that regard. If you post the PDF, I'll take a look at it and see I can make out.

ryan13mt
Newbie
Posts: 16
Permalink
Post Re: Wave lines
on: March 14, 2014, 13:24
Quote

Thanks for the reply guys. Here is the .pdf export from processing. Better to download it than viewing it online.
https://www.dropbox.com/s/vu7t20n9uyfl354/1.pdf

And here is an .svg i managed to get from inkscape using a hires image outputed from processing.
https://www.dropbox.com/s/bsl2eim1xes497s/3.svg

When put into the polargraph controller it took hours to just load. The queue came to about 350k commands but crashed once i tried to zoom in.

Sandy i was thinking if maybe i could arrange some of your code since you already have some sort of AM-FM in it. Maybe i can assign a sine wave for each greyscale value.

ryan13mt
Newbie
Posts: 16
Permalink
Post Re: Wave lines
on: March 14, 2014, 14:26
Quote

I tried that library kongorilla but after the second line it gets too slow cause it seems to be filling up the memory exponentially.

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: Wave lines
on: March 14, 2014, 23:21
Quote

I get memory errors (as in, running out of) when I try to open the pdf in Inkscape and Illustrator. The svg file contains only an embedded rasterized image of the curves, so that's a dead end.

I can view the pdf fine, though. The curves are very smooth. Are you doing that by plotting hundreds (thousands?) of points along the wave, or just plotting a point at the each crest and trough of amplitude? If it's the former, try plotting points much less often (I'm avoiding the term "frequency"). If it's the latter, try making the points "corner" (sharp) points. I suspect, due to the size of the file and memory issues, that you're plotting thousands of point per curve, though. Have you tried making an image using much fewer waves, just for test purposes?

BTW, consider inverting the values of your input bitmap if you're going to draw using black ink on white paper, unless you want Mona to look like a negative image.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Wave lines
on: March 14, 2014, 23:34
Quote

I think my tests agree with Kong. I opened the pdf in illustrator ok (albeit very slowly), but attempting to save it to an svg just resulted in a sluggish machine after a couple of hours and 12GB of memory used up.

Re-rendering with a coarser waveform would be my recommendation. It's true that the polargraph firmware already has something in it that resembles these waveforms, but that pixel style is very tightly coupled to the native coordinates system of the machine - it would not be at all trivial to modify it to work in cartesian space. And there isn't any waveforming in the controller - it's all done in the firmware. Tinkerlog's Der Kritzler does something like your output.

sn

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Wave lines
on: March 15, 2014, 02:02
Quote

7.2 million lines in the converted SVG, it looks like it plots a series of samples along the x-axis, rather than using splines. The SVG is also 650MB - the controller fails after about 15 minutes of loading with an outofmemoryerror, and inkscape can't load it either!

pittance
Newbie
Posts: 1
Permalink
Post Re: Wave lines
on: April 14, 2014, 20:48
Quote

I made some images using a very similar AM/FM technique (examples: http://www.fastness.co.uk/120812_drawbotRoundup.html) and I had similar problems with image size because I was building a curve with straight lines. I found that you can get quite nice curves using curveVertex, then you only need to specify points at top/bottom peaks of the curve. I have example code here: http://www.fastness.co.uk/files/wave.java - hope that helps...

ryan13mt
Newbie
Posts: 16
Permalink
Post Re: Wave lines
on: April 28, 2014, 16:56
Quote

Hey guys. So the solution i used was to seperate each line and turn it into commands. Then feed the machine line by line. Each line took approximately 20 mins. And after 4 lines i had to leave the machine too cool down a bit cause in the 5th line it usually stopper working. Here is a video of the final drawing if you want to watch it. https://www.youtube.com/watch?v=RNgalSoCd7I

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Wave lines
on: April 28, 2014, 22:43
Quote

Yikes that's a labour of love Ryan - well done 🙂 Looks great!

sn

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.026 seconds.