Popis
SVG is the abbreviation of Scalable Vector Graphics, a vectorized image format for two-dimensional graphics.
Vector-based formats such as SVG are very useful in technical drawing programs, like FreeCAD, because an SVG image can be scaled to any size without losing its shape or amount of details. The SVG can be scaled to any required resolution and converted to bitmap formats like PNG or JPEG for printing.
The SVG image is described in an XML-type language, which means that it can be opened and edited with a simple text editor to make changes. Due to its text-based nature, the file can also be searched, indexed, and compressed easily. This SVG markup language is an open standard developed by the World Wide Web Consortium (W3C) since 1999. This means that an SVG file should be read and interpreted in the same way by compliant viewers and drawing applications.
For more information on the SVG format see: Scalable Vector Graphics.
SVG in FreeCAD
FreeCAD is primarily a 3D modeling application, and thus doesn't have many 2D drawing tools. On the other hand FreeCAD relies on SVG files:
- Icons in the graphical user interface, representing tools in menus and toolbars, or objects and features in the Tree View
- Templates for the TechDraw workbench, representing sheets of paper, that define the format of a drawing and enable printing to scale. They can also provide frames, and a title block.
- Symbols, TechDraw Views embedding a single SVG file each, to provide frequently used graphic annotation elements.
In addition FreeCAD can import SVG files into 3D space:
- As an image plane that can be positioned by its Placement property.
- As separate 2D shapes on the XY-plane that can be used as base geometry for further modeling.
Finally FreeCAD has tools exporting to SVG:
- 3D geometry can be saved as Flattened SVG. In this case selected geometry is projected on the XY-plane and only X-, and Y-coordinates are used to derive SVG elements.
- TechDraw provides a tool to save the current drawing.
Std Import and
Std Export handle SVG related 3D import and export tasks, they use the Draft SVG function of the Draft module to convert 3D geometry from/to the SVG format.
Usage
Here we have additional descriptions focussed on SVG files for Std Import and Std Export.
3D Import
- Make there is an activate document.
- Select the File →
Import... option from the menu.
- In the file browser that appears do one of the following:
- With the default settings unchanged:
- Select a file and press the Open button.
- The Select Module dialog appears. From Open svg as select:
- Image formats (FreeCAD) to import the SVG file as an image plane.
- SVG as geometry (importSVG) to import the SVG file as separate shapes.
- Press the Open button to close the dialog and finish the tool.
- Optionally select the SVG as geometry filter option.
- Select the desired SVG file and press the Open button to finish the tool.
- Depending on the selected options an image plane or several shape and text objects are added to the document.
3D Export
Select one or more shapes.
- Select the File →
Export... option from the menu.
- In the file browser that appears select the Flattened SVG filter option.
- Enter a filename.
- Select a folder to save the SVG file.
- Press the Save button to close the browser and finish the tool.
2D Import and Export
The descriptions of the 2D tools are well focussed on SVG files so that linking the relevant pages is sufficient here.
- Templates are SVG files required to define drawing sheets (Page objects) in TechDraw.
- A symbol is a kind of TechDraw view used to add an SVG image for graphical annotation purposes to a TechDraw Page and optionally connect it with another TechDraw feature as its owner.
Insert SVG opens a file browser to select and import an SVG symbol file.
- Optionally, when a drawing is finished the page can be exported as an SVG file.
Related
User documentation
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Assembly, BIM, CAM, Draft, FEM, Inspection, Material, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework