@operato/scene-urdf 10.0.0-beta.24 → 10.0.0-beta.30
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/urdf-object.d.ts +7 -6
- package/dist/urdf-object.js +1 -0
- package/dist/urdf-object.js.map +1 -1
- package/package.json +2 -2
package/dist/urdf-object.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { Shape, type ComponentNature, type IRealObject } from '@hatiolab/things-
|
|
|
2
2
|
import type { URDFJointState, URDFJointMeta } from './real-object-urdf.js';
|
|
3
3
|
declare const URDFObject_base: (new (...args: any[]) => {
|
|
4
4
|
_topViewSnapshot?: HTMLCanvasElement;
|
|
5
|
+
_snapshotLoading: boolean;
|
|
5
6
|
_ratioLocking: boolean;
|
|
6
7
|
is3dish(): boolean;
|
|
7
8
|
get hasTextProperty(): boolean;
|
|
8
9
|
get controls(): never[];
|
|
9
10
|
render(ctx: CanvasRenderingContext2D): void;
|
|
10
|
-
ready(): Promise<void>;
|
|
11
11
|
onchange(after: Record<string, any>, before: Record<string, any>): void;
|
|
12
12
|
_ensureTopViewSnapshot(): void;
|
|
13
13
|
buildRealObject(): IRealObject | undefined;
|
|
@@ -53,6 +53,7 @@ declare const URDFObject_base: (new (...args: any[]) => {
|
|
|
53
53
|
created(): void;
|
|
54
54
|
added(parent: any): void;
|
|
55
55
|
removed(parent: any): void;
|
|
56
|
+
ready(): Promise<void>;
|
|
56
57
|
touch(): void;
|
|
57
58
|
clearCache(...attrs: any[]): void;
|
|
58
59
|
removeSelf(completely: any): void;
|
|
@@ -62,7 +63,7 @@ declare const URDFObject_base: (new (...args: any[]) => {
|
|
|
62
63
|
get disposed(): boolean;
|
|
63
64
|
isLayer(): boolean;
|
|
64
65
|
isGroup(): boolean;
|
|
65
|
-
isContainer(): this is import("@hatiolab/things-scene
|
|
66
|
+
isContainer(): this is import("@hatiolab/things-scene").Container;
|
|
66
67
|
isLine(): boolean;
|
|
67
68
|
isRoot(): boolean;
|
|
68
69
|
isRootModel(): boolean;
|
|
@@ -77,7 +78,7 @@ declare const URDFObject_base: (new (...args: any[]) => {
|
|
|
77
78
|
get(property: any): any;
|
|
78
79
|
getState(property: any): any;
|
|
79
80
|
get model(): any;
|
|
80
|
-
get state():
|
|
81
|
+
get state(): import("@hatiolab/things-scene").State;
|
|
81
82
|
get hierarchy(): any;
|
|
82
83
|
get volatile(): never[];
|
|
83
84
|
_applyProps(target: any, props: any, options: any): any;
|
|
@@ -295,7 +296,7 @@ declare const URDFObject_base: (new (...args: any[]) => {
|
|
|
295
296
|
get disposed(): boolean;
|
|
296
297
|
isLayer(): boolean;
|
|
297
298
|
isGroup(): boolean;
|
|
298
|
-
isContainer(): this is import("@hatiolab/things-scene
|
|
299
|
+
isContainer(): this is import("@hatiolab/things-scene").Container;
|
|
299
300
|
isLine(): boolean;
|
|
300
301
|
isRoot(): boolean;
|
|
301
302
|
isRootModel(): boolean;
|
|
@@ -311,9 +312,9 @@ declare const URDFObject_base: (new (...args: any[]) => {
|
|
|
311
312
|
get(property: any): any;
|
|
312
313
|
set(props: any, propval?: any): any;
|
|
313
314
|
getState(property: any): any;
|
|
314
|
-
setState(props:
|
|
315
|
+
setState(props: Partial<import("@hatiolab/things-scene").State> | string, propval?: any): any;
|
|
315
316
|
get model(): any;
|
|
316
|
-
get state():
|
|
317
|
+
get state(): import("@hatiolab/things-scene").State;
|
|
317
318
|
get hierarchy(): any;
|
|
318
319
|
get volatile(): never[];
|
|
319
320
|
_applyProps(target: any, props: any, options: any): any;
|
package/dist/urdf-object.js
CHANGED
package/dist/urdf-object.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urdf-object.js","sourceRoot":"","sources":["../src/urdf-object.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AAEH,OAAO,EACL,aAAa,EACb,QAAQ,EACR,KAAK,EACL,cAAc,EAGf,MAAM,wBAAwB,CAAA;
|
|
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QACR,OAAO,MAAM,CAAA;IACf,CAAC;IAED,uBAAuB;IAEvB,kDAAkD;IAClD,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAChC,CAAC;IAED,IAAI,MAAM,CAAC,KAA0D;QACnE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAChC,CAAC;IAED,4DAA4D;IAC5D,IAAI,SAAS;QACX,MAAM,EAAE,GAAG,IAAI,CAAC,UAAwC,CAAA;QACxD,OAAO,EAAE,EAAE,SAAS,IAAI,EAAE,CAAA;IAC5B,CAAC;IAED,IAAI,UAAU;QACZ,MAAM,EAAE,GAAG,IAAI,CAAC,UAAwC,CAAA;QACxD,OAAO,EAAE,EAAE,UAAU,IAAI,EAAE,CAAA;IAC7B,CAAC;CACF,CAAA;AA/CY,UAAU;IADtB,cAAc,CAAC,MAAM,CAAC;GACV,UAAU,CA+CtB","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n *\n * URDF 로봇을 things-scene 3D 공간에 네이티브로 임베드한다.\n * GLTFObject와 대칭적인 구조 — 2D 탑뷰는 스냅샷 렌더로 표현한다.\n *\n * GltfComponent mixin 합류 (2026-05): GLB / URDF 양쪽이 공유하는\n * - 2D 탑뷰 fallback render (스냅샷 + 라벨)\n * - src 변경 → 스냅샷 reset → ensure 라이프사이클\n * - is3dish / hasTextProperty / controls / source / dimension 보일러플레이트\n * - ratioLock 인터셉트\n * 를 mixin에서 받음. URDF 고유는:\n * - `_ensureTopViewSnapshot()` override — URDF 로더는 GLB 로더와 다르므로\n * mixin 디폴트(GLB loader 호출)를 쓸 수 없고, 캐시 히트만 처리하고\n * miss 는 RealObjectURDF._onLoaded 가 채우도록 위임.\n * - `buildRealObject()` override — RealObjectURDF 반환.\n * - NATURE — urdf-preset / urdf-joints / upAxis / unitScale / autoAnimate\n * / physics 등 로봇 도메인 전용 properties (GLB의 gltfNatureProperties\n * 와 의미가 다르므로 spread 안 함).\n */\n\nimport {\n GltfComponent,\n RectPath,\n Shape,\n sceneComponent,\n type ComponentNature,\n type IRealObject\n} from '@hatiolab/things-scene'\n\nimport { RealObjectURDF } from './real-object-urdf.js'\nimport type { URDFJointState, URDFJointMeta } from './real-object-urdf.js'\n\nconst BASE_URL_ALIAS = '$base_url'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'urdf-preset',\n label: 'preset',\n name: 'preset'\n },\n {\n type: 'string',\n label: 'url',\n name: 'src',\n property: {\n displayField: 'id',\n displayFullUrl: true,\n baseUrlAlias: BASE_URL_ALIAS,\n defaultStorage: '3d-model',\n storageFilters: {\n type: Array,\n value: [\n {\n name: 'category',\n value: 'urdf'\n }\n ]\n },\n useUpload: true,\n category: 'application'\n }\n },\n {\n type: 'select',\n label: 'up-axis',\n name: 'upAxis',\n property: {\n options: [\n { display: 'Z (URDF default)', value: 'z' },\n { display: 'Y (Three.js default)', value: 'y' }\n ]\n }\n },\n {\n type: 'number',\n label: 'unit-scale',\n name: 'unitScale',\n placeholder: '1000'\n },\n {\n type: 'select',\n label: 'auto-animate',\n name: 'autoAnimate',\n property: {\n options: [\n { display: 'Off', value: 'none' },\n { display: 'Sine swing', value: 'sine' }\n ]\n }\n },\n {\n type: 'select',\n label: 'physics',\n name: 'physics',\n property: {\n options: [\n { display: 'Direct (immediate)', value: 'none' },\n { display: 'Smooth (damped)', value: 'smooth' }\n ]\n }\n },\n {\n type: 'urdf-joints',\n label: '',\n name: 'joints',\n editor: {\n fullwidth: true\n }\n }\n ],\n 'value-property': 'source',\n help: 'scene/component/urdf'\n}\n\n@sceneComponent('urdf')\nexport class URDFObject extends GltfComponent(RectPath(Shape)) {\n /**\n * URDF 캐시 hit 만 처리. miss 시는 RealObjectURDF.\\_onLoaded 가\n * 캐시를 채우고 component.\\_topViewSnapshot 을 직접 세팅한다 (URDF\n * 로더는 GLB 로더와 다르므로 mixin 의 디폴트 — RealObjectGLTF.loadGLTF\n * 직접 호출 — 을 쓸 수 없다).\n */\n _ensureTopViewSnapshot() {\n const src = this.getState('src') as string | undefined\n if (!src) return\n\n const cached = RealObjectURDF.getTopViewCache(src)\n if (cached) {\n ;(this as any)._topViewSnapshot = cached\n this.invalidate()\n }\n }\n\n override buildRealObject(): IRealObject | undefined {\n return new RealObjectURDF(this as any)\n }\n\n get nature() {\n return NATURE\n }\n\n // --- URDF 바인딩 API ---\n\n /** 조인트 상태 맵. 값은 숫자(라디안/거리) 또는 { value } 형식 허용. */\n get joints(): Record<string, URDFJointState | number> | undefined {\n return this.getState('joints')\n }\n\n set joints(value: Record<string, URDFJointState | number> | undefined) {\n this.setState('joints', value)\n }\n\n /** 로드된 URDF의 조인트 메타 정보. property editor가 슬라이더 UI 생성에 사용. */\n get jointMeta(): URDFJointMeta[] {\n const ro = this.realObject as RealObjectURDF | undefined\n return ro?.jointMeta ?? []\n }\n\n get jointNames(): string[] {\n const ro = this.realObject as RealObjectURDF | undefined\n return ro?.jointNames ?? []\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/scene-urdf",
|
|
3
3
|
"description": "Scene module for manipulating robot simulation through URDF format",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "10.0.0-beta.
|
|
5
|
+
"version": "10.0.0-beta.30",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.js",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"prettier --write"
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "06b35b1726ec4f27ee76657ce341c6c6f3ba1b3a"
|
|
70
70
|
}
|