Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: 1 [2]
Author Topic: Norwegian Pixels Sketch
alpal
Newbie
Posts: 19
Permalink
Post Re: Norwegian Pixels Sketch
on: March 16, 2016, 16:28
Quote

thanks for the code krummrey!! As usual i seam to have a Problem just running the script. I downloaded and installed processing, downloaded adn installed the latest controllerP5 libraries. When i run the SpiralFromImage file i get an error msg. Float k not defined. any ideas?

Image

krummrey
Advanced
Posts: 66
Permalink
Post Re: Norwegian Pixels Sketch
on: March 16, 2016, 16:54
Quote

Sorry, Worked on it from the office. Hopefully fixed now.

MrAlkoFigh-
ter
Newbie
Posts: 3
Permalink
MrAlkoFighter
Post Re: Norwegian Pixels Sketch
on: March 19, 2016, 19:45
Quote

Hello, People.
I'm interested in of how are you coonverting the files with this code.
Whey are all higher than 5 MB and the polargraph controller doesn't load them.

davefromsh-
effield
Newbie
Posts: 12
Permalink
Post Re: Norwegian Pixels Sketch
on: March 24, 2016, 16:29
Quote

Could anybody write just a brief how to for this Please ?
just a few simple steps to get me going.
Thank you
dave

hashampers-
and
Beginner
Posts: 28
Permalink
Post Re: Norwegian Pixels Sketch
on: March 28, 2016, 19:00
Quote

I've had minor success with loading the larger svgs into the controller, by going into inkscape and removing some of the lines around the edge of the svg file to see whether it was a file size issue. I deleted all but a about 10 rings (it's a spiral, I know) and it loaded, so I repeated this and worked my way out by adding further rings and worked out roughly how much the controller could deal with before it fell over. Sorry, I know this isn't particularly scientific or replicable, but it allowed me to get some results. There must be some way of simplifying the SVG file in inkscape by joining/editing the existing paths, but I'm afraid I'm useless with inkscape. You might have to ask Kongorilla, Krummrey or Sandy to explain how they do it.

krummrey
Advanced
Posts: 66
Permalink
Post Re: Norwegian Pixels Sketch
on: March 29, 2016, 11:30
Quote

You can try to export your SVG in Inscape using the "optimized SVG" writer. That will just change semantical stuff, not the paths themselves. I'd assume, that there is a limit at which the controller will stall. Maybe Sandy has more insight on that.
What you can do is lower the number of points by either increasing the distance between the loops or the samplerate at wich it jitters. I have thought about exporting gcode, but then I'd have to figure out the machine specs and stuff.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Norwegian Pixels Sketch
on: March 29, 2016, 17:40
Quote

I think I've handled really big SVGs before (8MB+) of the kind that death-by-sharpie outputs, and there's been no problem. I mean, it was dog slow, and took a long time to load it (a minute or two, even), but it didn't crash or breakdown. Just wasn't nice to use.

In Processing's preferences, you can increase the amount of memory that it allocates to the program, but I don't believe that made much difference for me.

I might be remembering loading the wrong kind of file though. Ha, that's helpful.

sn

hashampers-
and
Beginner
Posts: 28
Permalink
Post Re: Norwegian Pixels Sketch
on: March 30, 2016, 21:25
Quote

I've also managed to load a 6+Mb svg before and it was no problem, but it does seem to be size sensitive with respect to the output to Jan's lovely scripts. Once they get below 3Mb, it seems to be happy for me.

I've downloaded the latest release (thanks!) and you can tell that something is up, as the load vector dialogue box just reverts straight back to load vector, whereas when you are loading massive tsp files from the travelling salesman algorithm output, you can tell that it's churning in the background, and slowing down, but evenutally loads. Are there any errors outputted to a text file anywhere that I can look up and try and see if anything is going amiss?

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Norwegian Pixels Sketch
on: March 30, 2016, 22:34
Quote

No written log files, but any errors will appear in the Processing console (or Ctrl+C) if you're running from compiled version.

hashampers-
and
Beginner
Posts: 28
Permalink
Post Re: Norwegian Pixels Sketch
on: April 26, 2016, 21:56
Quote

