Repository navigation
Tools Database
The Tools Database (tool library) stores cutting tools with their default parameters. A plugin can add a tool from the library to its own tool table. Use it when you use the same tools in many jobs.
- Menu: Options > Tools Database.
- Shortcut:
Ctrl+D. - A plugin opens the library in "add" mode with its Add from DB button. The library shows the buttons Add selected tools and Cancel.
- Press
Ctrl+Dto open the library in its own tab. - Select the Filter by operation combo box. Choose All operations, or one operation (for example Milling).
- Right-click the table and choose Add to DB. A new tool named
new_tool_1is added. - Change the Name, the Tool Dia, and the parameters on the right side.
- Click Save. The library is saved to
tools.sqlite3in the data folder.
The table has one row for each tool. The columns are:
| Column | Description |
|---|---|
| ID | The record number. It is a positive whole number and it is kept when the library is saved. |
| Name | The text name of the tool (the field Name in the properties panel). |
| Operation | The operation that uses the tool: General, Milling, Drilling, Isolation, Paint, NCC, or Cutout. |
| Diameter | The tool diameter (mm, or inch in an inch project). |
| Shape | The tool shape: C1, C2, C3, C4, B, V, or L. |
A record that cannot be read is shown in red. Its tooltip gives the reason (Skipped: ...). Such a record stays in the file, but you cannot edit or use it.
Each record has these top-level fields:
| Field | Type | Description |
|---|---|---|
name |
text | The tool name. It cannot be empty. |
tooldia |
number | The tool diameter. It must be greater than 0. |
data |
dictionary | All other settings (below). |
The data dictionary holds these fields:
| Field | Type | Description |
|---|---|---|
tool_target |
0 to 6 | The operation: 0 General, 1 Milling, 2 Drilling, 3 Isolation, 4 Paint, 5 NCC, 6 Cutout. |
tol_min, tol_max
|
number | The diameter tolerance range. 0 <= tol_min <= tol_max. Used when no exact diameter matches. |
tools_mill_tool_shape |
0 to 6 | The shape (C1 to L, as in the table). |
tools_mill_job_type |
0 to 3 | The job type: 0 Roughing, 1 Finishing, 2 Isolation, 3 Polishing. |
tools_mill_offset_type |
0 to 3 | The offset: 0 Path, 1 In, 2 Out, 3 Custom. |
tools_mill_offset_value |
number | The custom offset value. |
tools_cutout_gap_type |
0 to 2 | The gap type: 0 Bridge, 1 Thin, 2 M-Bites. Old values b, bt, mb are converted. |
tools_drill_tool_order |
no, fwd, rev
|
The drill order option (factory value no). |
plot |
true or false | Show the tool in the plot. |
seg_x, seg_y
|
number | Segmentation values, taken from the Geometry preferences when a tool is added. |
The other fields start with the prefix of their operation. Each operation uses these prefixes:
| Operation | Fields used (prefixes) |
|---|---|
| General | all prefixes |
| Milling | tools_mill_ |
| Drilling | tools_drill_ |
| Isolation |
tools_iso_, tools_mill_
|
| Paint |
tools_paint_, tools_mill_
|
| NCC |
tools_ncc_, tools_mill_
|
| Cutout |
tools_cutout_, tools_mill_
|
The factory values are in defaults.py. Examples: tools_mill_cutz (Cut Z, -2.4 mm), tools_mill_feedrate (120), tools_mill_feedrate_z (60), tools_mill_depthperpass (0.8), tools_mill_optimization_type (R), tools_drill_cutz (-1.7), tools_drill_peck_depth (0.5), tools_iso_passes (1), tools_ncc_overlap (40), tools_paint_overlap (20), tools_cutout_margin (0.1).
Screenshot placeholder:
images/Tools-Database-1.png- the library tab with the table, the filter combo box and the properties panel of one Milling tool.
- The default file is
tools.sqlite3in the data folder (see Preferences Overview for the folder). - The file is an SQLite database with two tables:
-
metadata(keysrevisionandunits). -
tools(columnsid,name,diameter,target,tol_min,tol_max,shape,position, andrecord, which holds the record as JSON).
-
- Each save adds 1 to
revision. If another program changes the file, the save is refused and you must reopen the library. - The library stores its units (mm, or inch in an inch project). If the application units differ from the library units, the library cannot be added to, saved or used. The tool shows the message Application units changed. Reopen the tool library before using it. Reopen the library to continue.
-
Export DB writes the library to a file. Choose
.sqlite3or JSON (.json,.FlatDB,.TXT). A JSON file has this form:{"format": "flatcam-tools", "version": 1, "units": "MM", "tools": {...}}. - Import DB adds the tools of a file to the library. A tool that is already in the library is not added again. An ID that is already used gets a new ID.
- Replace library from file... replaces the whole library with the file. You are asked to save your open changes first.
- Import and export skip a bad record and report the number of skipped records.
- Add to DB creates a tool. Its defaults are the defaults of the selected operation. Its diameter is the first value of Tools Dia in the Milling preferences.
- Copy from DB copies the selected tools into the library.
- Delete from DB removes the selected tools from the library. Click Save to keep the removal.
- A plugin (Milling, Isolation, NCC, Paint, Cutout, Drilling) starts the library with Add from DB. When you click Add selected tools, each selected tool is checked. Only tools for the plugin's operation (or General tools) can be added.
- The plugin receives the tool data with the prefixes of its operation only.
- A plugin that looks up a tool by diameter uses the same rule: an exact diameter match wins. Otherwise a tolerance range (
tol_mintotol_max) is used. A record for the specific operation wins over a General record. If more than one record is equally suitable, the result is not used.
- A tool name cannot be empty.
- A diameter must be a finite number above 0.
- Any tool that is not valid is skipped when a file is loaded, and is marked in the table.
FlatCAM Evo Manual · Source code · Report a problem · MIT license
Start here
- Installation
- Getting Started
- Tutorial: Single-Sided PCB
- Tutorial: Double-Sided PCB
- User Interface
- Keyboard Shortcuts
- Glossary
- FAQ and Troubleshooting
Files and projects
Objects
Editors
PCB operations
- Isolation Routing
- Non-Copper Clearing
- Paint
- Cutout
- Drilling
- Milling
- Follow
- Double-Sided
- Solder Paste
- Film
- Panelize
- Copper Thieving
- Fiducials
- Markers
- Punch Gerber
- Invert Gerber
- Etch Compensation
- Extract
- Rules Check
- QR Code
Utility plugins
- Align Objects
- Calculators
- Distance · Object Distance
- Optimal
- Move · Transform
- Subtract
- Image Import · PDF Import
- PCB Wizard
- Report
- Tcl Shell
Machine control (in development)
Advanced
- Tools Database
- Preprocessors
- Path Optimization
- Tcl Scripting
- Tcl Command Reference
- Developer Guide
- Translating
Preferences