@nebula-spatial/studio 0.0.0-stage → 0.1.0

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 (251) hide show
  1. package/README.md +206 -3
  2. package/dist/ai/contract.d.ts +73 -0
  3. package/dist/ai/host.d.ts +28 -0
  4. package/dist/asset/dependency-scan.d.ts +78 -0
  5. package/dist/asset/intake.d.ts +84 -0
  6. package/dist/asset/layout-detect.d.ts +40 -0
  7. package/dist/asset/media-type.d.ts +10 -0
  8. package/dist/asset/model-inspection.d.ts +127 -0
  9. package/dist/asset/record.d.ts +35 -0
  10. package/dist/asset/remote-asset-resolver.d.ts +36 -0
  11. package/dist/asset/repairs.d.ts +53 -0
  12. package/dist/asset/resource-locator.d.ts +15 -0
  13. package/dist/asset/revision-diff.d.ts +33 -0
  14. package/dist/asset/source-contracts.d.ts +21 -0
  15. package/dist/asset/source-paths.d.ts +15 -0
  16. package/dist/asset/usd-inspection.d.ts +39 -0
  17. package/dist/asset/usd-source-metadata.d.ts +142 -0
  18. package/dist/asset/visual-intake.d.ts +27 -0
  19. package/dist/asset/visual-record.d.ts +22 -0
  20. package/dist/asset/web-intake.d.ts +46 -0
  21. package/dist/asset-source-BExlEcRt.js +444 -0
  22. package/dist/assets/usd-export-worker-BsGubtAE.js +1 -0
  23. package/dist/builders-BAXRR5o5.js +1854 -0
  24. package/dist/core/asset-task.d.ts +105 -0
  25. package/dist/core/context.d.ts +23 -0
  26. package/dist/core/host.d.ts +432 -0
  27. package/dist/core/persistence-controller.d.ts +58 -0
  28. package/dist/core/plugins.d.ts +139 -0
  29. package/dist/core/scene-tree.d.ts +62 -0
  30. package/dist/core/versions.d.ts +2 -0
  31. package/dist/core/when.d.ts +13 -0
  32. package/dist/core/write-policy.d.ts +29 -0
  33. package/dist/delivery/build-plan.d.ts +2 -0
  34. package/dist/delivery/contracts.d.ts +362 -0
  35. package/dist/delivery/digest.d.ts +3 -0
  36. package/dist/delivery/evidence.d.ts +10 -0
  37. package/dist/delivery/export-evidence.d.ts +3 -0
  38. package/dist/delivery/index.d.ts +9 -0
  39. package/dist/delivery/prim-name.d.ts +17 -0
  40. package/dist/delivery/profile.d.ts +4 -0
  41. package/dist/doc/builders.d.ts +99 -0
  42. package/dist/doc/command.d.ts +195 -0
  43. package/dist/doc/domain-extensions.d.ts +34 -0
  44. package/dist/doc/node-facts.d.ts +87 -0
  45. package/dist/doc/physics-facts.d.ts +74 -0
  46. package/dist/doc/placement-policy.d.ts +71 -0
  47. package/dist/doc/random-placement.d.ts +30 -0
  48. package/dist/doc/scene-graph.d.ts +80 -0
  49. package/dist/doc/scene-regions.d.ts +29 -0
  50. package/dist/doc/schema.d.ts +452 -0
  51. package/dist/doc/task.d.ts +71 -0
  52. package/dist/doc/validate.d.ts +68 -0
  53. package/dist/editor/asset-source.d.ts +15 -0
  54. package/dist/editor/editor.d.ts +246 -0
  55. package/dist/editor/index.d.ts +22 -0
  56. package/dist/editor/shortcuts.d.ts +2 -0
  57. package/dist/editor/types.d.ts +143 -0
  58. package/dist/editor/ui-plugins.d.ts +64 -0
  59. package/dist/editor.js +1755 -0
  60. package/dist/editorial-BkAFWfbg.js +83 -0
  61. package/dist/export-evidence-B_0zRmb8.js +5027 -0
  62. package/dist/generalization/domain.d.ts +10 -0
  63. package/dist/generalization/generalization.d.ts +371 -0
  64. package/dist/generalization/index.d.ts +11 -0
  65. package/dist/generalization.js +1659 -0
  66. package/dist/history/undo-stack.d.ts +74 -0
  67. package/dist/index.d.ts +91 -0
  68. package/dist/index.js +2839 -0
  69. package/dist/persist/content-addressed.d.ts +11 -0
  70. package/dist/persist/create-scene-package-from-host.d.ts +7 -0
  71. package/dist/persist/indexeddb-store.d.ts +69 -0
  72. package/dist/persist/scene-file.d.ts +52 -0
  73. package/dist/persist/scene-package.d.ts +8 -0
  74. package/dist/persist/snapshot.d.ts +5 -0
  75. package/dist/physics-facts-tfQYyNTD.js +337 -0
  76. package/dist/placement-policy-DY_FNRDu.js +405 -0
  77. package/dist/ports/asset-ingestor.d.ts +41 -0
  78. package/dist/ports/asset-source.d.ts +57 -0
  79. package/dist/ports/delivery.d.ts +13 -0
  80. package/dist/ports/persistence.d.ts +29 -0
  81. package/dist/project/asset-catalog.d.ts +21 -0
  82. package/dist/project/contracts.d.ts +272 -0
  83. package/dist/project/editorial.d.ts +16 -0
  84. package/dist/project/identity.d.ts +20 -0
  85. package/dist/project/index.d.ts +9 -0
  86. package/dist/project/scene-document.d.ts +5 -0
  87. package/dist/project/source-dependencies.d.ts +7 -0
  88. package/dist/remote-asset-resolver-Cb8cfNmw.js +136 -0
  89. package/dist/scene/index.d.ts +12 -0
  90. package/dist/scene-graph-DBLKAhxa.js +681 -0
  91. package/dist/scene-session-BV1HnxNh.js +3506 -0
  92. package/dist/scene.js +244 -0
  93. package/dist/studio/delivery-catalog.d.ts +28 -0
  94. package/dist/studio/in-memory-asset-source.d.ts +15 -0
  95. package/dist/studio/index.d.ts +31 -0
  96. package/dist/studio/indexeddb-asset-source.d.ts +32 -0
  97. package/dist/studio/indexeddb-persistence.d.ts +13 -0
  98. package/dist/studio/remote-asset-importer.d.ts +56 -0
  99. package/dist/studio/source-package.d.ts +9 -0
  100. package/dist/studio/usd-export-client.d.ts +13 -0
  101. package/dist/studio/usd-export-protocol.d.ts +98 -0
  102. package/dist/studio/usd-export-worker.d.ts +1 -0
  103. package/dist/studio/usd-zip-reader.d.ts +14 -0
  104. package/dist/studio/web-asset-ingestor.d.ts +10 -0
  105. package/dist/studio/web-host.d.ts +8 -0
  106. package/dist/studio.js +5544 -0
  107. package/dist/util/asset-facts.d.ts +3 -0
  108. package/dist/util/data.d.ts +17 -0
  109. package/dist/util/diagnostics.d.ts +38 -0
  110. package/dist/util/geometry.d.ts +11 -0
  111. package/dist/util/hash.d.ts +9 -0
  112. package/dist/util/ids.d.ts +20 -0
  113. package/dist/util/math.d.ts +47 -0
  114. package/dist/util/ply-metadata.d.ts +19 -0
  115. package/dist/util/studio-source.d.ts +23 -0
  116. package/dist/version.d.ts +5 -0
  117. package/dist/view/appearance.d.ts +13 -0
  118. package/dist/view/authoring-appearance.d.ts +25 -0
  119. package/dist/view/bounds-preview.d.ts +34 -0
  120. package/dist/view/bounds.d.ts +11 -0
  121. package/dist/view/camera-zoom.d.ts +3 -0
  122. package/dist/view/geometry-anchors.d.ts +20 -0
  123. package/dist/view/gizmo-appearance.d.ts +5 -0
  124. package/dist/view/gizmo.d.ts +81 -0
  125. package/dist/view/group-selection.d.ts +13 -0
  126. package/dist/view/node-features.d.ts +39 -0
  127. package/dist/view/picking.d.ts +49 -0
  128. package/dist/view/placement.d.ts +48 -0
  129. package/dist/view/region-editing.d.ts +25 -0
  130. package/dist/view/rotation-guide.d.ts +36 -0
  131. package/dist/view/runtime-capabilities.d.ts +22 -0
  132. package/dist/view/scene-session.d.ts +258 -0
  133. package/dist/view/screen-bounds.d.ts +17 -0
  134. package/dist/view/selection-transform.d.ts +20 -0
  135. package/node_modules/@nebula-spatial/cad-loader/CHANGELOG.md +48 -0
  136. package/node_modules/@nebula-spatial/cad-loader/README.md +108 -0
  137. package/node_modules/@nebula-spatial/cad-loader/dist/core/cad-types.d.ts +26 -0
  138. package/node_modules/@nebula-spatial/cad-loader/dist/core/errors.d.ts +5 -0
  139. package/node_modules/@nebula-spatial/cad-loader/dist/core/index.d.ts +24 -0
  140. package/node_modules/@nebula-spatial/cad-loader/dist/core/index.js +2354 -0
  141. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-group-reader.d.ts +9 -0
  142. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-parser.d.ts +78 -0
  143. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/dxbs-sidecar.d.ts +24 -0
  144. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/geometry-segments.d.ts +20 -0
  145. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/text-roundtrip.d.ts +4 -0
  146. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/types.d.ts +81 -0
  147. package/node_modules/@nebula-spatial/cad-loader/dist/core/runtime-text-decoder.d.ts +8 -0
  148. package/node_modules/@nebula-spatial/cad-loader/dist/core/types.d.ts +153 -0
  149. package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/insert-bbox.d.ts +10 -0
  150. package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/viewport-rect.d.ts +21 -0
  151. package/node_modules/@nebula-spatial/cad-loader/dist/index.d.ts +36 -0
  152. package/node_modules/@nebula-spatial/cad-loader/dist/index.js +5829 -0
  153. package/node_modules/@nebula-spatial/cad-loader/dist/loader/geo-loader.d.ts +59 -0
  154. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/automatic-external-resources.d.ts +26 -0
  155. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/external-variant-sidecar-fetch.d.ts +13 -0
  156. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/flow-control.d.ts +29 -0
  157. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/frame-budget-scheduler.d.ts +21 -0
  158. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-compact-executor.d.ts +19 -0
  159. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-local-adapter.d.ts +2 -0
  160. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-pipeline.d.ts +92 -0
  161. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-worker-adapter.d.ts +13 -0
  162. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-builder.d.ts +34 -0
  163. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-load-sink.d.ts +28 -0
  164. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node.d.ts +304 -0
  165. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare-worker-types.d.ts +94 -0
  166. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.d.ts +38 -0
  167. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.worker.d.ts +1 -0
  168. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-model-builder.d.ts +10 -0
  169. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-runtime-geometry.d.ts +15 -0
  170. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-canonical.d.ts +37 -0
  171. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-quality.d.ts +9 -0
  172. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/prepare-credit-gate.d.ts +20 -0
  173. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/transport.d.ts +2 -0
  174. package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/cad-render-node.d.ts +80 -0
  175. package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/geo-node-cad-render-node.d.ts +12 -0
  176. package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-geometry.d.ts +28 -0
  177. package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-material.d.ts +18 -0
  178. package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/block-geometry-registry.d.ts +35 -0
  179. package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/insert-instance-table.d.ts +23 -0
  180. package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/viewport-instance-presenter.d.ts +66 -0
  181. package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-insert-selection.d.ts +35 -0
  182. package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-text-selection.d.ts +31 -0
  183. package/node_modules/@nebula-spatial/cad-loader/dist/session/annotation-idle-gate.d.ts +14 -0
  184. package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-document-session.d.ts +187 -0
  185. package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-font-runtime.d.ts +11 -0
  186. package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-insert-id.d.ts +6 -0
  187. package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-text-warmup.d.ts +38 -0
  188. package/node_modules/@nebula-spatial/cad-loader/dist/session/create-cad-document-session.d.ts +5 -0
  189. package/node_modules/@nebula-spatial/cad-loader/dist/session/load-session.d.ts +90 -0
  190. package/node_modules/@nebula-spatial/cad-loader/dist/session/viewport-coverage.d.ts +32 -0
  191. package/node_modules/@nebula-spatial/cad-loader/dist/shared/abort.d.ts +3 -0
  192. package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-display-color.d.ts +55 -0
  193. package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-load-source.d.ts +8 -0
  194. package/node_modules/@nebula-spatial/cad-loader/dist/shared/color-buffer.d.ts +6 -0
  195. package/node_modules/@nebula-spatial/cad-loader/dist/shared/constants.d.ts +11 -0
  196. package/node_modules/@nebula-spatial/cad-loader/dist/shared/display-color-buffer.d.ts +27 -0
  197. package/node_modules/@nebula-spatial/cad-loader/dist/shared/errors.d.ts +2 -0
  198. package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-builder.d.ts +25 -0
  199. package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-font.d.ts +12 -0
  200. package/node_modules/@nebula-spatial/cad-loader/dist/shared/types.d.ts +57 -0
  201. package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/insert-bbox.d.ts +1 -0
  202. package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/timing.d.ts +2 -0
  203. package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/viewport-rect.d.ts +1 -0
  204. package/node_modules/@nebula-spatial/cad-loader/dist/shared/viewer-theme.d.ts +2 -0
  205. package/node_modules/@nebula-spatial/cad-loader/dist/workers/geo-prepare.worker.js +2264 -0
  206. package/node_modules/@nebula-spatial/cad-loader/package.json +62 -0
  207. package/node_modules/@nebula-spatial/viewer/CHANGELOG.md +426 -0
  208. package/node_modules/@nebula-spatial/viewer/FBX-MATERIAL-CONVERSION.md +97 -0
  209. package/node_modules/@nebula-spatial/viewer/README.md +1056 -0
  210. package/node_modules/@nebula-spatial/viewer/USD-VISUAL-MATERIAL-SUPPORT.md +89 -0
  211. package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.js +19 -0
  212. package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.wasm +0 -0
  213. package/node_modules/@nebula-spatial/viewer/dist/asset-ir-DEOK9SqE.js +382 -0
  214. package/node_modules/@nebula-spatial/viewer/dist/assets/ground-grid.d.ts +6 -0
  215. package/node_modules/@nebula-spatial/viewer/dist/assets/source-types.d.ts +19 -0
  216. package/node_modules/@nebula-spatial/viewer/dist/assets/types.d.ts +393 -0
  217. package/node_modules/@nebula-spatial/viewer/dist/assets/usd-worker-Bom5cjz3.js +1392 -0
  218. package/node_modules/@nebula-spatial/viewer/dist/cad/text.d.ts +2 -0
  219. package/node_modules/@nebula-spatial/viewer/dist/cad/types.d.ts +368 -0
  220. package/node_modules/@nebula-spatial/viewer/dist/index-ByBlfVc0.js +12132 -0
  221. package/node_modules/@nebula-spatial/viewer/dist/index.d.ts +32 -0
  222. package/node_modules/@nebula-spatial/viewer/dist/index.js +26 -0
  223. package/node_modules/@nebula-spatial/viewer/dist/inspection/types.d.ts +112 -0
  224. package/node_modules/@nebula-spatial/viewer/dist/mjcf-visual-DVRa0w90.js +72 -0
  225. package/node_modules/@nebula-spatial/viewer/dist/mujoco-runtime-Dhx6Ua2u.js +463 -0
  226. package/node_modules/@nebula-spatial/viewer/dist/plugins.d.ts +179 -0
  227. package/node_modules/@nebula-spatial/viewer/dist/scene/instances.d.ts +36 -0
  228. package/node_modules/@nebula-spatial/viewer/dist/scene/types.d.ts +258 -0
  229. package/node_modules/@nebula-spatial/viewer/dist/session-B-j6KdA-.js +389 -0
  230. package/node_modules/@nebula-spatial/viewer/dist/session-B4AICTeJ.js +963 -0
  231. package/node_modules/@nebula-spatial/viewer/dist/session-BAG5cDYe.js +9153 -0
  232. package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-runtime.d.ts +118 -0
  233. package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-wasm-module.d.ts +11 -0
  234. package/node_modules/@nebula-spatial/viewer/dist/simulation/openusd-wasm-module.d.ts +10 -0
  235. package/node_modules/@nebula-spatial/viewer/dist/simulation/physics-runtime-state.d.ts +75 -0
  236. package/node_modules/@nebula-spatial/viewer/dist/simulation/types.d.ts +129 -0
  237. package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-inspection.d.ts +66 -0
  238. package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-query.d.ts +50 -0
  239. package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-resource-policy.d.ts +28 -0
  240. package/node_modules/@nebula-spatial/viewer/dist/types.d.ts +278 -0
  241. package/node_modules/@nebula-spatial/viewer/dist/ui/types.d.ts +48 -0
  242. package/node_modules/@nebula-spatial/viewer/dist/urdf-session-kemAnBn8.js +3231 -0
  243. package/node_modules/@nebula-spatial/viewer/dist/usd-session-QtwGKI7v.js +6771 -0
  244. package/node_modules/@nebula-spatial/viewer/dist/version.d.ts +5 -0
  245. package/node_modules/@nebula-spatial/viewer/dist/viewer.d.ts +2 -0
  246. package/node_modules/@nebula-spatial/viewer/dist/xacro-CYTPS7mh.js +1537 -0
  247. package/node_modules/@nebula-spatial/viewer/openusd/openusd-runtime-manifest.json +15 -0
  248. package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.js +14 -0
  249. package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.wasm +0 -0
  250. package/node_modules/@nebula-spatial/viewer/package.json +66 -0
  251. package/package.json +87 -6
