@hatiolab/things-scene 10.1.77 → 10.1.79
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/dist-types/items/capacity-mixin.d.ts +7 -4
- package/dist-types/items/capacity-mixin.d.ts.map +1 -1
- package/dist-types/items/slot-layout/index.d.ts +0 -2
- package/dist-types/items/slot-layout/index.d.ts.map +1 -1
- package/dist-types/items/slot-layout/slot-layout.d.ts +159 -40
- package/dist-types/items/slot-layout/slot-layout.d.ts.map +1 -1
- package/dist-types/items/slot-layout/vec3.d.ts +6 -0
- package/dist-types/items/slot-layout/vec3.d.ts.map +1 -0
- package/package.json +2 -3
- package/things-scene-min.js +1 -1
- package/things-scene-min.js.map +1 -1
- package/things-scene-transfer.mjs +2 -2
- package/things-scene.mjs +1 -1
- package/things-scene.mjs.map +1 -1
- package/dist-types/items/slot-layout/layout-issue.d.ts +0 -35
- package/dist-types/items/slot-layout/layout-issue.d.ts.map +0 -1
- package/dist-types/items/slot-layout/slot-seat.d.ts +0 -65
- package/dist-types/items/slot-layout/slot-seat.d.ts.map +0 -1
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export type LayoutIssueCode =
|
|
2
|
-
/** 층이 하나 이상 있어야 한다 */
|
|
3
|
-
'TIERS_REQUIRED'
|
|
4
|
-
/** ON·IN·HANG 중 하나 */
|
|
5
|
-
| 'MOUNT_INVALID'
|
|
6
|
-
/** 층 번호는 1부터 빈 번호 없이 오름차순 */
|
|
7
|
-
| 'TIER_NUMBER_SEQUENCE'
|
|
8
|
-
/** 아래층보다 높아야 한다 */
|
|
9
|
-
| 'ELEVATION_NOT_ASCENDING'
|
|
10
|
-
/** 유한 수 */
|
|
11
|
-
| 'FINITE_NUMBER_REQUIRED'
|
|
12
|
-
/** 유한 양수 */
|
|
13
|
-
| 'POSITIVE_NUMBER_REQUIRED'
|
|
14
|
-
/** 양의 정수 */
|
|
15
|
-
| 'POSITIVE_INTEGER_REQUIRED'
|
|
16
|
-
/** 배열 */
|
|
17
|
-
| 'ARRAY_REQUIRED'
|
|
18
|
-
/** 객체 */
|
|
19
|
-
| 'OBJECT_REQUIRED'
|
|
20
|
-
/** X·Z 중 하나 */
|
|
21
|
-
| 'AXIS_INVALID'
|
|
22
|
-
/** SINGLE·ROW·GRID·CUSTOM 중 하나 */
|
|
23
|
-
| 'PATTERN_INVALID'
|
|
24
|
-
/** CUSTOM 자리 번호는 1부터 빈 번호 없이 */
|
|
25
|
-
| 'SLOT_NUMBER_SEQUENCE'
|
|
26
|
-
/** JSON 으로 저장할 수 없는 값 (params.value: NaN·Infinity·-Infinity) */
|
|
27
|
-
| 'NOT_PERSISTABLE';
|
|
28
|
-
export interface LayoutIssue {
|
|
29
|
-
code: LayoutIssueCode;
|
|
30
|
-
/** 값의 위치. 예 'tiers[0].layout.pitch'. 레이아웃 전체이면 빈 문자열 */
|
|
31
|
-
path: string;
|
|
32
|
-
params?: Record<string, string | number>;
|
|
33
|
-
}
|
|
34
|
-
export declare function layoutIssue(code: LayoutIssueCode, path: string, params?: Record<string, string | number>): LayoutIssue;
|
|
35
|
-
//# sourceMappingURL=layout-issue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout-issue.d.ts","sourceRoot":"","sources":["../../../src/items/slot-layout/layout-issue.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,eAAe;AACzB,sBAAsB;AACpB,gBAAgB;AAClB,sBAAsB;GACpB,eAAe;AACjB,6BAA6B;GAC3B,sBAAsB;AACxB,mBAAmB;GACjB,yBAAyB;AAC3B,WAAW;GACT,wBAAwB;AAC1B,YAAY;GACV,0BAA0B;AAC5B,YAAY;GACV,2BAA2B;AAC7B,SAAS;GACP,gBAAgB;AAClB,SAAS;GACP,iBAAiB;AACnB,eAAe;GACb,cAAc;AAChB,kCAAkC;GAChC,iBAAiB;AACnB,gCAAgC;GAC9B,sBAAsB;AACxB,gEAAgE;GAC9D,iBAAiB,CAAA;AAErB,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,eAAe,CAAA;IACrB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;CACzC;AAED,wBAAgB,WAAW,CACzB,IAAI,EAAE,eAAe,EACrB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GACvC,WAAW,CAEb"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { ResolvedSlot, SlotMount } from './slot-layout.js';
|
|
2
|
-
/** item 치수. width = X, depth = Z, height = Y (레이아웃과 같은 단위) */
|
|
3
|
-
export interface ItemDims {
|
|
4
|
-
width: number;
|
|
5
|
-
depth: number;
|
|
6
|
-
height: number;
|
|
7
|
-
}
|
|
8
|
-
/** 홀더 로컬 변환. position 은 item 형상 중심, rotation 은 Y 축 회전(도), scale 은 균일 배율 */
|
|
9
|
-
export interface SeatTransform {
|
|
10
|
-
position: {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
z: number;
|
|
14
|
-
};
|
|
15
|
-
rotation: number;
|
|
16
|
-
scale: number;
|
|
17
|
-
}
|
|
18
|
-
export declare const DEFAULT_SEAT_MARGIN = 0.05;
|
|
19
|
-
/** 회전한 item 의 홀더 로컬 X·Z 외접 크기 */
|
|
20
|
-
export declare function rotatedFootprint(dims: ItemDims, rotation: number): {
|
|
21
|
-
width: number;
|
|
22
|
-
depth: number;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* 자리에 item 을 놓는 홀더 로컬 변환. 치수·값이 잘못되면 null (NaN·Infinity 를 내지 않는다).
|
|
26
|
-
* belowHeight: 같은 자리 아래 item 들의 표시 높이(height × scale) 합.
|
|
27
|
-
* margin: 줄여 그릴 때만 쓰는 여유 비율 (0 이상 1 미만). 판정에는 쓰지 않는다.
|
|
28
|
-
*/
|
|
29
|
-
export declare function seatTransform(dims: ItemDims, slot: ResolvedSlot, mount: SlotMount, belowHeight?: number, margin?: number): SeatTransform | null;
|
|
30
|
-
/** 한 자리에 아래에서 위로 쌓인 item 들의 변환. 치수를 모르는 item 은 null 이며 높이에 더하지 않는다 */
|
|
31
|
-
export declare function stackSeatTransforms(stack: (ItemDims | null | undefined)[], slot: ResolvedSlot, mount: SlotMount, margin?: number): (SeatTransform | null)[];
|
|
32
|
-
/** 자리 앵커의 홀더 로컬 위치. 자리 offset 과 층 elevation 만 담는다 */
|
|
33
|
-
export declare function slotAnchorPosition(slot: ResolvedSlot): {
|
|
34
|
-
x: number;
|
|
35
|
-
y: number;
|
|
36
|
-
z: number;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* 자리 앵커의 자식으로 붙일 때의 변환. 적층 높이·반높이·scale·rotation 만 담고 x·z 는 0 이다.
|
|
40
|
-
* 자리 offset 과 elevation 은 앵커가 이미 가지므로 다시 더하지 않는다.
|
|
41
|
-
* slotAnchorPosition(slot) + seatInAnchor(...).position = seatTransform(...).position
|
|
42
|
-
*/
|
|
43
|
-
export declare function seatInAnchor(dims: ItemDims, slot: ResolvedSlot, mount: SlotMount, belowHeight?: number, margin?: number): SeatTransform | null;
|
|
44
|
-
export type FitVerdict = 'OK' | 'NG' | 'UNKNOWN';
|
|
45
|
-
export type FitReason = 'SLOT_NOT_FOUND' | 'TYPE_NOT_ACCEPTED' | 'WIDTH_EXCEEDED' | 'DEPTH_EXCEEDED' | 'HEIGHT_EXCEEDED' | 'STACK_LIMIT_EXCEEDED' | 'SPEC_UNKNOWN';
|
|
46
|
-
export interface FitCandidate {
|
|
47
|
-
type?: string;
|
|
48
|
-
/** 치수를 모르면 생략 */
|
|
49
|
-
dims?: ItemDims | null;
|
|
50
|
-
}
|
|
51
|
-
export interface FitResult {
|
|
52
|
-
verdict: FitVerdict;
|
|
53
|
-
reasons: FitReason[];
|
|
54
|
-
}
|
|
55
|
-
export interface FitOptions {
|
|
56
|
-
/** 타입 비교 전에 양쪽에 적용할 정규화. 기본은 문자열 그대로 */
|
|
57
|
-
normalizeType?: (type: unknown) => string;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* 자리에 item 하나를 더 놓을 수 있는지. occupants 는 그 자리에 이미 놓인 item.
|
|
61
|
-
* 줄이기 전 치수를 쓴다. 개수 한도와 높이 한도는 따로 본다. accepts 생략은 모든 타입, 빈 배열은 아무것도 받지 않음.
|
|
62
|
-
* 타입·치수를 몰라 판정할 수 없으면 UNKNOWN 이다.
|
|
63
|
-
*/
|
|
64
|
-
export declare function judgeItemFit(slot: ResolvedSlot | null, candidate: FitCandidate, occupants?: FitCandidate[], options?: FitOptions): FitResult;
|
|
65
|
-
//# sourceMappingURL=slot-seat.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slot-seat.d.ts","sourceRoot":"","sources":["../../../src/items/slot-layout/slot-seat.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE/D,8DAA8D;AAC9D,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED,2EAA2E;AAC3E,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC7C,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,eAAO,MAAM,mBAAmB,OAAO,CAAA;AAOvC,iCAAiC;AACjC,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC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