I found a way to shrink the outputted svg from Spiral from image. I tweaked parameters in Inkscape for ages, saved optimised svgs, and none of it worked for me. I was getting 4MB+ svgs, and the processing console was giving lots of 'Ignoring <text> and ignoring <comments> messages. I thought that it was to do with the broken curves at the edge of the image, as losing those made the svgs import. So I put a white border around the edge of my image and it imported!

(1) Get the image you want, select all in the image editor of your choice.
(2) Shift-Scale the image down slightly, so there is a white, blank border that surrounds your image.
(3)Save as something different, then import into SpiralfromImage, and run as normal.
(4)Import into inkscape, and clear up the image by removing any stray arcs within the blank zone.
(5) select all, and then go to file > document properties. There should be a tab that says [+] resize page to content. Click this.
(6) Clean up the document, save as an optimized .svg.
(7) Import into the polargraph controller, enjoy.

I've found that you don't lose too much detail this way, and at least it imports. Thanks Krummrey for incredible code and Sandy for the tips.

krummrey
Advanced
Posts: 66
Permalink
Post Re: Norwegian Pixels Sketch
on: May 10, 2016, 15:15
Quote

You can safely remove all the comments. I've put them in there for educational use only. By increasing the distance between the spiral arcs the file length gets a lot shorter.

hashampers-
and
Beginner
Posts: 28
Permalink
Post Re: Norwegian Pixels Sketch
on: May 27, 2016, 09:49
Quote

Sandy,

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: -1
at geomerative.RSVG.getPolyline(RSVG.java:744)
at geomerative.RSVG.elemToPolyline(RSVG.java:609)
at geomerative.RSVG.elemToCompositeShape(RSVG.java:514)
at geomerative.RSVG.toShape(RSVG.java:149)
at geomerative.RG.loadShape(RG.java:244)
at polargraphcontroller.loadShapeFromFile(polargraphcontroller.java:1276)
at polargraphcontroller$6.run(polargraphcontroller.java:1160)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

These are the most common error reports that processing spits out whenever the output of the spiral-to-image script fails to import.

Any ideas?

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Norwegian Pixels Sketch
on: May 27, 2016, 21:59
Quote

It's a bit of a puzzle, but the pertinent line is

at geomerative.RG.loadShape(RG.java:244)
at polargraphcontroller.loadShapeFromFile(polargraphcontroller.java:1276)
at polargraphcontroller$6.run(polargraphcontroller.java:1160)

boiling down (or up) to a call to geomerative's RG.loadShape() method. And there's not much more to see there. The error is bubbling up from inside geomerative.

sn

EATYone
Advanced
Posts: 67
Permalink
Post Re: Norwegian Pixels Sketch
on: July 19, 2016, 15:26
Quote

After some hours for searching a way to open svg created by SpiralFromImage without opening Inkscape or Illustrator, i found a solution... With a text editor i found some negative numbers as coordinate... without those "-" character all is fine now. So to do that i've just edited the svg.PDE file and change :

output.print(x); by output.print(abs(x));

and
output.println(y); by output.println(abs(y));

Secondly, to display the SVG, i've just changed the original code by :

void displaySVG () {
  clearDisplay();
  String svgLocation = outputSVGName;
  outputSVG = loadShape(svgLocation);
  println("loaded SVG: "+ outputSVGName);
  shape(outputSVG, 187, 85, outputSVG.width/2, outputSVG.height/2);
  feedbackText.setText(locImg+" was processed and saved as "+outputSVGName);
  feedbackText.update();
}
EATYone
Advanced
Posts: 67
Permalink
Post Re: Norwegian Pixels Sketch
on: July 19, 2016, 15:32
Quote

Annnnnyway, many thanx for this prog!

EATYone
Advanced
Posts: 67
Permalink
Post Re: Norwegian Pixels Sketch
on: July 19, 2016, 16:39
Quote

Display of svg in the script, and first test on Little A4 paper...
Image
Image

EATYone
Advanced
Posts: 67
Permalink
Post Re: Norwegian Pixels Sketch
on: July 19, 2016, 17:38
Quote

Other problem i'll try to fix. For the moment i can use the soft one time. Have to close it and start it again to achieve a new treatment.

Will comment all my change, and post it

Alexey
Newbie
Posts: 3
Permalink
Post Re: Norwegian Pixels Sketch
on: July 26, 2016, 19:36
Quote

All hello! Prompt me how to draw Norwegian style? that for this purpose is it necessary to do? thank you

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