Difference between revisions of "Getting started with 2D CAD drafting"

From Wiki.OSArch
m (→‎Converting from PDF to DXF: Add another link)
Line 53: Line 53:
 
Note: R14 support splines (curves), but R12 only support straight lines. It is recommended to check [http://cutlings.wasbo.net/svg-to-dxf-in-inkscape-v1-0/ this post] for more information.
 
Note: R14 support splines (curves), but R12 only support straight lines. It is recommended to check [http://cutlings.wasbo.net/svg-to-dxf-in-inkscape-v1-0/ this post] for more information.
  
As an option you can use [https://www.scribus.net/ Scribus] to open a PDF file to be exported as SVG file. Then you can open the SVG file to save it as DXF format with Inkscape. On the another hand, you can follow [https://thinkmoult.com/how-to-bulk-convert-pdf-to-dxf-or-dwg.html this tutorial using Inkscape and pstoedit].
+
As an option you can use [https://www.scribus.net/ Scribus] to open a PDF file to be exported as SVG file. Then you can open the SVG file to save it as DXF format with Inkscape. On the other hand, you can follow [https://thinkmoult.com/how-to-bulk-convert-pdf-to-dxf-or-dwg.html this tutorial using Inkscape and pstoedit].
  
 
= Switching to free/libre software =
 
= Switching to free/libre software =

Revision as of 00:57, 6 May 2021

Computer Aided Drafting (CAD) in 2D is an important part of many design workflows, some would say legacy workflows. It is a digital extensions of hand made technical drawings.

The problem

The field of 2D CAD within the AEC industry is currently dominated by AutoCAD, and in particular, the proprietary DWG file format. Heavy reliance on AutoCAD, along with the tight control that parent company Autodesk exerts over the proprietary DWG file format, both stifles innovation and perpetuates proprietary software in our industry. In contrast open formats support users freedom.

To make the switch away from proprietary software and file formats, there are two key ways in which you can make a difference in the industry. The first is by requesting and producing the open DXF format instead of the proprietary DWG format. The second is by switching from AutoCAD to another software entirely.

Switch from DWG to DXF

Drawing Exchange Format (DXF) is an open format that provides many similar features to Drawing (DWG). In general, DXF is much more widely supported and has much better cross-platform support. It is extremely easy to switch. Almost all CAD software has the ability to read and write DXF, so it is simply a manner of making it a habit to use one instead of the other. It is also usually a good idea to specify DXF as a digital deliverable in contracts. Most BIM projects currently specify IFC as an OpenBIM format, but neglect to also specify DXF as an open format.

If a DWG file is provided, and it is not possible to ask for the provider to provide a DXF instead, you have a few options. The first is to open the DWG with QCAD or LibreCAD, and then convert it to a DXF yourself. Of the two, QCAD's support for DWG far surpasses LibreCAD, but unfortunately relies on ODA.

FreeCAD 0.19 linux version (appimage) can import DWG files based on LibreDWG library, and eventually export with this format too. To install this library on Windows version see this FreeCAD documentation.

If it is not possible to submit DXFs for a project, for example if a client specifically request only DWGs and you are unable to convince them otherwise (though there may be little technical reason for them to do so), QCAD may be used to save DWGs. LibreCAD is unable to create DWGs, at the moment.

If you have a lot to convert, or if the conversion is unsatisfactory, or if you use neither LibreCAD or QCAD (such as if you are using Blender or programmatically generating DXFs), as a fallback option you may use the proprietary ODA File Converter, or the proprietary ODA Online Converter. Although this is proprietary software, it is mentioned on the OSArch wiki because the Open Design Alliance (ODA) has debatably helped improve access the open data standards in the AEC industry due to their work in reverse engineering the DWG file format, and the ODA library is also used in QCAD under the hood, and it is cross-platform.

A comparison table is provided to help people learn the difference between the two formats. See also the more general File format comparison

Feature DWG DXF
The majority of basic drafting, including lines, text, dimensions, hatching, colours, and layers Supported Supported
Easy to use cross-platform and across all CAD tools Not supported. DWG is inconvenient to use with free software as well as cross-platform. Users are usually required to use proprietary software to use DWG. Supported
Storage in ASCII for open data parsing Not supported Supported
Storage in binary for efficient file sizes Supported Supported (Note: A common misconception is that DXF is only ASCII. DXF actually has an ASCII and a Binary variant)
3D lines and points, common in survey drawings Supported Supported (Note: A common misconception is that DXF does not support 3D. This is not true)

Converting from PDF to DXF

In many cases, 2D drafting sheets can be found under PDF format. For these cases you can convert these files to DXF files, suitable for further edition with CAD software. Inkscape 1.0 has options to open and save both PDF and DXF files. To work as converter, Inkscape can open a PDF file and with the function "Save a copy" you will have the option of Save as type: Desktop Cutting Plotter (AutoCAD DXF R12 and R14) format. It is important to notice that the original PDF must be a vector drawing (no bitmap). Also, Inkscape 1.0 can open files with AutoCAD DXF R13 extension. Note: R14 support splines (curves), but R12 only support straight lines. It is recommended to check this post for more information.

As an option you can use Scribus to open a PDF file to be exported as SVG file. Then you can open the SVG file to save it as DXF format with Inkscape. On the other hand, you can follow this tutorial using Inkscape and pstoedit.

Switching to free/libre software

While there are very advanced free/libre 3D geometry applications, there are very few 2D applications. By the far the most feature rich is LibreCAD is a free/libre alternative to AutoCAD

  • QCAD is a free/libre multiplatform alternative to AutoCAD (QCAD Professional is the paid version, QCAD Community is libre software).
  • FreeCAD has three workbenches useful for 2D drafting, Sketcher, Draft & Techdraw. TechDraw is the most advanced and sees most development.
  • Inkscape & Krita have been used by some for drafting. You can use Inkscape as PDF/DXF converter, for drawing edition and presentation improvement. And then, export a final PDF/DXF file.
  • Libre Office Draw can open DXF files version 2004 or earlier, but it cannot make significant edition. Also, it only can export PDF/SVG format.
  • LX-Viewer (Linux Drawing Viewer) is a program that will allow you to open, view, print DXF files. But it cannot make edition.

See also