Anyone know how to export an image to scale? (1:1)

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Anyone know how to export an image to scale? (1:1)

MichaelAtOz
Administrator
I'd like to export an image of a model so that when printed the image matches the size of the model, i.e. a template. ATM the .png size seems to relate to the zoom level.
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Anyone know how to export an image to scale? (1:1)

leebc
Have you tried modeling in a measure stick to export with the image and then rescaling?


I.E.  You create a cube 10x10x10 (mm) prefixed with the * modifier so that it's hidden during rendering; export to PNG; open in GIMP (or other) and rescale so the cube is 10x10 in the resized image; save rescaled image.
Reply | Threaded
Open this post in threaded view
|

Re: Anyone know how to export an image to scale? (1:1)

MichaelAtOz
Administrator
ATM I'm using projection() to get 2D, export to DXF, import to Inkscape, export to png.....
So size is good, but it would be easier to get an OpenSCAD export to png at the right scale.
This is parametric modelling so you'd think it would be possible...
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Anyone know how to export an image to scale? (1:1)

RobWLakes
This is rather critical. It would be very useful to be able to print a
1:1 or a known scale "object" to real dimensions.  To take a simple but
probably common example, making a case for a Raspberry Pi.  After all
the work to get close to such a design, it would be very helpful to be
able to print orthographic versions of the  model to test the "fit" of
the model to the real thing. It has been of considerable irritation that
few graphics programs (apart from Inkscape) bother to keep their
rendering of objects to some real world reference.  I was actually very
surprised when I found out that in openSCAD a dimension of 1 actually
was a reliable 1mm.  Amazing!! This was quite unexpected as I have
become used to so many '86 programs not bothering about the real world.
Given that the resolution of a printer is available from the drivers,
any program should be able to render a pretty close printout of the
object, to within fractions of a mm. If it can be done for a 3D printer,
why not a 2 printer???  Not everyone has the materials, or the time
(especially) to print a plastic 3-D model to just see if it fits.  So a
hardcopy printout with sub-mm accuracy would be very handy.  Given the
openSCAD has buttons to produce orthographic views, why not make it
possible to print 1:1 or at least exact scale versions of those
views/models.

It would be better if this was built into openSCAD, rather than
someone's "late program-atical add on".  Apologies to MichaelAtOz and
others who may have spent many hours reverse engineering this
distortion. Your skills are far greater than mine.

Enough of my ramblings what do others think?

Rob

On 04/12/16 13:11, MichaelAtOz wrote:

> ATM I'm using projection() to get 2D, export to DXF, import to Inkscape,
> export to png.....
> So size is good, but it would be easier to get an OpenSCAD export to png at
> the right scale.
> This is parametric modelling so you'd think it would be possible...
>
>
>
> -----
> Admin - PM me if you need anything, or if I've done something stupid...
>
> Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
>
> The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
> --
> View this message in context: http://forum.openscad.org/Anyone-know-how-to-export-an-image-to-scale-1-1-tp19454p19456.html
> Sent from the OpenSCAD mailing list archive at Nabble.com.
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Rob W
Lake Tyers Beach,
Victoria, Australia
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Anyone know how to export an image to scale? (1:1)

tp3
On 12/04/2016 08:59 AM, Rob Ward wrote:
> I was actually very surprised when I found out that in
> openSCAD a dimension of 1 actually was a reliable 1mm.
>
Strictly speaking that is not true. It's currently some kind
of common assumption for STL tool chains as STL does not have
any means to store any unit information.

SVG and AMF for example have a way to specify units and this
is currently hard coded to mm which is not the best solution.
There is already a feature request on github that will change
this to be an option when exporting files. At this point it
would be perfectly sensible again to design in OpenSCAD with
an unit of 1 meter and export that correctly to AMF.

It should be possible to print SVG directly instead of
converting to bitmap, maybe simply via a web browser?
I never tried that myself but some bug reports regarding SVG
output seem to imply people did that.

