2
$\begingroup$

A quick question about using the Freestyle SVG exporter. What units does the exporter assign to vector objects in the SVG export file- meters, millimeters, pixels?

Suppose that I was exporting Freestyle edges with lengths that correspond to a few meters in the real world, but I haven't made a setting for modeling units in the scene- I simply adhere to a modeling practice of having 1 modeling unit correspond to 1 meter. In a graphic design program such as Inkscape I would want to reproduce the vector objects at a conventional scale, such as 1:100 or 1:50. With an orthographic camera, I would be using the Orthographic Scale setting to fit the objects into the area rendered. What would be good practice for ensuring accuracy of scale, at a desired scale?

$\endgroup$
1
$\begingroup$

Having made tests with SVG files produced by Freestyle, I found that:

Freestyle exports in pixels, and in Inkscape the default pixel density is 90 dots per inch. I don't know if this can be changed in Inkscape, and other vector drawing programs may use different pixel densities.

Therefore a rendered image whose pixel size is calculated in multiples of 90 will become an Inkscape sheet with dimensions in the corresponding number of inches. For example, a 900x900 px render will be 10 inches by 10 inches. 900x900 px is a practical size for a scaled Freestyle SVG export, because it gives you fast rendering and easy math.

The scaling of the camera affects the relative size of an object in the viewport, measured in pixels. When pixel densities in a piece of graphic work software are measured in imperial units and in a project you need to use exact scaling in metric units, you use the conversion factor 25.4 or its multiples in the scaling of Blender's camera. Multiply 25.4 by 2 to get scales of 1:20, 1:200 etc.; multiply 25.4 by 5 to get 1:50 etc.

This method will not support the entire range of architectural scales from 1:1 to 1:10 000, or the entire range of objects of drafting from doorknobs to urban planning proposals. In most cases you have to scale the SVG objects again on the Inscape sheet, but that's a piece of cake. This might not be the most popular use for Blender among its many uses, but I had a need for it and had fun figuring it out.

Afterword: after I posted this answer, Inkscape changed its default pixel resolution from 90 dpi to 96 dpi, to better suit web graphics. So every number 90 or its multiple in the text above should be replaced with 96, or a multiple of 96. If you open an old Inkscape file with the latest version of Inkscape, you get a notification about the change of pixel resolution.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.