Draft SVG/it: Difference between revisions
No edit summary |
No edit summary |
||
Line 74: | Line 74: | ||
==Script== |
==Script== |
||
⚫ | |||
<div class="mw-translate-fuzzy"> |
|||
⚫ | |||
</div> |
|||
<div class="mw-translate-fuzzy"> |
<div class="mw-translate-fuzzy"> |
Revision as of 22:17, 24 November 2023
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.
Si possono esportare elementi in SVG usando la seguente funzione:
importSVG.export(exportList, filename)
- For the Windows OS: use a / (forward slash) as the path separator 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 by 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, Subelement highlight, Join, Split, Upgrade, Downgrade, Wire to B-spline, Draft to sketch, Set slope, Flip dimension, Shape 2D view
- Draft Tray: Select 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, Layer, Manage layers, Add a new named group, Move to group, Select group, Add to construction group, Toggle normal/wireframe display, Create working plane proxy, Heal, Show snap toolbar
- Additional: Constraining, Pattern, Preferences, Import Export Preferences, DXF/DWG, SVG, OCA, DAT
- Context menu:
- Layer container: Merge layer duplicates, Add new layer
- Layer: Activate this layer, Select layer contents
- Text: Open hyperlinks
- Wire: Flatten
- Working plane proxy: Write camera position, Write objects state
- 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, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
- Hubs: User hub, Power users hub, Developer hub