Draft SVG/de: Difference between revisions

From FreeCAD Documentation
(Created page with "==Einheiten Handhabung==")
(Created page with "Beim Export ist eine Benutzereinheit (px) gleich einem Millimeter.")
Line 53: Line 53:
==Einheiten Handhabung==
==Einheiten Handhabung==


Beim Export ist eine Benutzereinheit (px) gleich einem Millimeter.
When exporting, a User Unit (px) equals one millimeter.


When importing, the width, height and viewBox attributes are respected. All elements are scaled to their size in millimeter, which is FreeCAD internal unit. If the SVG does not contain information on its physical size, it is assumed to have 90 DPI resolution.
When importing, the width, height and viewBox attributes are respected. All elements are scaled to their size in millimeter, which is FreeCAD internal unit. If the SVG does not contain information on its physical size, it is assumed to have 90 DPI resolution.

Revision as of 15:01, 25 June 2020

Entwurf SVG

Menüeintrag
-
Arbeitsbereich
Entwurf
Standardtastenkürzel
-
Eingeführt in Version
-
Siehe auch
-

Beschreibung

Draft SVG is a software module used by the Std Open, Std Import and Std Export commands to handle the SVG file format.

Inkscape drawing exported to SVG, which is subsequently opened in FreeCAD

Importieren

Die folgenden SVG Objekte können importiert werden:

  • PFAD Objekte
  • LINIE Objekte
  • RECHTWINKLIG Objekte
  • KREIS Objekte
  • ELLIPSE Objekte
  • POLYGON Objekte
  • POLYLINIE Objekte

Begrenzungen

FreeCAD will not import path objects that have only one point (forum discussion).

Exportieren

Die folgenden FreeCAD Objekte können exportiert werden:

  • Linien und Drähte (Polylinien)
  • Bögen und Kreise
  • Flächen
  • Texte
  • Abmessungen

Begrenzungen

SVG ist ein 2D Format, daher werden alle Z Informationen nicht berücksichtigt (alle Objekte werden abgeflacht).

Einheiten Handhabung

Beim Export ist eine Benutzereinheit (px) gleich einem Millimeter.

When importing, the width, height and viewBox attributes are respected. All elements are scaled to their size in millimeter, which is FreeCAD internal unit. If the SVG does not contain information on its physical size, it is assumed to have 90 DPI resolution. Using absoulte units in attributes inside the SVG should be avoided. Relative units like em,ex and % are currently not supported.

The Inkscape SVG Editor currently works only with 90 DPI documents. No matter which unit is selected in Inkscape. All the output has to be considered converted to 90 DPI and rounded to 6 decimal places. As FreeCAD (and the SVG standard) is agnostic to the precision of rounding done in Inkscape these values will not be rounded on input. And odd values in millimeter will remain. If you need the SVG import not to be rounded, work on User Units (px) in Inkscape. Scaling can be done after the import to FreeCAD or by changing the width, height and viewbox attributes.

Preferences

For more information see: Import Export Preferences.

Scripting

See also: Draft API and FreeCAD Scripting Basics.

You can export elements to SVG by using the following function:

importSVG.export(exportList, filename)

Example:

import Draft, importSVG

Polygon1 = Draft.makePolygon(3, radius=500)
Polygon2 = Draft.makePolygon(5, radius=1500)

objects = [Polygon1, Polygon2]

importSVG.export(objects, "/home/user/Pictures/myfile.svg")