I've run into a little problem.

Post questions on how to use or achieve an effect in Inkscape.
User avatar
TKR101010
Posts: 37
Joined: Wed Apr 22, 2009 6:07 am
Location: Denver, CO, USA

I've run into a little problem.

Postby TKR101010 » Tue Feb 08, 2011 2:14 pm

I'm working on a file using different colored rectangles, stacked brick-like, that form a map (specifically I'm trying to duplicate the map of China from the video game Romance of the Three Kingdoms XI). So far the file contains a bit over 22000 rectangles in 24 layers (one layer per terrain type). Every once in a while I export to .png to keep a record of my progress and make update posts on the forum I'll eventually post the finished picture on. Here's my last successful export ...
Image
Anyway, I've run into a problem where Inkscape no longer wants to export the file to .png. It starts the export, but before it finishes I keep getting a message that says "Microsoft VIsual C++ Runtime Library - This application has requested the Runtime to terminate it in an unusual way. Please contact the application support team for more information." Is there a limit to the number of objects one can have in a file or something that could be causing this? The file is expected to have nearly 40000 rectangles in order to finish the project.

chriswww
Posts: 383
Joined: Fri Nov 19, 2010 3:04 pm

Re: I've run into a little problem.

Postby chriswww » Tue Feb 08, 2011 6:31 pm

as a temporary workaround..have you tried imagemagick to convert svg to png?

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: I've run into a little problem.

Postby druban » Wed Feb 09, 2011 3:35 am

Out of curiosity, why are you using vectors for this project? Does each rectangle have a stroke? If not,I think I would use a raster program with bicubic interpolation turned off in the preferences. It would be just as scalable, I think, and vastly simpler to manipulate...
Of course I don't know all the uses you plan to put it to...
Your mind is what you think it is.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: I've run into a little problem.

Postby brynn » Wed Feb 09, 2011 5:31 am

I can't answer whether there's a limit to number of objects for export. But you could test that theory by converting like rectangles to paths, and then combine the paths. I'm not positive, but I think that would make each block of like-colored rectangles, one object. It would greatly reduce the number of objects. At least you could do this for the solid colored rectangles.

Looks like a fun project! I enjoy doing tedious kind of geometric images like this. Hhmmm.....you may have inspired me to do something like this.... I've had in mind to do something like 1px by 1px squares, and simulate raster graphics with Inkscape. Sort of like....oh gee, what's that called, pointilism? Or something like that, when the artist paints tiny dots? Oh yes, here: http://en.wikipedia.org/wiki/Pointillism

chriswww
Posts: 383
Joined: Fri Nov 19, 2010 3:04 pm

Re: I've run into a little problem.

Postby chriswww » Thu Feb 10, 2011 8:47 am

also, if you intend to stick with svg, the complexity might mandate/imply command line or programmatic handling of svg creation and manipulation. in other words, it might be generally getting beyond typical GUI program capability...which happens in all sorts of things, and not just inkscape. it might be even easier (in theory) to create the layout in some simple datastructure file, and use a script to generate the svg etc. Then you could use a svg viewer to check results, without resorting to inkscape with much bigger/complex footprint.

User avatar
TKR101010
Posts: 37
Joined: Wed Apr 22, 2009 6:07 am
Location: Denver, CO, USA

Re: I've run into a little problem.

Postby TKR101010 » Thu Feb 10, 2011 3:04 pm

druban wrote:Out of curiosity, why are you using vectors for this project? Does each rectangle have a stroke?
I'm using Inkscape because I find the objects easy to manipulate, especially with the crtl-shift-a alignment functions. I've used Inkscape to make boards and pieces for shogi variants like this one ...

and then used Inkscape to move the pieces and keep track of board positions for email games. I plan on making the map available on some Three Kingdoms forums for keeping track of games (besides the terrain squares there'll also be objects for armies, city developments, etc.)
At the moment each rectangle is just a simple rectangle created with the :tool_rectangle: tool, with rounded corners.
chriswww wrote:as a temporary workaround..have you tried imagemagick to convert svg to png?
I hadn't, but I have now. Unfortunately the program stops working when I try to load the svg file. :(
brynn wrote:But you could test that theory by converting like rectangles to paths, and then combine the paths. I'm not positive, but I think that would make each block of like-colored rectangles, one object. It would greatly reduce the number of objects. At least you could do this for the solid colored rectangles.
Good idea. I have tried that now. THAT does work, BUT if I do that in the file I'm working on to make the map then I can't select an individual rect to align use the align tool with :( What I'll have to do is just stop making .png exports until I get the whole thing done, then do the convert and unify process and export the final png.
brynn wrote:Looks like a fun project! I enjoy doing tedious kind of geometric images like this.
Yeah, I often reflect on how there's things I love to do that other people probably look at and wonder "how the heck could anyone ever actually enjoy anything to tedious?" Glad to see there's at least one other person out there that enjoys things like that. :)
brynn wrote:Hhmmm.....you may have inspired me to do something like this.... I've had in mind to do something like 1px by 1px squares, and simulate raster graphics with Inkscape. Sort of like....oh gee, what's that called, pointilism?
Cool :) Make sure to send me a pm when you post something about it so that I don't miss the thread. I want to check it out.

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: I've run into a little problem.

