MoI discussion forum
MoI discussion forum

Full Version: page margins for export

From: pressure (PEER)
26 Jan 2023   [#1]
Hello,

Is there a way to set page margins when saving as SVG? It looks like the default is 12 pt top and bottom and 18 pt on the sides. I want to set these to zero.

- Peer
From: Michael Gibson
26 Jan 2023   [#2] In reply to [#1]
Hi Peer, sorry no there isn't any way to set the page margins.

- Michael
From: pressure (PEER)
26 Jan 2023   [#3] In reply to [#2]
Thanks for your quick reply Michael.

- Peer
From: Michael Gibson
26 Jan 2023   [#4] In reply to [#3]
The margins come from a mechanism shared between PDF, AI, and SVG export, so any changes to that need to be done and tested across all these formats, not just for one.

I think you will only get margins with 'Fit to page" mode though, if you are exporting an ortho view with "Preserve units" mode it should be different I think.

- Michael
From: pressure (PEER)
28 Jan 2023   [#5] In reply to [#4]
Hi Michael,

I'm exporting 3D perspective views. I thought that maybe there were settings for margins in moi.ini or something. But, I'm not sure just yet whether a change would actually be useful. I'm still testing out this new workflow that involves margins. I'll report back if it seems like setting margins is needed.

- Peer
From: pressure (PEER)
20 Feb 2023   [#6] In reply to [#5]
Hi Michael,

It turns out that it would be handy to be able to set page margins to 0 when exporting SVG/PDF/AI. This would make it easy to compose a scene in MoI in page space. It would also be helpful for illustrating a combination of transparent and opaque parts and for making changes to a perspective illustration that's already fairly far along in vector graphics, because then just the changes can be exported from MoI on registration with the original export. In other words, being able to set page margins to 0 will make it easy to composite multiple renderings from MoI by having the renderings be registered to page space.

Say I want show a transparent disk on top of an opaque ring:



I need to render the disk with hidden lines generated, but not generate hidden lines for the opaque ring. And I need an Outline that goes around everything. If I try exporting an SVG of the glass with hidden line generation on and then another of both glass and ring with only visible lines:





And then combine the resulting SVGs I get garbage that needs to be aligned by scaling and moving:



But, if I add a bounding rectangle to the scene that has the same aspect ratio as the target page size less 2*12pt in height and less 2*18pt in width then combining multiple renderings is just copy-paste:



Here's what the bounding rectangle setup looks like in MoI:



margin_demo.3dm attached

So, while I can do this now by using a rectangle with an aspect ratio exactly 24x36 pt smaller than the target illustration size, it's a little awkward to have to do the arithmetic remembering which direction is 24 pt and which is 36, and it's kind of hard to judge a composition relative to a rectangle that's not quite the same size as the finished illustration.

- Peer

Attachments:
margin_demo.3dm

Image Attachments:
both_viewport.png  composite.png  composite_bad.png  glass_viewport.png  margin_copy_paste.gif 


From: Michael Gibson
20 Feb 2023   [#7] In reply to [#6]
Hi Peer, actually the 18pt/12pt margins isn't something that I cooked up myself, it's what Adobe Illustrator uses as default values when reading in an AI file.

Also another kind of tricky thing is that AI format places the 0,0 origin location as being the lower left point inside the margin while PDF and SVG have the origin at the page corner instead.

It's not really documented well how it works in AI format so any work in this area will likely take some reverse engineering detective work to make it work with AI format and it's not likely to happen anytime soon sorry.

- Michael
From: pressure (PEER)
20 Feb 2023   [#8] In reply to [#7]
Thanks for thinking about this Michael. Darn AI.

- Peer