@things-factory/figure-viewer 10.1.206 → 10.1.208

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/figure-viewer",
3
- "version": "10.1.206",
3
+ "version": "10.1.208",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -27,13 +27,13 @@
27
27
  "test": "FIGURE_FREEZE_COMPILED=1 node --import ./test/resolve-ts-siblings.mjs --test test/*.test.ts"
28
28
  },
29
29
  "dependencies": {
30
- "@hatiolab/figure-model": "^0.9.6",
31
- "@hatiolab/things-scene": "^10.1.95",
30
+ "@hatiolab/figure-model": "^0.10.0",
31
+ "@hatiolab/things-scene": "^10.1.99",
32
32
  "@material/web": "^2.0.0",
33
33
  "@operato/i18n": "^10.0.0",
34
34
  "@operato/styles": "^10.0.0",
35
35
  "@things-factory/styles": "^10.1.123",
36
36
  "lit": "^3.1.2"
37
37
  },
38
- "gitHead": "18588a058a4a6cb21c379b2da5517e077c6442ba"
38
+ "gitHead": "ffc1ceaa9471b9f4a9b86f46c3021f2fed72d17d"
39
39
  }
@@ -5,9 +5,9 @@
5
5
  import { test } from 'node:test'
6
6
  import assert from 'node:assert/strict'
7
7
 
8
- import { addFigureBox, applyFigureAuthoring, createFigureAsset, proposeFigureOccupancy } from '@hatiolab/figure-model'
8
+ import { addFigureBox, applyFigureAuthoring, createFigureAsset } from '@hatiolab/figure-model'
9
9
 
10
- import { authoredSizeOf, occupancyAtSize, PREVIEW_WAYS, previewClampsOf, previewInstances, previewOneInstance, previewTypeOf, setupPartOf, sizeRangeOf, sizeSpanOf, sizeWithinRange } from '../client/preview-model.ts'
10
+ import { authoredSizeOf, bodyAtSize, PREVIEW_WAYS, previewClampsOf, previewInstances, previewOneInstance, previewTypeOf, setupPartOf, sizeRangeOf, sizeSpanOf, sizeWithinRange } from '../client/preview-model.ts'
11
11
 
12
12
  test('여덟 — 기준과 일곱 조합, 한 줄에 넷, 늘린 축만 두 배 · 높이는 늘 적는다', () => {
13
13
  assert.deepEqual(PREVIEW_WAYS.map(w => w.name), ['base', 'x', 'y', 'z', 'x·y', 'x·z', 'y·z', 'x·y·z'])
@@ -86,15 +86,16 @@ test('크기 범위 — 좁히지 않은 끝은 부품이 허락하는 만큼,
86
86
  assert.equal(sizeWithinRange(asset, 'x', 100), x.min)
87
87
  })
88
88
 
89
- test('인스턴스의 상자는 그 크기에서의 차지하는 공간이다 — 크기 입력값이 아니다 (첫 15분 재측정, 2026-10-16)', () => {
90
- let asset = addFigureBox(createFigureAsset('Padded'), { id: 'body', size: { x: 1000, y: 200, z: 400 }, position: { x: 0, y: 100, z: 0 } })
89
+ test('인스턴스의 상자는 그 크기에서의 몸체다 — 크기 입력값이 아니다 (첫 15분 재측정 2026-10-16, ADR-0145)', () => {
90
+ let asset = addFigureBox(createFigureAsset('Knobbed'), { id: 'body', size: { x: 1000, y: 200, z: 400 }, position: { x: 0, y: 100, z: 0 } })
91
91
  asset = applyFigureAuthoring(asset, { kind: 'follow-size', part: 'body' })
92
- assert.equal(occupancyAtSize(asset, { x: 1000, y: 200, z: 400 }) === undefined || !!asset.occupancy, true)
93
- asset = applyFigureAuthoring(asset, { kind: 'declare-occupancy', proposal: proposeFigureOccupancy(asset, { over: 'range' }), padding: { x: 100, y: 0, z: 0 } })
94
- const at = (x: number) => occupancyAtSize(asset, { x, y: 200, z: 400 })!
95
- assert.deepEqual([Math.round(at(1000).x), Math.round(at(3000).x)], [1200, 3200], '부품의 너비에 여유 양쪽 100 mm')
96
- assert.equal(occupancyAtSize(addFigureBox(createFigureAsset('Bare'), { id: 'b', size: { x: 1, y: 1, z: 1 }, position: { x: 0, y: 0, z: 0 } }), { x: 1, y: 1, z: 1 }), undefined, '공간이 없으면 없다')
92
+ /* A 100 mm knob on the body's right face: the body reaches past the size by it. */
93
+ asset = addFigureBox(asset, { id: 'knob', size: { x: 100, y: 100, z: 100 }, position: { x: 550, y: 100, z: 0 } })
94
+ asset = applyFigureAuthoring(asset, { kind: 'attach', part: 'knob', to: { part: 'body', face: 'right' } })
95
+ const at = (x: number) => bodyAtSize(asset, { x, y: 200, z: 400 })!
96
+ assert.deepEqual([Math.round(at(1000).x), Math.round(at(3000).x)], [1100, 3100], '부품의 너비에 손잡이 100 mm')
97
+ assert.equal(bodyAtSize(addFigureBox(createFigureAsset('Bare'), { id: 'b', size: { x: 1, y: 1, z: 1 }, position: { x: 0, y: 0, z: 0 } }), { x: 1, y: 1, z: 1 }), undefined, '크기 입력이 없으면 없다')
97
98
  /* The eight stand in their boxes too. */
98
99
  const { components } = previewInstances('T', { x: 1000, y: 200, z: 400 }, asked => at(asked.x))
99
- assert.equal(components[1]!.width, 2200, 'x 두 배: 2000 + 여유 200')
100
+ assert.equal(components[1]!.width, 2100, 'x 두 배: 2000 + 손잡이 100')
100
101
  })