↑top

FreeCAD: How to create solids from 2D image?

Update: July 9, 2017
FreeCAD 0.16

This section describes how to create a solid from imported image file.

Original image in PNG format Original image in PNG format
Created solids Created solids

Converting a image from bitmap format to SVG format

If the original image file is in PNG or JPEG format, you must first convert it to SVG format. In the following example, PNG image is converted to SVG image with Inkscape (version 0.91).

  1. Start Inkscape and select [File]-[Import...] from the menu. Select an image file in the file dialog to show an import dialog and click OK button to import the file.

    Selects [File]-[Import...] Selects [File]-[Import...]
    Import dialog (for PNG format file) Import dialog (for PNG format file)
  2. Click the loaded image on window to select it, and select [Path]-[Trace Bitmap...] from the menu. In the displayed "Bitmap Trace" dialog, make sure that "Brightness Boundary" is selected, and then click the OK button. After conversion, close the dialog with the close button in the upper right corner of the window.

    Selects [Path]-[Trace Bitmap...] Selects [Path]-[Trace Bitmap...]
    'Bitmap Trace' dialog "Bitmap Trace" dialog
  3. With these operation, a vector image that overlaps the original image will be generated. Drag the image from the original image and delete the original image.

  4. Select [File]-[Save As...] from the menu and save the image as an SVG file.

    Selects [File]-[Save As...] Selects [File]-[Save As...]

Importing SVG format image and converting it to solids

The SVG format image file is now ready. Then import this file into FreeCAD and convert it to solids.

SVG format image SVG format image
  1. Start FreeCAD and make new document.

  2. Drag&Drop the SVG format file into 3D view to show import dialog. Select "SVG as geometry (importSVG)" and click Select button to import the file.

    Import dialog for SVG format file Import dialog for SVG format file
    インポート結果 Imported shape
  3. SVG image is imported as a path (line), so we convert them to faces. Switch workbench to Draft workbenchドラフトワークベンチ, then select all item on model tree and upgradeDraft_Upgrade them to convert them to faces. You can select multiple items on model tree by clicking with SHIFT key.

    Conversion result of faces Conversion result of faces
  4. Switch workbench to Part workbenchパートワークベンチ and select all item on model tree and extrudePart_Extrude them. In the dialog for extruding, set "Length" to 10 mm and click OK to extrude.

    Dialog for extruding Dialog for extruding
    Extrusion result Extrusion result
  5. We get the created solids into one. Select all item on model tree and apply boolean operation (Fuse)Part_Fuse

    Inkscape-Import Result of Fuse

We have now created solids from the image.