Importing a picture linear extrude and scaling of the picture model. I want to use black and white pictures to import a shape like for example GB or the USA and extrude it to 3.6 mm height then put a name on there and add a hole for a keychain ring. I can make a black and white picture out of images available online but I dunno how to import and scale it. Can someone help me figure this out?

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

Importing a picture linear extrude and scaling of the picture model. I want to use black and white pictures to import a shape like for example GB or the USA and extrude it to 3.6 mm height then put a name on there and add a hole for a keychain ring. I can make a black and white picture out of images available online but I dunno how to import and scale it. Can someone help me figure this out?

terramir
terramir

Sent from my iPhone

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

Re: Importing a picture linear extrude and scaling of the picture model. I want to use black and white pictures to import a shape like for example GB or the USA and extrude it to 3.6 mm height then put a name on there and add a hole for a keychain ring. I can make a black and white picture out of images available online but I dunno how to import and scale it. Can someone help me figure this out?

frankv
Use InkScape to convert the B&W image to vectors and to generate an OpenSCAD source file (there's an OpenSCAD plugin for InkScape).

In OpenSCAD scale, difference from the text and circle, then linear_extrude to extrude the image to 3.6mm. Beware if your text contains holes (e.g. letter o or e).


On Wed, Mar 18, 2020 at 8:14 AM r.d. terramir <[hidden email]> wrote:
terramir

Sent from my iPhone

_______________________________________________
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: Importing a picture linear extrude and scaling of the picture model. I want to use black and white pictures to import a shape like for example GB or the USA and extrude it to 3.6 mm height then put a name on there and add a hole for a keychain ring. I can make a black and white picture out of images available online but I dunno how to import and scale it. Can someone help me figure this out?

lar3ry
In reply to this post by terramir
I could be wrong, but I don't think there are any picture formats that can be
imported to OpenSCAD.

If I wanted to do that, I'd import it into Inkscape (free), trace it, and
then export it to svg format.

Unfortunately this only works for pictures that have a distinct outline. So,
the best thing to do is to look for svg files that are aready made. You can
also find maps that are silhouettes, which can be easily traced in inkscape.
As well, there are literally thousands, if not millions of files of pretty
much any subject you want, in SVG, PDF, EPS, and DXF format that can be
converted using online conversion sites.

Here's one from vectorstock.com that will easily trace in inkscape.
I loaded it into inkscape, traced the bitmap, broke the ppaths apart,
selected the box with text, deleted that, combined the paths again, and
saved it as an svg file. I then dragged and dropped the svg file into
OpenSCAD and did a 5mm linear_extrude.

linear_extrude(5)
import("J:/Downloads/20476754.svg");

<http://forum.openscad.org/file/t2121/20476754.jpg>

<http://forum.openscad.org/file/t2121/20476754.png>



--
Sent from: http://forum.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: Importing a picture linear extrude and scaling of the picture model. I want to use black and white pictures to import a shape like for example GB or the USA and extrude it to 3.6 mm height then put a name on there and add a hole for a keychain ring. I can make a black and white picture out of images available online but I dunno how to import and scale it. Can someone help me figure this out?

OpenSCAD mailing list-2
The idea presented to use Inkscape (or any vector program that traces, even
Lightburn) to trace out the bitmap is a solid valid approach. The extension
just makes things that much better. I've done this many times and learn a
bit more each time. Unfortunately, I forget more than I remember, so I get
to learn some things over again.

The reference to holes also is a consideration. The extension for Inkscape
creates a separate polygon path for each appropriate segment. One can pop a
# into the code to determine which is the major or primary outline, then //
comment it out and comment the line to identify it.

The remaining "islands" can be commented or # identified and pushed into a
difference environment if they are holes.

One thing I've found is the Inkscape extension dumps a scale factor that
isn't accurate/realistic and I change the value of the scale line to 1 to
get the size correct.

If the extension is used, experiment with the "force line output" of the
extension. One aspect of Inkscape trace is that you'll get a path for each
side of the stroke. In one setting, the walls of the OpenSCAD output are
stroke thickness with an empty middle, while the other setting generates a
solid shape. The solid shape method requires the above referenced difference
section if there are holes.

If you decide you don't like the extrusion thickness selected in the
Inkscape extension, that's also a value easily changed in the resulting
code.

You'll find different versions of this extension on Thingiverse. The most
recent has some peculiarities and I've been using "second from the top"
enough to want to avoid changing something that works. I've also read that
the newest version of Inkscape (higher than 0.92) might have complications
when it comes to some extensions. I didn't pursure that avenue either.



--
Sent from: http://forum.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: Importing a picture linear extrude and scaling of the picture model. I want to use black and white pictures to import a shape like for example GB or the USA and extrude it to 3.6 mm height then put a name on there and add a hole for a keychain ring. I can make a black and white picture out of images available online but I dunno how to import and scale it. Can someone help me figure this out?

TLC123
In reply to this post by terramir
 linear_extrude( 3.6)
 projection(cut = true)
translate ([0,0,70]) // 70 or what ever you need
surface(file = "ukmap.png", center = true, invert = true);



--
Sent from: http://forum.openscad.org/

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