> Given the openSCAD has buttons to produce orthographic views,
> why not make it possible to print 1:1 or at least exact scale
> versions of those views/models.
>
I'm not even aware anybody created a feature request for
this until now, so why would someone implement it if there's
no need? There's a huge backlog of stuff that someone actually
asked for.
If it turns out to be a useful feature, it makes sense to
create a feature request for this. Looking at the technical
side, I suspect it might be much more difficult to implement
than it seems as the current PNG export is pretty much just
a screenshot which leads to all the effects MichaelAtOz
found.
Realistically it might be much faster to find a program
that correctly prints SVGs (and maybe even document that
in the manual), especially with the added bonus that we
don't need to care about resolution as we'd need to do
for PNG output.

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Anyone know how to export an image to scale? (1:1)

Ronaldo
In reply to this post by MichaelAtOz
MichaelAtOz wrote
I'd like to export an image of a model so that when printed the image matches the size of the model, i.e. a template. ATM the .png size seems to relate to the zoom level.
I think you will need to find the correct value of $vpd to get it. I would guess a value, print an image with the scales, measure the printed scales and change $vpd accordingly. It will possibly depend on your graphic card resolution.
Reply | Threaded
Open this post in threaded view
|

Re: Anyone know how to export an image to scale? (1:1)

RobWLakes
In reply to this post by tp3

That sounds much better than my idea.  Producing an SVG that allows further editing of the underlying shape would be excellent as it would also allow for illustrative shading etc as well as the obvious bonus of annotations etc  To some extent, the options to show "Wire Frames"  or "Edges", and align to orthographic views,  could mean that a lot of the information on how to do this exists (NB naive programmer being optimistic).  Flattening that to an SVG and letting InkScape take care of the final printout and printer resolutions etc would be a very good option. This image could be used to export .png or .jpg etc

Long, long ago, there once was a program called !Draw and it could do powerful 2D CAD, and it could be set to mm and print sub mm accuracy on any printer that had standard drivers.  This was Acorn c.1990 and on a RISC PC with an ARM chip.  Swapping to Linux 4 years ago and discovering many new packages (to me), both InkScape and openSCAD with their "no nonsense" approach to rendering reality was really refreshing.  Hence my surprise, pleasure, that 1 =1mm.  Watching students over many years trying to make MS Paint do stuff used to bring tears to my eyes.

We can import SVG, why not export it as well?

Rob


On 04/12/16 22:40, Torsten Paul wrote:
On 12/04/2016 08:59 AM, Rob Ward wrote:
I was actually very surprised when I found out that in
openSCAD a dimension of 1 actually was a reliable 1mm.

Strictly speaking that is not true. It's currently some kind
of common assumption for STL tool chains as STL does not have
any means to store any unit information.

SVG and AMF for example have a way to specify units and this
is currently hard coded to mm which is not the best solution.
There is already a feature request on github that will change
this to be an option when exporting files. At this point it
would be perfectly sensible again to design in OpenSCAD with
an unit of 1 meter and export that correctly to AMF.

It should be possible to print SVG directly instead of
converting to bitmap, maybe simply via a web browser?
I never tried that myself but some bug reports regarding SVG
output seem to imply people did that.

Given the openSCAD has buttons to produce orthographic views,
why not make it possible to print 1:1 or at least exact scale
versions of those views/models.

I'm not even aware anybody created a feature request for
this until now, so why would someone implement it if there's
no need? There's a huge backlog of stuff that someone actually
asked for.
If it turns out to be a useful feature, it makes sense to
create a feature request for this. Looking at the technical
side, I suspect it might be much more difficult to implement
than it seems as the current PNG export is pretty much just
a screenshot which leads to all the effects MichaelAtOz
found.
Realistically it might be much faster to find a program
that correctly prints SVGs (and maybe even document that
in the manual), especially with the added bonus that we
don't need to care about resolution as we'd need to do
for PNG output.

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


--