@@ -0,0 +1,258 @@
1
+ import { TransformControls } from 'three/examples/jsm/controls/TransformControls.js';
2
+ import type { SceneEntry, SceneDeterministicCheckOptions, SceneDeterministicCheckResult, SceneInstanceBounds, SceneInstanceRuntime, SceneOptions, ScenePhysicsState, Viewer, ViewerCameraSnapshot, ViewerOptions, PhysicsRuntimeSnapshot, ViewerCaptureOptions, ViewerCaptureResult } from '@nebula-spatial/viewer';
3
+ import type { SceneAssetNode, SceneDocument, SceneVisualNode, LocalTransform, StudioEditorialState, Vec3, Vec3Bounds } from '../doc/schema';
4
+ import type { StudioPhysicsFacts } from '../doc/physics-facts';
5
+ import { type StudioNodeGeometryAnchors } from './geometry-anchors';
6
+ import type { StudioPlacementSurface } from '../doc/placement-policy';
7
+ import type { StudioNodeFrame, StudioSelectionFrame } from '../doc/node-facts';
8
+ import type { RegionShape, StudioSceneRegionOverlay } from '../doc/scene-regions';
9
+ import type { GizmoMode } from './gizmo';
10
+ import type { StudioRotationGuide } from './rotation-guide';
11
+ import { type StudioRuntimeProjectionCapabilities } from './runtime-capabilities';
12
+ /** The resolver owns source URLs/files and keeps them alive until sync/dispose settles. */
13
+ export type StudioSceneSource = Omit<SceneEntry, 'id' | 'placement'>;
14
+ export type StudioAssetLoadPhase = 'queued' | 'loading' | 'ready' | 'failed' | 'closed';
15
+ export type StudioAssetLoadStage = 'resolving-source' | 'downloading' | 'validating' | 'parsing-visual' | 'preparing-physics';
16
+ export type StudioAssetLoadOutcome = 'full' | 'degraded' | 'placeholder' | null;
17
+ export interface StudioAssetLoadError {
18
+ readonly code: string;
19
+ readonly message: string;
20
+ readonly stage: string;
21
+ }
22
+ export interface StudioAssetLoadWarning {
23
+ readonly code: string;
24
+ readonly message: string;
25
+ readonly stage: string;
26
+ }
27
+ export interface StudioAssetLoadProgress {
28
+ readonly completed: number;
29
+ readonly total: number | null;
30
+ readonly determinate: boolean;
31
+ }
32
+ export interface StudioAssetLoadStatus {
33
+ readonly sequence: number;
34
+ readonly nodeId: string;
35
+ readonly sourceRevisionId: string | null;
36
+ readonly kind: 'asset' | 'visual' | 'placeholder';
37
+ readonly phase: StudioAssetLoadPhase;
38
+ readonly stage: StudioAssetLoadStage | null;
39
+ readonly outcome: StudioAssetLoadOutcome;
40
+ readonly message: string | null;
41
+ readonly progress: StudioAssetLoadProgress | null;
42
+ readonly warning: StudioAssetLoadWarning | null;
43
+ readonly error: StudioAssetLoadError | null;
44
+ readonly startedAt: string;
45
+ readonly updatedAt: string;
46
+ }
47
+ export interface StudioAssetLoadReporter {
48
+ stage(stage: StudioAssetLoadStage, message?: string): void;
49
+ progress(progress: StudioAssetLoadProgress): void;
50
+ }
51
+ export interface StudioCaptureOptions extends Omit<ViewerCaptureOptions, 'width' | 'height' | 'frameBounds'> {
52
+ readonly width?: number;
53
+ readonly height?: number;
54
+ /** `scene` frames all visible models; `viewport` preserves the current camera framing. */
55
+ readonly scope?: 'viewport' | 'selection' | 'scene';
56
+ readonly includeOverlays?: boolean;
57
+ }
58
+ export type StudioCaptureResult = ViewerCaptureResult;
59
+ export interface StudioSceneStatus {
60
+ readonly revision: number;
61
+ readonly phase: 'loading' | 'ready' | 'failed' | 'disposed';
62
+ readonly instances: readonly StudioAssetLoadStatus[];
63
+ readonly physics: ScenePhysicsState;
64
+ readonly error: string | null;
65
+ }
66
+ /** Screen-space anchor for UI associated with the primary selection. */
67
+ export interface StudioTransformGestureFeedback {
68
+ readonly mode: GizmoMode;
69
+ readonly space: 'local' | 'world';
70
+ readonly axis: string | null;
71
+ readonly translationDelta: Vec3;
72
+ readonly rotationDeltaRadians: number;
73
+ readonly scaleRatio: Vec3;
74
+ }
75
+ export interface StudioPlacementRuntimeFeedback {
76
+ readonly valid: boolean;
77
+ readonly conflictIds: readonly string[];
78
+ readonly message: string | null;
79
+ readonly allowOverlap: boolean;
80
+ }
81
+ export interface StudioPlacementTarget {
82
+ readonly kind: 'support-surface' | 'ground' | 'unsupported-surface' | 'none';
83
+ readonly surface: StudioPlacementSurface | null;
84
+ readonly point: Vec3 | null;
85
+ readonly nodeId: string | null;
86
+ }
87
+ export interface StudioTransformCommitOptions {
88
+ readonly allowOverlap: boolean;
89
+ /** Collision or visual surface owner that the moved asset rests on. */
90
+ readonly supportNodeId?: string | null;
91
+ /** Exact horizontal support plane used to validate this contact. */
92
+ readonly supportSurfaceZ?: number | null;
93
+ }
94
+ export interface StudioSelectionOverlay {
95
+ readonly x: number;
96
+ readonly y: number;
97
+ readonly visible: boolean;
98
+ readonly transforming: boolean;
99
+ readonly hiddenReason?: 'no-selection' | 'selecting' | 'transforming' | 'camera-moving' | 'anchor-unavailable' | 'editing-disabled' | null;
100
+ readonly feedback?: StudioTransformGestureFeedback;
101
+ readonly placement?: StudioPlacementRuntimeFeedback;
102
+ }
103
+ export interface StudioSceneSessionOptions {
104
+ readonly viewport: HTMLElement;
105
+ readonly canvas: HTMLCanvasElement;
106
+ readonly resolveSource: (assetRevisionId: string, node?: SceneAssetNode, signal?: AbortSignal, reporter?: StudioAssetLoadReporter) => StudioSceneSource | null | Promise<StudioSceneSource | null>;
107
+ readonly resolveVisualSource?: (visualRevisionId: string, node: SceneVisualNode, signal?: AbortSignal, reporter?: StudioAssetLoadReporter) => StudioSceneSource | null | Promise<StudioSceneSource | null>;
108
+ readonly onPick?: (id: string | null, additive: boolean, primPath?: string | null) => void;
109
+ /** One final set from a box gesture; the host applies replace/add selection. */
110
+ readonly onBoxSelect?: (ids: readonly string[], additive: boolean) => void;
111
+ /** One final transform per completed gesture; Escape/cancel never calls this. */
112
+ readonly onTransform?: (id: string, transform: LocalTransform, placement?: StudioTransformCommitOptions) => void;
113
+ /** One committed pivot from a viewport drag, in source-content coordinates. */
114
+ readonly onNodeOriginChange?: (id: string, local: Vec3) => void;
115
+ readonly onPlacementBlocked?: (message: string) => void;
116
+ readonly onRegionPick?: (regionId: string | null) => void;
117
+ readonly onRegionTransform?: (regionId: string, transform: LocalTransform) => void;
118
+ /** One final shape per completed 3D handle gesture; Escape/cancel never calls this. */
119
+ readonly onRegionShapeChange?: (regionId: string, shape: RegionShape) => void;
120
+ readonly onStatus?: (status: StudioSceneStatus) => void;
121
+ readonly onAssetLoadStatus?: (status: StudioAssetLoadStatus) => void;
122
+ readonly onError?: (message: string) => void;
123
+ readonly onCameraChange?: (quaternion: readonly [number, number, number, number]) => void;
124
+ /** Coordinates are relative to the viewport element. */
125
+ readonly onSelectionOverlayChange?: (overlay: StudioSelectionOverlay) => void;
126
+ /** Reports the nearby snap target highlighted during a drag, or null. */
127
+ readonly onSnapHint?: (instanceId: string | null) => void;
128
+ readonly sceneOptions?: SceneOptions;
129
+ }
130
+ export interface StudioNodeDisplayOptions {
131
+ readonly transformControls?: boolean;
132
+ readonly selectionOutline?: boolean;
133
+ readonly originMarker?: boolean;
134
+ readonly nodes?: Readonly<Record<string, Partial<StudioNodeDisplayState>>>;
135
+ }
136
+ export interface StudioNodeDisplayState {
137
+ readonly transformControls: boolean;
138
+ readonly selectionOutline: boolean;
139
+ readonly originMarker: boolean;
140
+ }
141
+ export interface StudioSceneSession {
142
+ /** The shared empty stage is ready. Await sync() to wait for document assets. */
143
+ readonly ready: Promise<void>;
144
+ /** Coalesces concurrent requests and resolves after the newest document settles. */
145
+ sync(doc: SceneDocument, editorial?: Readonly<Record<string, StudioEditorialState>>, regions?: readonly StudioSceneRegionOverlay[]): Promise<void>;
146
+ setEditorial(editorial: Readonly<Record<string, StudioEditorialState>>): void;
147
+ /** Measures a hidden asset preview, seats its real footprint at the point,
148
+ * then removes the preview. Returns data for one subsequent Add Command. */
149
+ preparePlacement(assetId: string, point: Vec3, snap?: number | 'adaptive'): Promise<LocalTransform>;
150
+ beginPlacementPreview(assetId: string, transform: LocalTransform): Promise<boolean>;
151
+ updatePlacementPreview(transform: LocalTransform): Promise<boolean>;
152
+ confirmPlacementPreview(): Promise<LocalTransform | null>;
153
+ cancelPlacementPreview(): Promise<void>;
154
+ /**
155
+ * World-space sizes (axis-aligned bounds) per asset, measured by briefly
156
+ * loading each asset hidden. Assets that fail to load are omitted.
157
+ */
158
+ measureAssets(assetIds: readonly string[]): Promise<Record<string, Vec3>>;
159
+ measureAssetBounds(assetId: string): Promise<Vec3Bounds>;
160
+ /** The transform gizmo is centered on the editable selection. */
161
+ select(ids: readonly string[], primary?: string | null): void;
162
+ selectRegion(regionId: string | null): void;
163
+ setRegionMode(enabled: boolean): void;
164
+ setRegionIssues(regionIds: readonly string[]): void;
165
+ focusRegion(regionId: string): boolean;
166
+ getRegionOverlayIds(): readonly string[];
167
+ getRegionOverlayScreenRect(regionId: string): {
168
+ left: number;
169
+ top: number;
170
+ width: number;
171
+ height: number;
172
+ } | null;
173
+ getRegionShapeHandleScreenPoints(regionId: string): readonly {
174
+ id: string;
175
+ x: number;
176
+ y: number;
177
+ }[];
178
+ getTransformControlScreenPoint(axis: 'X' | 'Y' | 'Z'): {
179
+ x: number;
180
+ y: number;
181
+ } | null;
182
+ setMode(mode: GizmoMode): void;
183
+ /** Screen-space intersection selection; includes selectable occluded objects. */
184
+ setBoxSelectionEnabled(enabled: boolean): void;
185
+ cancelActiveGesture(): void;
186
+ setSnap(enabled: boolean): void;
187
+ getSnapStepM(): number;
188
+ setSurfaceSnap(enabled: boolean): void;
189
+ setOverlapPrevention(enabled: boolean): void;
190
+ setTransformSpace(space: 'local' | 'world'): void;
191
+ getNodeFrame(nodeId: string): StudioNodeFrame | null;
192
+ getTransformOrigin(nodeId: string): Vec3 | null;
193
+ setTransformOrigin(nodeId: string, offset: Vec3 | null): boolean;
194
+ setNodeDisplay(nodeId: string, patch: Partial<{
195
+ [K in keyof StudioNodeDisplayState]: boolean | null;
196
+ }>): boolean;
197
+ getNodeDisplay(nodeId: string): StudioNodeDisplayState | null;
198
+ /** Lazy, cached visual geometry anchors in source-content coordinates. */
199
+ measureNodeOriginAnchors(nodeId: string): StudioNodeGeometryAnchors | null;
200
+ getPhysicsFacts(nodeId: string): StudioPhysicsFacts | null;
201
+ getSelectionFrame(): StudioSelectionFrame | null;
202
+ focusNodes(nodeIds: readonly string[], options?: {
203
+ readonly padding?: number;
204
+ }): boolean;
205
+ /** Compatibility alias for callers that use the concise scene API. */
206
+ focus(nodeIds: readonly string[], options?: {
207
+ readonly padding?: number;
208
+ }): boolean;
209
+ zoomIn(factor?: number): boolean;
210
+ zoomOut(factor?: number): boolean;
211
+ fit(): boolean;
212
+ groundPoint(clientX: number, clientY: number): Vec3 | null;
213
+ pickPlacementTarget(clientX: number, clientY: number, excludeNodeIds?: readonly string[]): StudioPlacementTarget;
214
+ pickPlacementSurface(clientX: number, clientY: number, excludeNodeIds?: readonly string[]): StudioPlacementSurface | null;
215
+ setGroundVisible(visible: boolean): void;
216
+ setCollisionVisible(visible: boolean): void;
217
+ setGrabEnabled(enabled: boolean): void;
218
+ setTheme(theme: 'dark' | 'light'): void;
219
+ /** Simulation mode keeps camera navigation, but disables authoring gizmos. */
220
+ setEditingEnabled(enabled: boolean): void;
221
+ /** Read-only selection visualization without transform handles. */
222
+ setSelectionInspectionEnabled(enabled: boolean): void;
223
+ getCameraState(): ViewerCameraSnapshot | null;
224
+ setCameraState(snapshot: ViewerCameraSnapshot): boolean;
225
+ /** Look towards the current orbit target from the chosen signed world axis. */
226
+ setAxisView(axis: 'x' | 'y' | 'z', sign: 1 | -1): boolean;
227
+ resetCamera(): boolean;
228
+ getCameraQuaternion(): [number, number, number, number];
229
+ getRuntime(instanceId: string): SceneInstanceRuntime | null;
230
+ getInstanceBounds(instanceId: string): SceneInstanceBounds | null;
231
+ focusPrim(instanceId: string, primPath: string): boolean;
232
+ getScenePhysicsState(): ScenePhysicsState;
233
+ getScenePhysicsRuntime(): PhysicsRuntimeSnapshot | null;
234
+ runDeterministicCheck(options?: SceneDeterministicCheckOptions): SceneDeterministicCheckResult;
235
+ play(instanceId: string): boolean;
236
+ pause(instanceId: string): boolean;
237
+ resetPhysics(instanceId: string): boolean;
238
+ playScene(): boolean;
239
+ pauseScene(): boolean;
240
+ stepScene(timestep?: number): boolean;
241
+ resetScene(): boolean;
242
+ isSimulationRunning(): boolean;
243
+ getStatus(): StudioSceneStatus;
244
+ getAssetLoadStatus(nodeId: string): StudioAssetLoadStatus | null;
245
+ getRuntimeProjectionCapabilities(): StudioRuntimeProjectionCapabilities;
246
+ captureViewport(options?: StudioCaptureOptions): Promise<StudioCaptureResult>;
247
+ dispose(): Promise<void>;
248
+ }
249
+ /** @internal Dependency seam for lifecycle tests that do not create WebGL. */
250
+ export interface StudioSceneSessionDependencies {
251
+ readonly createViewer?: (options: ViewerOptions) => Viewer;
252
+ readonly createControls?: (camera: ReturnType<Viewer['getActiveCamera']>) => TransformControls;
253
+ readonly createRotationGuide?: (viewport: HTMLElement) => StudioRotationGuide | null;
254
+ }
255
+ export declare function createStudioSceneSession(options: StudioSceneSessionOptions, dependencies?: StudioSceneSessionDependencies): StudioSceneSession;
256
+ export type { StudioNodeFrame, StudioSelectionFrame } from '../doc/node-facts';
257
+ export type { StudioPlacementSurface } from '../doc/placement-policy';
258
+ export type { StudioPhysicsFacts, StudioPhysicsBodyFact, StudioPhysicsJointFact } from '../doc/physics-facts';
@@ -0,0 +1,17 @@
1
+ import { Box3, Camera } from 'three';
2
+ /** Visible bounds in normalized device coordinates, after clipping to the view. */
3
+ export interface ScreenBounds {
4
+ readonly minX: number;
5
+ readonly maxX: number;
6
+ readonly minY: number;
7
+ readonly maxY: number;
8
+ }
9
+ /**
10
+ * Projects the intersection of a world-space box and the camera frustum.
11
+ * Returns null when the box has no visible projection or inputs are invalid.
12
+ * Homogeneous clipping happens before division, including near/far planes, so
13
+ * geometry behind the eye cannot wrap around into a huge screen rectangle.
14
+ * The camera's current world matrix is updated here; projection parameters must
15
+ * have been applied with updateProjectionMatrix() by the camera owner.
16
+ */
17
+ export declare function projectScreenBounds(bounds: Box3, camera: Camera): ScreenBounds | null;
@@ -0,0 +1,20 @@
1
+ import type { LocalTransform } from '../doc/schema';
2
+ import type { StudioEditorialState } from '../doc/schema';
3
+ export interface SelectionTransform {
4
+ readonly nodeId: string;
5
+ readonly localTransform: LocalTransform;
6
+ }
7
+ export interface SelectionTransformNode {
8
+ readonly nodeId: string;
9
+ readonly localTransform: LocalTransform;
10
+ readonly visible: boolean;
11
+ }
12
+ /**
13
+ * `instances` is the selected set, captured before the gesture. The primary's
14
+ * final transform is copied exactly. Other instances share its world rotation
15
+ * delta, translation and scale ratios, with the primary origin as their pivot.
16
+ * Offset scaling follows the primary's original local axes (matching the scale
17
+ * gizmo). Peer scales receive the same component ratios; no shear is authored.
18
+ * Hidden/locked entries are skipped and duplicate ids produce one result.
19
+ */
20
+ export declare function transformSelection(instances: readonly SelectionTransformNode[], primaryId: string, next: LocalTransform, editorial?: Readonly<Record<string, StudioEditorialState>>): readonly SelectionTransform[];
@@ -0,0 +1,48 @@
1
+ # Changelog
2
+
3
+ All notable changes to this package are documented in this file.
4
+
5
+ ## 0.3.1
6
+
7
+ - 修复外部依赖视口查询在异常视口下的健壮性:视口跨越过多网格、或网格坐标量级异常时退化为线性扫描,避免无上限的双重循环把主线程拖死。
8
+ - 空间索引的格子遍历改为按偏移量递进,避免巨大绝对坐标下浮点精度无法推进而空转。
9
+
10
+ ## 0.3.0
11
+
12
+ - 新增图层批量可见性更新能力,并将一次批量操作合并为一次渲染资源刷新。
13
+ - CAD pack 文档元数据新增图纸单位,旧格式在未携带单位时保持兼容默认值。
14
+
15
+ ## 0.2.4
16
+
17
+ - Expose `configureCadTextBuilder()` as an explicit pass-through to the package's Troika text builder.
18
+ - Start all sidecar requests required by the initial viewport in parallel.
19
+ - Render the first available external block batch immediately and merge remaining results into one tail batch.
20
+ - Preserve in-flight downloads and incremental rendering during viewport interaction.
21
+ - Reuse the cached main DXB3 parse while preparing staged external block deltas.
22
+
23
+ ## 0.2.3
24
+
25
+ - Render base geometry before external block sidecars finish loading.
26
+ - Defer external variant geometry and append it progressively after sidecar loading.
27
+ - Reuse a geometry Worker across sequential parses within a CAD document session.
28
+ - Retain the main DXB3 buffer in the Worker to avoid retransferring it for variant delta parses.
29
+ - Added CAD session load timing information for initial render and external content readiness.
30
+
31
+ ## 0.2.2
32
+
33
+ - Fixed INSERT bounding boxes being truncated when external variant delta content arrives incrementally.
34
+
35
+ ## 0.2.1
36
+
37
+ - Added geometry Worker overrides to document sessions and external variant delta loading.
38
+
39
+ ## 0.2.0
40
+
41
+ - Added document-level CAD sessions with progressive content loading and viewport demand control.
42
+ - Added read-only CAD render resources, INSERT and text selection helpers, and CAD session metadata.
43
+ - Added public APIs for font resolution, document rendering, and scene annotations.
44
+ - Retained the existing `loadGeo()`, load session, and `core` APIs.
45
+
46
+ ## 0.1.0
47
+
48
+ - Initial public release of the browser-side DXB3/DXBS CAD pack loader.
@@ -0,0 +1,108 @@
1
+ # @nebula-spatial/cad-loader
2
+
3
+ 浏览器侧 DXB3/DXBS CAD pack 加载运行时。负责解析文档、构建 Three.js 渲染资源,并
4
+ 提供图层、INSERT、文本和外部资源的文档级访问能力。
5
+
6
+ 有完整视图需求的应用通常通过 `@nebula-spatial/viewer` 的 `viewer.cad.open()` 接入。
7
+ 本包适用于需要自行管理 Three.js 场景或 CAD 文档生命周期的集成。
8
+
9
+ ## 文档会话
10
+
11
+ `createCadDocumentSession()` 是推荐的文档级入口。会话提供 header、基础内容就绪状态、
12
+ 视口需求和只读渲染资源;调用方负责场景挂载和相机/视口同步。
13
+
14
+ ```ts
15
+ import {
16
+ createCadDocumentSession,
17
+ getCadDocumentRenderResource,
18
+ } from '@nebula-spatial/cad-loader';
19
+
20
+ const session = createCadDocumentSession('/api/files/demo/result', {
21
+ filename: 'demo.dxf',
22
+ });
23
+ const renderNode = getCadDocumentRenderResource(session);
24
+
25
+ scene.add(renderNode.object);
26
+ const stopChanges = renderNode.onChange(() => requestRender());
27
+
28
+ const header = await session.headerReady;
29
+ fitCamera(header.bounds);
30
+
31
+ session.setDisplayContext(displayContext);
32
+ session.setViewportDemand(viewportDemand);
33
+ await session.initialContentReady;
34
+
35
+ stopChanges();
36
+ scene.remove(renderNode.object);
37
+ session.dispose();
38
+ ```
39
+
40
+ `headerReady` 提供文档边界和图层元数据,`initialContentReady` 表示基础内容已可用。
41
+ 通过 `content-appended`、`demand-progress`、`phase-change` 和错误事件可监听后续变化。
42
+ 初始视口所需的外部 block sidecar 会并行请求;首批结果到达后即可增量渲染,剩余结果合并为尾批提交。
43
+ 会话会复用几何 Worker 和主 DXB3 解析缓存,避免连续 delta 解析重复传输和解析主缓冲区。
44
+
45
+ 默认几何准备 Worker 从包内的相对资源路径加载。使用非 Vite bundler、CSP 限制环境或自行托管
46
+ Worker 资源时,可在会话选项中传入 `workerUrl`;需要完全控制 Worker 创建时,可传入优先级更高的
47
+ `workerFactory`:
48
+
49
+ ```ts
50
+ const session = createCadDocumentSession(source, {
51
+ workerUrl: new URL('/assets/geo-prepare.worker.js', window.location.href),
52
+ // workerFactory: () => new Worker('/assets/geo-prepare.worker.js', { type: 'module' }),
53
+ });
54
+ ```
55
+
56
+ `CadRenderNode` 是只读渲染资源。选择状态、属性面板、编辑命令和历史记录由产品层维护。
57
+
58
+ ## 全局文字构建配置
59
+
60
+ 需要显式调整 Troika 文字构建参数时,在第一次 CAD 文字请求(包括字体预热)之前调用
61
+ `configureCadTextBuilder()`:
62
+
63
+ ```ts
64
+ import { configureCadTextBuilder } from '@nebula-spatial/cad-loader';
65
+
66
+ configureCadTextBuilder({
67
+ defaultFontURL: '/fonts/cad-fallback.ttf',
68
+ useWorker: true,
69
+ sdfGlyphSize: 64,
70
+ textureWidth: 2048,
71
+ });
72
+ ```
73
+
74
+ 该配置沿用 Troika 的全局、模块级、一次性语义,不是文档会话或 Viewer 实例级配置。调用方
75
+ 负责选择具体字体资源;字符和语言到字体的映射仍通过 `resolveTextFont` 提供。未调用时,
76
+ `cad-loader` 不会设置任何默认值,继续使用 Troika 原有的内置远端资源逻辑。
77
+
78
+ ## 其他入口
79
+
80
+ - `loadGeo()`:简单的 `GeoNode` 增量加载。适合不需要文档会话的 Three.js 集成。
81
+ - `createLoadSession()`:以异步事件流消费 CAD pack,适合自定义渲染器或流量控制。
82
+ - `@nebula-spatial/cad-loader/core`:不依赖 Three.js、DOM 或 WebGL 的协议解析 API,可用于
83
+ Worker、Node.js 和 CLI。
84
+
85
+ ```ts
86
+ import { loadGeo } from '@nebula-spatial/cad-loader';
87
+
88
+ const node = loadGeo('/api/files/demo/result');
89
+ scene.add(node);
90
+ node.setViewportSize(canvas.clientWidth, canvas.clientHeight);
91
+ await node.ready;
92
+ ```
93
+
94
+ 默认 Worker 使用包内 ESM 资源路径。使用非 Vite bundler 或自行托管 Worker 资源时,可通过
95
+ `LoadGeoOptions.workerUrl` 或 `workerFactory` 配置 Worker 创建方式。
96
+
97
+ ## 边界
98
+
99
+ 本包不处理上传、任务轮询、文件目录或原始 DXF/DWG 解析。运行时依赖为 `three` peer
100
+ dependency,要求 Node.js 18 或更高版本。
101
+
102
+ ## 开发
103
+
104
+ ```bash
105
+ npm run typecheck --workspace @nebula-spatial/cad-loader
106
+ npm test --workspace @nebula-spatial/cad-loader
107
+ npm run build --workspace @nebula-spatial/cad-loader
108
+ ```
@@ -0,0 +1,26 @@
1
+ import type { ExternalBlockVariantManifestEntry, GeoMeta, LayerSnapshot, TextEntity } from './types';
2
+ import type { GeoChunk, GeoGeometryChunk, InsertRuntimeInstance, InsertRuntimeVariant, ParsedHeader } from './parser/types';
3
+ /** Stable renderer-neutral public vocabulary for decoded CAD packs. */
4
+ export type CadPackHeader = ParsedHeader;
5
+ export type CadPackDocumentHeader = ParsedHeader;
6
+ export type CadPackMeta = GeoMeta;
7
+ export type CadLayer = LayerSnapshot;
8
+ export type CadDisplayChunk = GeoGeometryChunk;
9
+ export type CadTextChunk = TextEntity;
10
+ export type CadBlockDefinition = InsertRuntimeVariant;
11
+ export type CadInsertInstance = InsertRuntimeInstance;
12
+ export type CadExternalVariantManifestEntry = ExternalBlockVariantManifestEntry;
13
+ export type CadExternalVariantManifest = readonly ExternalBlockVariantManifestEntry[];
14
+ export interface CadExternalVariantDelta {
15
+ readonly header: ParsedHeader;
16
+ readonly chunks: readonly GeoChunk[];
17
+ }
18
+ /**
19
+ * A decoded pack document. Parsers may keep typed-array payloads backed by the
20
+ * original buffer; `rawBytes` records the source size for diagnostics.
21
+ */
22
+ export interface CadPackDocument {
23
+ readonly header: ParsedHeader;
24
+ readonly chunks: readonly GeoChunk[];
25
+ readonly rawBytes: number;
26
+ }
@@ -0,0 +1,5 @@
1
+ export type GeoLoaderErrorCode = 'E_SOURCE' | 'E_HEADER' | 'E_HEADER_JSON' | 'E_GROUP_RANGE' | 'E_UNSUPPORTED_PACK_VERSION' | 'E_EXPANSION_BUDGET' | 'E_SEGMENT_SUM' | 'E_TEXT_ROUNDTRIP' | 'E_DISPOSED' | 'E_PACK_HTTP' | 'E_PACK_NETWORK';
2
+ export declare class GeoLoaderError extends Error {
3
+ readonly code: GeoLoaderErrorCode;
4
+ constructor(code: GeoLoaderErrorCode, message: string);
5
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Public, renderer-neutral entry point for the DXB3/DXBS pack protocol.
3
+ *
4
+ * Keep this file deliberately boring: consumers (including cad-loader) should
5
+ * only need the package root and must not reach into parser implementation
6
+ * paths. The `Cad*` names below are stable vocabulary aliases over the
7
+ * protocol records that predate this package extraction.
8
+ */
9
+ export { GeoLoaderError, GeoLoaderError as CadPackError } from './errors';
10
+ export type { GeoLoaderErrorCode, GeoLoaderErrorCode as CadPackErrorCode, } from './errors';
11
+ export { captureGroupSnapshot, groupLayerEncodingForV3Minor, readGroup, streamGroupChunks, STREAM_VERTEX_WINDOW, } from './parser/bin-group-reader';
12
+ export { parseBinBounds, parseBinPayload, parseBinStreaming, parseBinStreamingWithCache, parseBinToChunks, readExternalAnnotationManifest, readExternalBlockAnnotations, readExternalVariantDependencyPlan, readExternalVariantGeometrySidecar, readExternalVariantManifest, } from './parser/bin-parser';
13
+ export type { BinDocumentCache, BinStreamingResult, ExternalVariantDependencyOptions, ExternalVariantDependencyPlan, ParseBinOptions, } from './parser/bin-parser';
14
+ export { getDxbsSection, isDxbsPayload, readBlockAnnotationSidecar, readDxbsContainer, readSceneAnnotationSidecar, } from './parser/dxbs-sidecar';
15
+ export type { DecodedAnnotationSidecar, DxbsContainer, DxbsSectionEntry, } from './parser/dxbs-sidecar';
16
+ export { emptyGeometryChunk, expandGeometryChunkMetadata, mergeAdjacentSegments, normalizeGeometrySegments, offsetGeometrySegments, remapGeometrySegmentLayers, sliceGeometrySegments, } from './parser/geometry-segments';
17
+ export type { ExpandedGeometryMetadata, GeometrySegmentSource, } from './parser/geometry-segments';
18
+ export { assertStrictTextRoundtrip, isStrictTextRoundtripEnabled, shouldAssertStrictTextRoundtrip, } from './parser/text-roundtrip';
19
+ export type * from './types';
20
+ export type * from './parser/types';
21
+ export type * from './cad-types';
22
+ export type { InsertInstanceTransform } from './utils/insert-bbox';
23
+ export { transformBBoxByInstance } from './utils/insert-bbox';
24
+ export { cloneViewportRect, computeViewportRectFromPositions, expandViewportRect, intersectViewportRects, mergeViewportRects, normalizeViewportRect, transformViewportRect, viewportRectCenterDistance, viewportRectDiagonal, viewportRectContains, viewportRectEquals, viewportRectIntersects, } from './utils/viewport-rect';