Postby Xav » Thu Feb 10, 2011 5:57 pm

You might also want to try exporting a custom area in order to split the image into several smaller images for export, then stitching them back together using a raster graphics program.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: I've run into a little problem.

Postby druban » Fri Feb 11, 2011 2:59 am

At the moment each rectangle is just a simple rectangle created with the tool, with rounded corners
besides the terrain squares there'll also be objects for armies, city developments, etc.

OK, the rounded corners and the other objects takes the raster option off the table.
I am guessing that the rounded corners are also what is adding a significant burden to your rendering process. Roughly speaking, 22000 rounded rectangles might be about the same load as about 100,000 unrounded rectangles. You can try (in a test copy of your svg) selecting all your rectangles and in the control bar of the rectangle tool click on the remove rounding button. Save it under a test name. Then see how an export goes.
Also try removing definitions just to see if that reduces your filesize although export should not really be affected by this....
Off topic:
That is an impressive number of pieces in the shogi game. Is this variant shogi played on a go board?

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: I've run into a little problem.

Postby brynn » Fri Feb 11, 2011 5:12 am

THAT does work, BUT if I do that in the file I'm working on to make the map then I can't select an individual rect to align use the align tool with

I'm not sure I clearly understand what you're doing, with the game and all. But for making the map, can't you align the individual rectangles while they are rectangles or 4-node paths -- then once you finish a block of a color, then combine paths?

If you're saying that you move them around later, then yeah, combining will make alignment more difficult. But what about using Break Apart, to return them to individual 4-node paths? Then align, then recombine. And for another idea, what about, instead of using Align and Distribute dialog, you use snapping to do the aligning? There are at least a couple of ways I can think to do that, depending on your personal preference and workflow. But you could snap cusp (corner) nodes, or bounding boxes, you could use guides too....there are several possibilities. Or I think you might even be able to use a grid, and snap to grid -- although I do understand that your pattern is like bricks, rather than like a checkerboard. I'd have to do some experimenting with your file, but it looks just by "eyeballing" that every 2 lines would snap to a grid.

Does this help?

User avatar
TKR101010
Posts: 37
Joined: Wed Apr 22, 2009 6:07 am
Location: Denver, CO, USA

Re: I've run into a little problem.

Postby TKR101010 » Fri Feb 11, 2011 4:19 pm

druban wrote:You can try (in a test copy of your svg) selecting all your rectangles and in the control bar of the rectangle tool click on the remove rounding button. Save it under a test name. Then see how an export goes.
Well, it rendered more of the image when taking off the corners, but Inkscape still stops working and crashes. :( I'm hoping to keep the rounded corners anyway as that's how they are in the game ... Image
druban wrote:Also try removing definitions just to see if that reduces your filesize although export should not really be affected by this....
"removing definitions" What do you mean by that?
druban wrote:
Off topic:
That is an impressive number of pieces in the shogi game. Is this variant shogi played on a go board?
That variant, Ko Shogi, is played on a Go board. It's kind of a combination of Go (size of the board), Xiang Qi (pieces placed on the points rather than in the squares), and Shogi. You think that one has a lot of pieces, take a look at this ... (That's a 36x36 board, with each player starting with 402 pieces). Ko is the largest variant I've played so far.
brynn wrote:But for making the map, can't you align the individual rectangles while they are rectangles or 4-node paths -- then once you finish a block of a color, then combine paths?
Well, see the problem is that I'm not doing all of one block of color, and then moving on to the next. I'm following the landmass in the game doing line by line (but not all the way cross the full map each line, just across the current piece of land between "unselectable spots" which don't show their outline rect in the game, like the mountains and hills in the picture above). So I'm doing multiple terrain types at a time. A the current stage of the map I'm pretty much past that and going back to fill in the "unselectable spots", but using the rects I've put down previously to align with.
brynn wrote:If you're saying that you move them around later, then yeah, combining will make alignment more difficult.
Later on the rectangles won't get moved around any more, but counters representing armies, city developments, etc will get moved/placed and I thought it'd be handy to keep using the align function for that too.
brynn wrote:And for another idea, what about, instead of using Align and Distribute dialog, you use snapping to do the aligning? Does this help?
I haven't messed around much with the snapping, but I'll give that a try.


Return to “Help with using Inkscape”