Rob Ward
Lake Tyers Beach, 3909
Lake Tyers Beach Website
XP to XUbuntu


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Rob W
Lake Tyers Beach,
Victoria, Australia
Reply | Threaded
Open this post in threaded view
|

Re: Anyone know how to export an image to scale? (1:1)

nophead
You can export SVG as long as your top level model is 2D. You can use projection() to get cross sections of 3D objects.

On 4 December 2016 at 22:04, Rob Ward <[hidden email]> wrote:

That sounds much better than my idea.  Producing an SVG that allows further editing of the underlying shape would be excellent as it would also allow for illustrative shading etc as well as the obvious bonus of annotations etc  To some extent, the options to show "Wire Frames"  or "Edges", and align to orthographic views,  could mean that a lot of the information on how to do this exists (NB naive programmer being optimistic).  Flattening that to an SVG and letting InkScape take care of the final printout and printer resolutions etc would be a very good option. This image could be used to export .png or .jpg etc

Long, long ago, there once was a program called !Draw and it could do powerful 2D CAD, and it could be set to mm and print sub mm accuracy on any printer that had standard drivers.  This was Acorn c.1990 and on a RISC PC with an ARM chip.  Swapping to Linux 4 years ago and discovering many new packages (to me), both InkScape and openSCAD with their "no nonsense" approach to rendering reality was really refreshing.  Hence my surprise, pleasure, that 1 =1mm.  Watching students over many years trying to make MS Paint do stuff used to bring tears to my eyes.

We can import SVG, why not export it as well?

Rob


On 04/12/16 22:40, Torsten Paul wrote:
On 12/04/2016 08:59 AM, Rob Ward wrote:
I was actually very surprised when I found out that in
openSCAD a dimension of 1 actually was a reliable 1mm.

Strictly speaking that is not true. It's currently some kind
of common assumption for STL tool chains as STL does not have
any means to store any unit information.

SVG and AMF for example have a way to specify units and this
is currently hard coded to mm which is not the best solution.
There is already a feature request on github that will change
this to be an option when exporting files. At this point it
would be perfectly sensible again to design in OpenSCAD with
an unit of 1 meter and export that correctly to AMF.

It should be possible to print SVG directly instead of
converting to bitmap, maybe simply via a web browser?
I never tried that myself but some bug reports regarding SVG
output seem to imply people did that.

Given the openSCAD has buttons to produce orthographic views,
why not make it possible to print 1:1 or at least exact scale
versions of those views/models.

I'm not even aware anybody created a feature request for
this until now, so why would someone implement it if there's
no need? There's a huge backlog of stuff that someone actually
asked for.
If it turns out to be a useful feature, it makes sense to
create a feature request for this. Looking at the technical
side, I suspect it might be much more difficult to implement
than it seems as the current PNG export is pretty much just
a screenshot which leads to all the effects MichaelAtOz
found.
Realistically it might be much faster to find a program
that correctly prints SVGs (and maybe even document that
in the manual), especially with the added bonus that we
don't need to care about resolution as we'd need to do
for PNG output.

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


--

Rob Ward
Lake Tyers Beach, 3909
Lake Tyers Beach Website
XP to XUbuntu


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Anyone know how to export an image to scale? (1:1)

MichaelAtOz
Administrator
Thanks all.

SVG is much easier.
I just double clicked it and it opened in IE.
Did file/print and it measures accurately.
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Anyone know how to export an image to scale? (1:1)

MichaelAtOz
Administrator
Although Shapeways doesn't accept SVG, so I still need to Inkscape export...
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Anyone know how to export an image to scale? (1:1)

kintel
Administrator
> On Dec 4, 2016, at 17:56, MichaelAtOz <[hidden email]> wrote:
>
> Although Shapeways doesn't accept SVG, so I still need to Inkscape export…

Not sure if this is of any help, but we've added experimental SVG import to the OpenSCAD snapshots.
Needs to be enabled in Preferences.

 -Marius


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org