Draft: SVG
Descrizione
Draft SVG è un modulo software utilizzato dai comandi Apri,
Importa e
Esporta per gestire il formato SVG.
Disegno di Inkscape esportato in SVG, e successivamente aperto in FreeCAD
Importazione
Si possono importare i seguenti oggetti SVG:
- Oggetti PATH
- Oggetti LINE
- Oggetti RECT
- Oggetti CIRCLE
- Oggetti ELLIPSE
- Oggetti POLYGON
- Oggetti POLYLINE
Limitazioni
FreeCAD non importerà oggetti tracciato che hanno un solo punto (forum discussion).
Esportazione
È possibile esportare i seguenti oggetti FreeCAD:
- Linee e spezzate (polilinee)
- Archi e circonferenze
- Facce
- Testi
- Dimensioni
Limitazione
Ricordare che il formato SVG è un formato 2D, quindi si perdono tutte le informazioni sull'asse Z (tutti gli oggetti risultano appiattiti).
Gestione delle Unità
Quando si esporta, una Unità utente (px) equivale a un millimetro.
Durante l'importazione sono rispettati la larghezza, l'altezza e gli attributi Viewbox. Tutti gli elementi vengono scalati alle loro dimensioni in millimetri, che è l'unità interna di FreeCAD. Se il file SVG non contiene informazioni sulla dimensione fisica, si presuppone di avere una risoluzione di 90 DPI. L'utilizzo di unità assolute negli attributi all'interno del SVG è da evitare. Unità relative come em, ex e % non sono attualmente supportate.
L'editor di SVG Inkscape attualmente funziona solo con documenti con 90 DPI. Non importa quale unità è stata selezionata in Inkscape. In uscita, tutto deve essere considerato convertito in 90 DPI e arrotondato a 6 decimali.
Dato che FreeCAD (e lo standard SVG) è agnostico alla precisione di arrotondamento fatta in Inkscape questi valori non sono arrotondati in ingresso. E rimarranno i valori strani in millimetri.
Se è necessario importare l'SVG senza arrotondamenti, lavorare in Unità utente (px) in Inkscape. La scalatura può essere eseguita dopo l'importazione in FreeCAD o modificando la larghezza, l'altezza e gli attributi Viewbox.
Preferenze
Vedere Preferenze di Importa/Esporta.
Script
Vedere anche: Autogenerated API documentation e Script di base per FreeCAD.
Per esportare oggetti in SVG utilizzare il metodo export del modulo importSVG.
importSVG.export(exportList, filename)
- Per il sistema operativo Windows: utilizzare un / (barra) come separatore del percorso in
filename.
Esempio:
import FreeCAD as App
import Draft
import importSVG
doc = App.newDocument()
polygon1 = Draft.make_polygon(3, radius=500)
polygon2 = Draft.make_polygon(5, radius=1500)
doc.recompute()
objects = [polygon1, polygon2]
importSVG.export(objects, "/home/user/Pictures/myfile.svg")
- Drafting: Line, Polyline, Fillet, Arc, Arc From 3 Points, Circle, Ellipse, Rectangle, Polygon, B-Spline, Cubic Bézier Curve, Bézier Curve, Point, Facebinder, ShapeString, Hatch
- Annotation: Text, Dimension, Label, Annotation Styles, Annotation Scale
- Modification: Move, Rotate, Scale, Mirror, Offset, Trimex, Stretch, Clone, Array, Polar Array, Circular Array, Path Array, Path Link Array, Point Array, Point Link Array, Edit, Highlight Subelements, Join, Split, Upgrade, Downgrade, Convert Wire/B-Spline, Draft to Sketch, Set Slope, Flip Dimension, Shape 2D View
- Draft Tray: Working Plane, Set Style, Toggle Construction Mode, AutoGroup
- Snapping: Snap Lock, Snap Endpoint, Snap Midpoint, Snap Center, Snap Angle, Snap Intersection, Snap Perpendicular, Snap Extension, Snap Parallel, Snap Special, Snap Near, Snap Ortho, Snap Grid, Snap Working Plane, Snap Dimensions, Toggle Grid
- Miscellaneous: Apply Current Style, New Layer, Manage Layers, New Named Group, SelectGroup, Add to Layer, Add to Group, Add to Construction Group, Toggle Wireframe, Working Plane Proxy, Heal, Show Snap Toolbar
- Additional: Constraining, Pattern, Preferences, Import Export Preferences, DXF/DWG, SVG, OCA, DAT
- Context menu:
- Most objects: Edit
- Layer container: Add New Layer, Reassign Properties of All Layers, Merge Layer Duplicates
- Layer: Activate Layer, Reassign Properties of Layer, Select Layer Contents
- Text and label: Open Links
- Wire: Flatten
- Working plane proxy: Save Camera Position, Save Visibility of Objects
- 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
- Hubs: User hub, Power users hub, Developer hub
