printbench 0.8.7 → 0.8.9
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.
- package/README.md +7 -6
- package/dist/chunks/{3mf-CH9wGJ51.js → 3mf-CERt0hTC.js} +1 -1
- package/dist/chunks/{glb-XZ3fyf6P.js → glb-it6uqdSj.js} +1 -1
- package/dist/chunks/{index-BHL8_oaU.js → index-87IMinge.js} +1586 -1566
- package/dist/chunks/{loadModel-BakblLqg.js → loadModel-Bq1kFHd-.js} +3 -3
- package/dist/chunks/{loadQiuSnap-DGQ-INTw.js → loadQiuSnap-BQ9KN0r4.js} +1 -1
- package/dist/chunks/{stl-BJYtBUKU.js → stl-B5zavYOo.js} +1 -1
- package/dist/printbench.css +1 -1
- package/dist/printbench.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -199,7 +199,7 @@ async function upload() {
|
|
|
199
199
|
| `part-colors-change` | `Record<string, string>` | 工作台内改色时抛出(嵌入预览以 `partColors` 为准) |
|
|
200
200
|
| `annotations-change` | `{ schema, version, unit, coordinateSpace, fileName?, generatedAt, annotations, reason }` | 批注新增 / 修改 / 删除时抛出(`reason`: `add` \| `update` \| `remove`)。仅在 `features.annotations` 开启时触发 |
|
|
201
201
|
| `annotation-select` | `string \| null` | 当前选中批注变化(列表、画布标记或 ref API);关闭批注能力时不触发 |
|
|
202
|
-
| `annotation-mode-change` | `'off' \| 'place'` |
|
|
202
|
+
| `annotation-mode-change` | `'off' \| 'place'` | 放置模式进出(Esc 或再次切换按钮 / `setAnnotationMode('off')`);新建成功不退出;仅在 `features.annotations` 开启时触发 |
|
|
203
203
|
| `annotation-click` | `string` | 点击画布标注点(随后仍会选中并飞到锚点) |
|
|
204
204
|
| `annotation-hover` | `string \| null` | 鼠标经过画布标注点;离开全部标记时为 `null` |
|
|
205
205
|
|
|
@@ -222,7 +222,7 @@ async function upload() {
|
|
|
222
222
|
| `exportAnnotations()` | 上面文档的格式化 JSON 字符串。 |
|
|
223
223
|
| `setAnnotations(input)` | 用数组 / 文档 / JSON 字符串替换批注列表。 |
|
|
224
224
|
| `addAnnotation(input)` | 以编程方式添加一条批注,返回新 `Annotation`;功能未开启时返回 `null`。 |
|
|
225
|
-
| `setAnnotationMode(mode)` | `'off'` \| `'place'`:进入 /
|
|
225
|
+
| `setAnnotationMode(mode)` | `'off'` \| `'place'`:进入 / 退出画布放置模式。`place` 下可连续点模型钉批注(点到已有标记则选中且不新建);新建成功不退出,需 Esc 或再次设为 `'off'`。 |
|
|
226
226
|
| `getAnnotationMode()` | 当前放置模式。 |
|
|
227
227
|
| `selectAnnotation(id)` | 选中批注,或传 `null` 清空;不飞相机。 |
|
|
228
228
|
| `getSelectedAnnotationId()` | 当前选中批注 id。 |
|
|
@@ -264,7 +264,7 @@ const notes = ref<PrintBenchAnnotationsPayload | undefined>()
|
|
|
264
264
|
</template>
|
|
265
265
|
```
|
|
266
266
|
|
|
267
|
-
|
|
267
|
+
用户可在面板内点「放置批注」进入连续放置(再点按钮或 Esc 退出);点模型表面可连续钉批注,点到已有标记会选中而非新建。支持级别、标题、说明与已解决标记。也可随时用 `ref` 读写:
|
|
268
268
|
|
|
269
269
|
```ts
|
|
270
270
|
import type { PrintBenchExpose } from 'printbench'
|
|
@@ -347,7 +347,7 @@ function removeSelected() {
|
|
|
347
347
|
|
|
348
348
|
<aside>
|
|
349
349
|
<button type="button" @click="togglePlace">
|
|
350
|
-
{{ placing ? '
|
|
350
|
+
{{ placing ? '放置中…(再点退出 / Esc)' : '放置批注' }}
|
|
351
351
|
</button>
|
|
352
352
|
<p v-if="hoveredId">悬停:{{ hoveredId }}</p>
|
|
353
353
|
|
|
@@ -379,8 +379,9 @@ function removeSelected() {
|
|
|
379
379
|
```
|
|
380
380
|
|
|
381
381
|
要点:
|
|
382
|
-
- `@annotation-mode-change`
|
|
382
|
+
- `@annotation-mode-change` 同步放置态;**新建成功不退出** `place`,仅 Esc / 再点按钮 / `setAnnotationMode('off')` 退出
|
|
383
383
|
- `@annotation-click` / `@annotation-hover` 响应画布标记手势;`@annotation-select` 覆盖列表与 API 选中
|
|
384
|
+
- 放置模式下点到已有标记:选中并飞行,**不新建、不退出放置**;点空白模型表面才钉新批注
|
|
384
385
|
- `annotationPanel: false` 时放置成功**不会**弹出右栏诊断浮层
|
|
385
386
|
|
|
386
387
|
#### 数据格式
|
|
@@ -463,7 +464,7 @@ function removeSelected() {
|
|
|
463
464
|
| Ctrl+S | 保存自动草稿(需打开 `features.drafts`) |
|
|
464
465
|
| 1 / 2 / 3 | 移动 / 旋转 / 缩放 |
|
|
465
466
|
| P | 切换工作台观察预览 |
|
|
466
|
-
| Esc |
|
|
467
|
+
| Esc | 取消批注放置、手柄、预览、测量、选面朝下 |
|
|
467
468
|
| F | 按模型自适应视角 |
|
|
468
469
|
| Shift | 变换吸附 |
|
|
469
470
|
| Ctrl | 多选、框选 |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Group as w, Mesh as l, MeshStandardMaterial as u, DoubleSide as h, Color as c } from "three";
|
|
2
2
|
import { GLTFExporter as p } from "three/examples/jsm/exporters/GLTFExporter.js";
|
|
3
|
-
import { b as d } from "./index-
|
|
3
|
+
import { b as d } from "./index-87IMinge.js";
|
|
4
4
|
async function G(r, e, n) {
|
|
5
5
|
const t = new w();
|
|
6
6
|
t.name = "PrintBench", r.forEach((f, o) => {
|