printbench 0.5.3 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +2 -2
  2. package/dist/printbench.js +3364 -3186
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -91,7 +91,7 @@ function onExported(payload: PrintBenchExportedPayload) {
91
91
  | `bedSizeMm` | `{ x, y, z }` | — | 宿主默认打印床体积(mm:X/Z 床面,Y 高度)。挂载时写入设置一次,之后仍可在布局区/设置中修改 |
92
92
  | `showBedVolume` | `boolean` | — | 宿主默认是否显示打印床线框。挂载时写入设置一次,之后仍可开关(未传时默认隐藏) |
93
93
  | `diagnosisZIndex` | `number` | `100` | 诊断浮层 `z-index`。也可在外层设 CSS 变量 `--printbench-diagnosis-z` |
94
- | `features` | `{ numeric?, primitives?, split?, autoSplit?, drafts?, extras?, layout?, importUnit?, hideEmpty?, hideStatusBar?, hidePanelModeToggle?, … }` | 能力项默认 `false` | 进阶能力。缺省精简:左栏仅导入 / 零件 / 导出 / 快照。未开 `drafts` 时不读不写自动草稿。导入单位优先用文件声明,否则按包围盒尺寸推测 mm/cm/m 再换算到内部毫米;开 `importUnit` 时可再确认。`split` 为切面拆件;`autoSplit` 为「自动拆件」按钮(默认隐藏,需显式打开)。`layout` 打开贴地 / 镜像 / 目标尺寸缩放 / 选面朝下与打印床体积。`hideEmpty` / `hideStatusBar` / `hidePanelModeToggle` 为 `true` 时分别隐藏空画布提示、底栏状态条、零件栏悬浮/通栏切换按钮。 |
94
+ | `features` | `{ numeric?, primitives?, split?, autoSplit?, drafts?, extras?, layout?, importUnit?, hideEmpty?, hideTour?, hideStatusBar?, hidePanelModeToggle?, … }` | 能力项默认 `false` | 进阶能力。缺省精简:左栏仅导入 / 零件 / 导出 / 快照。未开 `drafts` 时不读不写自动草稿。导入单位优先用文件声明,否则按包围盒尺寸推测 mm/cm/m 再换算到内部毫米;开 `importUnit` 时可再确认。`split` 为切面拆件;`autoSplit` 为「自动拆件」按钮(默认隐藏,需显式打开)。`layout` 打开贴地 / 镜像 / 目标尺寸缩放 / 选面朝下与打印床体积。`hideEmpty` / `hideTour` / `hideStatusBar` / `hidePanelModeToggle` 为 `true` 时分别隐藏空画布提示、首次引导 Tour(可与 `extras` 同开)、底栏状态条、零件栏悬浮/通栏切换按钮。 |
95
95
 
96
96
 
97
97
  嵌入预览示例(宿主列表 + 色板 + 自定义导出 + 按最长边缩放):
@@ -196,7 +196,7 @@ async function upload() {
196
196
  | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
197
197
  | `exportFile(options?)` | 不打开插件对话框。`action`: `'download'` \| `'upload'`;`format`: `'stl'` \| `'3mf'` \| `'glb'`;`unit` 默认 mm;`longestEdgeMm` 可选,按该毫米最长边等比缩放后再导出;`silent: true` 跳过黄级确认。红级阻断返回 `null`。成功返回与 `exported` 相同的 payload。 |
198
198
  | `exportSnapshot(options?)` | 按当前视角截取模型图(不含网格、手柄、切面)。`action`: `'download'` \| `'upload'`;`format`: `'png'`(默认)\| `'jpeg'`;`quality` 仅 JPEG。成功返回与 `snapshot` 相同的 payload。`customExport` 时不本地下载、不 POST。 |
199
- | `autoSplit(options?)` | 多零件接触面自动装配(≥2 件)。检测接触后一端保留凸起、一端挖槽,再加卡扣。`connector`: `'sphere'` \| `'square'` \| `'ballSnap'`(默认 `sphere`);`connectorSize` 可选;`silent: true` 时不弹修复确认,未封闭则返回 `{ ok: false, needsRepair: true, repairPartNames }`。成功 `{ ok: true }`。 |
199
+ | `autoSplit(options?)` | 多零件接触面自动装配(≥2 件)。检测接触后一端保留凸起、一端挖槽,再加卡扣。`connector`: `'ballSnap'` \| `'sphere'` \| `'square'`(默认 `ballSnap` 爪扣);`connectorSize` 可选;`silent: true` 时不弹修复确认,未封闭则返回 `{ ok: false, needsRepair: true, repairPartNames }`。成功 `{ ok: true }`。 |
200
200
  | `getPartBounds()` | 同步返回与 `@parts` 相同结构的零件列表(含 `initialSize` / `size`)。无模型时为 `[]`。 |
201
201
  | `getBBox()` | 同步返回与 `@bbox` 相同结构的整模载荷(含 `parts`)。尚无诊断包围盒时为 `null`。 |
202
202