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

Postby scottdmills71 » Wed Jul 04, 2018 7:01 pm

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
Posts: 18926
Joined: Tue Mar 17, 2015 9:14 am

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

Postby chrisb » Wed Jul 04, 2018 7:44 pm

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.
wandererfan
Posts: 3075
Joined: Tue Nov 06, 2012 5:42 pm

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

Postby wandererfan » Wed Jul 04, 2018 8:01 pm

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
Posts: 2668
Joined: Thu Jul 09, 2015 9:34 am

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

Postby easyw-fc » Wed Jul 04, 2018 8:21 pm

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

Postby scottdmills71 » Fri Jul 06, 2018 4:00 am

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 2858 times
4.png
4.png (8.38 KiB) Viewed 2858 times
3.fcstd
(409.2 KiB) Downloaded 11 times
chrisb
Posts: 18926
Joined: Tue Mar 17, 2015 9:14 am

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

Postby chrisb » Fri Jul 06, 2018 6:08 am

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 2849 times
I would go for the inkscape method with heavy use of the simplify path function.
chrisb
Posts: 18926
Joined: Tue Mar 17, 2015 9:14 am

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

Postby chrisb » Fri Jul 06, 2018 6:18 am

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.
TheMarkster
Posts: 1060
Joined: Thu Apr 05, 2018 1:53 am

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

Postby TheMarkster » Fri Jul 06, 2018 7:47 am

Good job with the drawing you made.
melody-screenshot.png
melody-screenshot.png (150.39 KiB) Viewed 2842 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 2842 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 2842 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 13 times
User avatar
hammax
Posts: 871
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee

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

Postby hammax » Fri Jul 06, 2018 9:21 am

… 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 2832 times
Attachments
Melody.FCStd
FC,18.14014
(27.48 KiB) Downloaded 12 times
scottdmills71
Posts: 9
Joined: Wed Jul 04, 2018 6:57 pm

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

Postby scottdmills71 » Fri Jul 06, 2018 11:19 pm

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