Draft DXF/it: Difference between revisions

From FreeCAD Documentation
No edit summary
(Updating to match new version of source page)
Line 1: Line 1:
{{Page in progress}}
<languages/>
<languages/>


Line 27: Line 26:
</div>
</div>


3D objects inside a DXF file are stored under a binary ACIS/SAT blob, which at the moment cannot be read by FreeCAD. Simpler entities like 3DFACEs, though, are supported.
3D solids inside a DXF file are stored under a binary ACIS/SAT blob, which at the moment cannot be read by FreeCAD.

===C++ importer===


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 43: Line 44:
* ... e altro
* ... e altro
</div>
</div>

===Legacy importer===

This importer can import the following DXF objects:
* lines
* polylines (and lwpolylines)
* arcs
* circles
* ellipses
* splines
* 3D faces
* texts and mtexts
* leaders
* layers


==Esportazione==
==Esportazione==
Line 49: Line 64:
I file vengono esportati nel formato DXF R12 che può essere gestito da molte applicazioni.
I file vengono esportati nel formato DXF R12 che può essere gestito da molte applicazioni.
</div>
</div>

===C++ exporter===

Some of the features and limitations of this exporter are:
* All FreeCAD 2D geometry is exported, except [[Draft_CubicBezCurve|Draft CubicBezCurves]], [[Draft_BezCurve|Draft BezCurves]] and [[Draft_Point|Draft Points]].
* Straight edges from faces of 3D objects are exported, but curved edges only if they are on a plane parallel to the XY plane of the global coordinate system. Note that a DXF created from 3D objects will contain duplicate lines.
* Texts and dimensions are not exported.
* Colors are ignored.
* Layers are mapped from object names.

===Legacy exporter===


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 71: Line 97:
==Preferenze==
==Preferenze==


<div class="mw-translate-fuzzy">
Per ulteriori informazioni, consultare: [[Import_Export_Preferences/it|Preferenze di Importa/Esporta]].
Per ulteriori informazioni, consultare: [[Import_Export_Preferences/it|Preferenze di Importa/Esporta]].
</div>


==Scripting==

<div class="mw-translate-fuzzy">
== Script ==
== Script ==
{{Emphasis|Vedere anche:}} [[Draft API/it|API Draft]] e [[FreeCAD Scripting Basics/it|Nozioni di base sugli script di FreeCAD]].
{{Emphasis|Vedere anche:}} [[Draft API/it|API Draft]] e [[FreeCAD Scripting Basics/it|Nozioni di base sugli script di FreeCAD]].
</div>


<div class="mw-translate-fuzzy">
Si possono esportare elementi in DXF usando la seguente funzione:
Si possono esportare elementi in DXF usando la seguente funzione:
</div>

{{Code|code=
{{Code|code=
importDXF.export(objectslist, filename, nospline=False, lwPoly=False)
importDXF.export(objectslist, filename, nospline=False, lwPoly=False)
}}
}}

* For the Windows OS: use a {{FileName|/}} (forward slash) as the path separator in {{Incode|filename}}.


Esempio:
Esempio:

{{Code|code=
{{Code|code=
import Draft, importDXF
import FreeCAD as App
import Draft
import importDXF


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


polygon1 = Draft.make_polygon(3, radius=500)
objects = [Polygon1, Polygon2]
polygon2 = Draft.make_polygon(5, radius=1500)


doc.recompute()

objects = [polygon1, polygon2]
importDXF.export(objects, "/home/user/Pictures/myfile.dxf")
importDXF.export(objects, "/home/user/Pictures/myfile.dxf")
}}
}}



<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">

Revision as of 08:04, 15 September 2021

Descrizione

Draft DXF è un modulo software utilizzato dai comandi Apri, Importa and Esporta per gestire il formato DXF.

Disegno fatto con Qcad esportato in DXF, e successivamente aperto in FreeCAD

Importazione

Sono supportate le versioni DXF R12 - 2007.

3D solids inside a DXF file are stored under a binary ACIS/SAT blob, which at the moment cannot be read by FreeCAD.

C++ importer

Possono essere importati i seguenti tipi di oggetti DXF:

  • linee
  • polilinee e polilinee alleggerite
  • circonferenze
  • archi
  • layers (i layers contenenti gli oggetti vengono convertiti in gruppi FreeCAD)
  • testi e testi multipli (mtexts)
  • dimensioni
  • blocchi (solo la geometria; i testi, le dimensioni e gli attributi all'interno di blocchi sono ignorati)
  • punti
  • linee guida
  • ... e altro

Legacy importer

This importer can import the following DXF objects:

  • lines
  • polylines (and lwpolylines)
  • arcs
  • circles
  • ellipses
  • splines
  • 3D faces
  • texts and mtexts
  • leaders
  • layers

Esportazione

I file vengono esportati nel formato DXF R12 che può essere gestito da molte applicazioni.

C++ exporter

Some of the features and limitations of this exporter are:

  • All FreeCAD 2D geometry is exported, except Draft CubicBezCurves, Draft BezCurves and Draft Points.
  • Straight edges from faces of 3D objects are exported, but curved edges only if they are on a plane parallel to the XY plane of the global coordinate system. Note that a DXF created from 3D objects will contain duplicate lines.
  • Texts and dimensions are not exported.
  • Colors are ignored.
  • Layers are mapped from object names.

Legacy exporter

Possono essere esportati i seguenti oggetti FreeCAD:

  • linee e spezzate (polilinee)
  • archi e circonferenze
  • testi
  • i colori sono mappati dai colori RGB degli oggetti secondo l'indice dei colori di autocad (ACI). Il nero è sempre "da layer"
  • i layers sono mappati dai nomi dei gruppi. Quando i gruppi sono nidificati, il gruppo più interno attribuisce il nome al livello (layer)
  • le dimensioni, che vengono esportate con dimstyle "Standard"
  • ... e altro

Installazione

Per motivi di licenza, le librerie di importazione e di esportazione DXF richieste non fanno parte del codice sorgente di FreeCAD.

Per ulteriori informazioni, consultare: Importare i file DXF in FreeCAD.

Preferenze

Per ulteriori informazioni, consultare: Preferenze di Importa/Esporta.

Scripting

Si possono esportare elementi in DXF usando la seguente funzione:

importDXF.export(objectslist, filename, nospline=False, lwPoly=False)
  • For the Windows OS: use a / (forward slash) as the path separator in filename.

Esempio:

import FreeCAD as App
import Draft
import importDXF

doc = App.newDocument()

polygon1 = Draft.make_polygon(3, radius=500)
polygon2 = Draft.make_polygon(5, radius=1500)

doc.recompute()

objects = [polygon1, polygon2]
importDXF.export(objects, "/home/user/Pictures/myfile.dxf")