Draftː DXF

From FreeCAD Documentation
Revision as of 15:48, 25 October 2021 by FuzzyBot (talk | contribs) (Updating to match new version of source page)

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.

DWG

Because the DWG format is a proprietary, closed and undocumented format it is hard for open-source projects like FreeCAD to support it. That is why FreeCAD relies on external converters to read and write DWG files. To import a DWG file a converter is used to create a DXF first, which can then be processed by the FreeCAD DXF importer. When exporting to DWG the opposite conversion happens: the DXF created by the FreeCAD DXF exporter is turned into a DWG.

Note that the DXF format allows a 1:1 conversion of the DWG format. All applications that can read and write DWG files can do the same with DXF files, with no data loss. So asking for DXF files instead of DWG files, and supplying DXF files in turn, should not cause any problems.

There is built-in support for the following DWG converters:

See Import Export Preferences and FreeCAD and DWG Import for more information.

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")