@chestnutlabs/toolpath-core

中文文档
0.21.1发布于 2026/11/04MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 3698

Neutral ToolpathIR and capability model for the Chestnut Labs G-code Preview toolpath stack.

原始使用文档

@chestnutlabs/toolpath-core

Neutral ToolpathIR and capability model for the Chestnut Labs G-code Preview toolpath stack. This is the replacement seam for the whole stack: the parser writes it, renderers and analyzers read it. See docs/design/DD-001.

Design rules

  • The canonical IR is plain, transferable data — a small header plus structure-of-arrays typed buffers (not object graphs). Positions are Float32 deltas relative to a Float64 originOffset (floating origin, DD-001 §4.6).
  • Unknown is a valid state. Optional/derived data carries a Confidence (known | inferred | approximated | unavailable); missing values are sentinels (NaN, 0), never fabricated data.
  • This package depends on nothing — no three, DOM, Vue, or AnyBridge (DD-002 boundary).

Contents (scaffold)

  • ir.ts — ToolpathIR, header, segments (SoA), layers/tools/objects, capabilities, MoveKind, FeatureRole, IR_SCHEMA_VERSION.
  • builder.ts — ToolpathIRBuilder (accumulate segments → canonical typed-array IR).
  • source-index.ts — buildSourceIndex / segmentAtByte (byte offset → segment; live-progress input).
  • bounds.ts — extrude-only and travel-inclusive bounds.
npm run build      -w @chestnutlabs/toolpath-core   # tsc -> dist
npm run typecheck  -w @chestnutlabs/toolpath-core
npm test           -w @chestnutlabs/toolpath-core

Status: scaffold (E1, issue #32). The builder accumulates into number arrays and converts to typed arrays in finalize(); E2's worker parser will write directly into growable typed buffers. Package extraction/publish is gated by DD-002 §7 and the release DD (E7/DD-008).

版本与发布记录

@chestnutlabs/toolpath-core 共发布 25 个版本,首次发布于 2026/07/24;过去 12 个月发布了 25 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.21.1latest2026/11/045 天前
0.21.02026/10/2911 天前
0.20.12026/09/032 个月前
0.20.02026/08/312 个月前
0.19.02026/08/282 个月前
0.18.02026/08/282 个月前

关于 @chestnutlabs/toolpath-core 的常见问题

@chestnutlabs/toolpath-core 是什么?

Neutral ToolpathIR and capability model for the Chestnut Labs G-code Preview toolpath stack.

如何安装 @chestnutlabs/toolpath-core?

在项目目录运行 npm install @chestnutlabs/toolpath-core,或使用 pnpm add / yarn add / bun add。

@chestnutlabs/toolpath-core 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@chestnutlabs/toolpath-core 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@chestnutlabs/toolpath-core 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@chestnutlabs/toolpath-core 可以商用吗?

@chestnutlabs/toolpath-core 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@chestnutlabs/toolpath-core 的下载量有多少?

根据 npm 官方下载统计,@chestnutlabs/toolpath-core 在 2026/10/10 – 2026/11/08 这 30 天内被下载 3,698 次,日均约 123 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@chestnutlabs/toolpath-core 还在维护吗?

最新版本 0.21.1 发布于 2026/11/04(5 天前);至今共发布 25 个版本,其中过去 12 个月发布了 25 个;首次发布于 2026/07/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。