Please help converting a 2d image to 3d object

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
scottdmills71
Posts: 9
Joined: Wed Jul 04, 2018 6:57 pm

Please help converting a 2d image to 3d object

Post by scottdmills71 »

freecad ver0.16 << highest version number i was able to install>>
Linux Xubuntu 18.04

What I wish to accomplish,is to take an image file and extrude it into a 3d shape.

the methods I have tried are as follows.
1 . imported the image into ikscape as a .bmp file, i then used Path > Trace Bitmap.
After that I saved it as a PLAIN .svg .
used this tutorial "Inkscape tutorial: Tracing bitmaps"
https://inkscape.org/en/doc/tutorials/t ... acing.html
I then tried to IMPORT the .svg file into
several different workbenches in freecad as svg geometry. Each time i did so freecad
crashed itself. << what am I doing wrong here?

2. I then imported the image using the image workbench >create a planar image in the
3d workspace after making the image a transparent background .png. I am able to view
the image and sketch over it however that is an extremely slow way to create an extrusion .

3. this fctexture macro looks promising, but there are no clear instructions how to
use it.
https://www.freecadweb.org/wiki/Macro_Texture

I read this post trying to find useful instructions, and did not find them.
https://forum.freecadweb.org/viewtopic. ... 968#p80658


is there any other method to take an image file and turn it into a 3d part?
chrisb
Veteran
Posts: 54144
Joined: Tue Mar 17, 2015 9:14 am

Re: Please help converting a 2d image to 3d object

Post by chrisb »

Hi scottdmills71, welcome to the forum. Please follow the IMPORTANT link above and supply the full FreeCAD info of your two versions. No one here knows which is the highest version number you are able to install, nor do we even know the system on which you did so.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
wandererfan
Veteran
Posts: 6307
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Please help converting a 2d image to 3d object

Post by wandererfan »

scottdmills71 wrote: Wed Jul 04, 2018 7:01 pm is there any other method to take an image file and turn it into a 3d part?


this https://www.forum.freecadweb.org/viewto ... 22&t=28831 might be worth a look.
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Please help converting a 2d image to 3d object

Post by easyw-fc »

scottdmills71 wrote: Wed Jul 04, 2018 7:01 pm freecad ver0.16 << highest version number i was able to install>>
Linux Xubuntu 18.04
You should be able to install at least ubuntu stable 0.17
https://forum.freecadweb.org/viewtopic. ... 92#p227145
https://www.freecadweb.org/wiki/Install ... ed_systems
[0.17 release/0.18 daily/0.16 legacy] Ubuntu PPA users please read this
scottdmills71
Posts: 9
Joined: Wed Jul 04, 2018 6:57 pm

Re: Please help converting a 2d image to 3d object

Post by scottdmills71 »

So far for the project I am working on I have went ahead with method number 2 , I spent a lot of time sketching around a converted .BMP file .Now I am searching the web for some way to close off parts of the sketch so that I can extrude this 50mm. When I try to do it as it is I get lots of walls but not exactly what I am trying to accomplish.
Attachments
Screenshot_2018-07-05_21-55-08.png
Screenshot_2018-07-05_21-55-08.png (279.23 KiB) Viewed 13341 times
4.png
4.png (8.38 KiB) Viewed 13341 times
3.fcstd
(409.2 KiB) Downloaded 91 times
chrisb
Veteran
Posts: 54144
Joined: Tue Mar 17, 2015 9:14 am

Re: Please help converting a 2d image to 3d object

Post by chrisb »

Your lines are not connected. I have moved some of them to show the issue:
Bildschirmfoto 2018-07-06 um 08.05.00.png
Bildschirmfoto 2018-07-06 um 08.05.00.png (11.38 KiB) Viewed 13332 times
I would go for the inkscape method with heavy use of the simplify path function.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54144
Joined: Tue Mar 17, 2015 9:14 am

Re: Please help converting a 2d image to 3d object

Post by chrisb »

You have 1260 straight lines in your sketch and 5040 degrees of freedom. That means you have not even two of them connected. You can use the Sketcher->Validate sketch tool to find and fix them, however it doesn't seem to find them all. You can currently set precision only to the predefined values, a fix for that is on its way.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TheMarkster
Veteran
Posts: 5508
Joined: Thu Apr 05, 2018 1:53 am

Re: Please help converting a 2d image to 3d object

Post by TheMarkster »

Good job with the drawing you made.
melody-screenshot.png
melody-screenshot.png (150.39 KiB) Viewed 13325 times
I imported the image via FCBmpImport. It ain't exactly pretty. I scaled it down to 200x74 in Gimp2, then imported as a Wire, applied midpoints + remove collinears, then selected all DWires and used Part->Extrude (to 50mm), then finished it off by selecting all but the first Extrude and fusing them together, then cutting the fusion from the first Extrude (which was the outline), took maybe 5 to 10 minutes.

I did a similar thing with the original unscaled (from a screencap of the pic you posted here), but the FreeCAD file is 5MB, too big to attach.
melody-screenshot2.png
melody-screenshot2.png (137.52 KiB) Viewed 13325 times
I'm also have a padded sketch version (only 1700 line segments with 6800 degress of freedom in the unconstrained sketch).
melody-screenshot3.png
melody-screenshot3.png (105.54 KiB) Viewed 13325 times
That's the scaled down version, and even it's really too much for the sketcher.
Attachments
melody-scaled.FCStd
(707.75 KiB) Downloaded 62 times
User avatar
hammax
Veteran
Posts: 1990
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee DE

Re: Please help converting a 2d image to 3d object

Post by hammax »

… make your picture as a scaled background.
Disassemble the objects in your picture by making separate models.
Now you are free to extrude and position the simple parts at your like and taste.

Melody.PNG
Melody.PNG (23.87 KiB) Viewed 13315 times
Attachments
Melody.FCStd
FC,18.14014
(27.48 KiB) Downloaded 70 times
scottdmills71
Posts: 9
Joined: Wed Jul 04, 2018 6:57 pm

Re: Please help converting a 2d image to 3d object

Post by scottdmills71 »

Awesome tips everyone, Now I am going to digest and try to understand it all and definitely learn from it.
Post Reply