Project URL: https://github.com/LibreCAD/LibreCAD
Official website: https://librecad.org/
Wiki: https://github.com/LibreCAD/LibreCAD/wiki
License: GPL-2.0
Overview
Main features of LibreCAD:
- 2D vector drawing: lines/circles/arcs/ellipses/polylines/splines/dimensions/text/hatches
- Layers, blocks, attributes, coordinate input (absolute/relative/polar)
- Files: DXF (R12/R2007 read and write), PDF/SVG/PNG (export), DWG (converted via ODA File Converter or LibreDWG)
- Cross-platform: Windows, macOS, Linux
- Internationalization: includes a complete Chinese interface
Native DWG read/write support is limited; it is recommended to first convert to DXF using LibreDWG or ODA.
Installation
# Linux
sudo apt install librecad
# macOS
brew install librecad
# Windows / 其它:从官网下载
Interface and basic operations
| Area | Purpose |
|---|---|
| Top menu | File / Edit / View / Plugins / Tools / Drawing / Dimension / Modify / Info |
| Left toolbar | Drawing (CAD Toolbars), snapping, modification |
| Command line (invoked by pressing ":") | AutoCAD-like command input |
| Layer management | Layer List on the right |
| Block management | Block List on the right |
Common command abbreviations
| Command | Function |
|---|---|
li |
line straight line |
ci |
circle circle |
re |
rectangle |
pl |
polyline polyline |
tr |
trim trim |
mi |
mirror mirror |
co / cp |
copy |
mv |
move |
ro |
rotate |
sc |
scale |
os |
osnap object snap |
di |
distance measure distance |
pu |
purge |
Coordinate input
| Input | Meaning |
|---|---|
100,50 |
Absolute Cartesian |
@100,50 |
Relative Cartesian (relative to previous point) |
@100<30 |
Relative polar (length<angle) |
Layers and blocks
- Layers: right panel → New, where you can set color/linetype/lineweight/print toggle
- Blocks: select elements → right-click → Create Block, or Drawing → Block → New
- The current layer is switched in the status bar; lock/hide/freeze buttons
Dimensions
- Linear, aligned, radius, diameter, angular, leader
- Dimension style:
Options → Drawing Preferences → Dimensions - Global dimension scale + text height
Hatches and text
- Hatch: select boundary → choose pattern (ANSI/ISO/Earth/Solid) + scale + angle
- Text: single-line / multi-line; supports SHX and TTF fonts; for Chinese use
Noto Sans CJK SC, etc.
File interaction
# DXF(自带)
File → Open / Save As / Export
# DWG → DXF(需要 ODA File Converter)
ODAFileConverter input.dwg . ACAD2010 DXF 1 0
# 或
dwg2dxf -y input.dwg # LibreDWG
# 导出 PDF
File → Export → Export as PDF
Command line (no interface)
# 启动并运行命令脚本(需自定义脚本插件支持)
librecad --no-startup-window
# 配合 dxf-tools / Python 脚本批处理
LibreCAD's own scripting capability is relatively weak; for batch conversion it is recommended to combine:
- LibreDWG converts DWG ↔ DXF
ezdxf(Python library) for DXF parsing and generationinkscapefor DXF → SVG/PDF
Using ezdxf with LibreCAD
import ezdxf
doc = ezdxf.new('R2010')
msp = doc.modelspace()
msp.add_line((0,0), (100,0))
msp.add_circle((50,0), 10)
doc.saveas('out.dxf') # LibreCAD 可直接打开
Performance and stability
- Manage large drawings by layer, turn off unnecessary layers
- Turn off too many options in OSNAP
- Before exporting PDF,
Tools → Recalculate Dimensions - Back up .dxf; DXF R2007 contains more complete information than R12
- Avoid Chinese paths under Windows
Common problems
| Problem | Solution |
|---|---|
| Garbled Chinese text | Switch the font to TTF (SimHei/Noto), place SHX font files in fonts/ |
| DWG cannot be opened | Convert DXF with ODA File Converter or LibreDWG |
| Annotation scale is too small to see | Drawing Preferences → Dimensions → General Scale |
| Crashes on open | Delete ~/.config/LibreCAD/LibreCAD.conf reset |
| Unable to fill | Close the polyline then hatch; check hole/outer boundary order |
AI usage recommendations
- Recommended workflow modes: The AI assistant should prioritize DXF as the intermediate exchange format—DWG files should first be converted to DXF via ODA File Converter or LibreDWG, then edited with LibreCAD. For batch-processing scenarios, use
ezdxf(Python library) together with CLI tools. - Key considerations: ① Native DWG support is limited, so DXF should be the primary exchange format; ② Chinese text requires TTF fonts (
Noto Sans CJK SC/SimHei), and SHX must be placed in thefonts/directory; ③ Large drawings should be managed by layer, and unnecessary OSNAP should be turned off; ④ Command abbreviations (li/ci/pl/tr/mi) are similar to AutoCAD but not exactly the same. - Common code patterns: GUI interaction: press
:to bring up the command line → enter the command abbreviation → coordinate input (@100,50relative Cartesian,@100<30relative polar). Python batch processing:ezdxf.new('R2010')→msp.add_line/add_circle→doc.saveas('out.dxf')。
Typical workflows
Workflow 1: Drawing an architectural floor plan
- Create a new file and set drawing units (Drawing Preferences → Units → mm)
- Create layers (walls/doors and windows/annotations/text) and set colors and line types
- Use the
licommand to draw axes,reto draw rectangular walls,cito draw circular columns trtrim intersecting lines,pldraw polyline outlines- Add linear/aligned dimensions (
dimlinear/dimaligned) - Export PDF for printing, or save DXF R2007 for AutoCAD exchange
Workflow 2: Batch convert DWG → DXF
- Install the ODA File Converter or LibreDWG tools (
dwg2dxf) ODAFileConverter input.dwg . ACAD2010 DXF 1 0ordwg2dxf -y input.dwg- Open the generated DXF in LibreCAD and check Chinese text and layers
- If necessary, use the
ezdxfPython script to fix format issues - Save as R2007 DXF to ensure compatibility
Related skills
- qcad — 2D CAD software, ECMAScript scripting extensions and DWG/DXF processing:../qcad/SKILL.md
- libredwg — DWG/DXF file format read/write library (C language):../libredwg/SKILL.md
- lightcad — Web 2D CAD framework, DXF import/export:../lightcad/SKILL.md
- ifoxcad — AutoCAD .NET secondary development framework:../ifoxcad/SKILL.md
Reference resources
- Repository:https://github.com/LibreCAD/LibreCAD
- Wiki:https://github.com/LibreCAD/LibreCAD/wiki
- User manual:https://librecad.readthedocs.io/
- Chinese tutorial (znlgis):https://znlgis.github.io/cad/tutorial/librecad/