The simple and flexible FreeCAD name convention checker
fcnc
tool allows you to check your custom name convention of your
FreeCAD models (based on
fcinfo output).
FreeCAD
files.fcinfo
.Get help:
fcnc --help
Get command help:
fcnc <command> --help
Check constraints:
# Run fcinfo ./fcinfo my_freecad_model.FCStd > any_file.fcinfo # Check name convention fcnc check my_constraints.ts any_file.fcinfo or*globs?.fcinfo
Available on jsr:@jotsr/fcnc.
import { type Constraint } from 'jsr:@jotsr/fcnc' const snakeCaseLabel = /[a-z][a-z0-9_]*[a-z0-9]/ const fileLabel: Constraint = { //Type of constraint kind: 'file:label', //Pattern to match ($fields refers to custom regexp) pattern: '$label.$type', //All "$" fields need to be defined fields: { //Array of regexp to match against (order matter) label: [snakeCaseLabel], type: [/part/, /assembly/], }, } //name convention file should export array of constraints as default export export default [fileLabel]
Without install
deno run --allow-read=your-dir jsr:@jotsr/fcnc
With install
deno install --allow-read --allow-net=api.github.com -rf jsr:@jotsr/fcnc
Deno permissions explanations
--allow-read
to read input files.--allow-net=api.github.com
to upgrade the cli.# Linux curl -fsSLo fcnc https://github.com/JOTSR/release/download/$VERSION/fcnc-x86_64-unknown-linux-gnu.gz curl -fsSLo fcnc https://github.com/JOTSR/release/download/$VERSION/fcnc-aarch64-unknown-linux-gnu.gz # macOS curl -fsSLo fcnc https://github.com/JOTSR/release/download/$VERSION/fcnc-x86_64-apple-darwin.gz curl -fsSLo fcnc https://github.com/JOTSR/release/download/$VERSION/fcnc-aarch64-apple-darwin.gz # Windows curl -fsSLo fcnc.exe https://github.com/JOTSR/release/download/$VERSION/fcnc-x86_64-pc-windows-msvc.exe.gz
fcnc --help
.Available on jsr:@jotsr/fcnc.
Any kind of contribution is welcomed. Please read contributing guidelines before and respect contributor covenant.
Required dependencies:
deno
To run project (code, ci, ...).Before first commit or after editing ./deno.json
:
deno task hooks:install
.Using VSCode:
fcnc.code-workspace
..devcontainer
.Add Package
deno add jsr:@jotsr/fcnc
Import symbol
import * as fcnc from "@jotsr/fcnc";
Import directly with a jsr specifier
import * as fcnc from "jsr:@jotsr/fcnc";