@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.
- package/README.md +206 -3
- package/dist/ai/contract.d.ts +73 -0
- package/dist/ai/host.d.ts +28 -0
- package/dist/asset/dependency-scan.d.ts +78 -0
- package/dist/asset/intake.d.ts +84 -0
- package/dist/asset/layout-detect.d.ts +40 -0
- package/dist/asset/media-type.d.ts +10 -0
- package/dist/asset/model-inspection.d.ts +127 -0
- package/dist/asset/record.d.ts +35 -0
- package/dist/asset/remote-asset-resolver.d.ts +36 -0
- package/dist/asset/repairs.d.ts +53 -0
- package/dist/asset/resource-locator.d.ts +15 -0
- package/dist/asset/revision-diff.d.ts +33 -0
- package/dist/asset/source-contracts.d.ts +21 -0
- package/dist/asset/source-paths.d.ts +15 -0
- package/dist/asset/usd-inspection.d.ts +39 -0
- package/dist/asset/usd-source-metadata.d.ts +142 -0
- package/dist/asset/visual-intake.d.ts +27 -0
- package/dist/asset/visual-record.d.ts +22 -0
- package/dist/asset/web-intake.d.ts +46 -0
- package/dist/asset-source-BExlEcRt.js +444 -0
- package/dist/assets/usd-export-worker-BsGubtAE.js +1 -0
- package/dist/builders-BAXRR5o5.js +1854 -0
- package/dist/core/asset-task.d.ts +105 -0
- package/dist/core/context.d.ts +23 -0
- package/dist/core/host.d.ts +432 -0
- package/dist/core/persistence-controller.d.ts +58 -0
- package/dist/core/plugins.d.ts +139 -0
- package/dist/core/scene-tree.d.ts +62 -0
- package/dist/core/versions.d.ts +2 -0
- package/dist/core/when.d.ts +13 -0
- package/dist/core/write-policy.d.ts +29 -0
- package/dist/delivery/build-plan.d.ts +2 -0
- package/dist/delivery/contracts.d.ts +362 -0
- package/dist/delivery/digest.d.ts +3 -0
- package/dist/delivery/evidence.d.ts +10 -0
- package/dist/delivery/export-evidence.d.ts +3 -0
- package/dist/delivery/index.d.ts +9 -0
- package/dist/delivery/prim-name.d.ts +17 -0
- package/dist/delivery/profile.d.ts +4 -0
- package/dist/doc/builders.d.ts +99 -0
- package/dist/doc/command.d.ts +195 -0
- package/dist/doc/domain-extensions.d.ts +34 -0
- package/dist/doc/node-facts.d.ts +87 -0
- package/dist/doc/physics-facts.d.ts +74 -0
- package/dist/doc/placement-policy.d.ts +71 -0
- package/dist/doc/random-placement.d.ts +30 -0
- package/dist/doc/scene-graph.d.ts +80 -0
- package/dist/doc/scene-regions.d.ts +29 -0
- package/dist/doc/schema.d.ts +452 -0
- package/dist/doc/task.d.ts +71 -0
- package/dist/doc/validate.d.ts +68 -0
- package/dist/editor/asset-source.d.ts +15 -0
- package/dist/editor/editor.d.ts +246 -0
- package/dist/editor/index.d.ts +22 -0
- package/dist/editor/shortcuts.d.ts +2 -0
- package/dist/editor/types.d.ts +143 -0
- package/dist/editor/ui-plugins.d.ts +64 -0
- package/dist/editor.js +1755 -0
- package/dist/editorial-BkAFWfbg.js +83 -0
- package/dist/export-evidence-B_0zRmb8.js +5027 -0
- package/dist/generalization/domain.d.ts +10 -0
- package/dist/generalization/generalization.d.ts +371 -0
- package/dist/generalization/index.d.ts +11 -0
- package/dist/generalization.js +1659 -0
- package/dist/history/undo-stack.d.ts +74 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.js +2839 -0
- package/dist/persist/content-addressed.d.ts +11 -0
- package/dist/persist/create-scene-package-from-host.d.ts +7 -0
- package/dist/persist/indexeddb-store.d.ts +69 -0
- package/dist/persist/scene-file.d.ts +52 -0
- package/dist/persist/scene-package.d.ts +8 -0
- package/dist/persist/snapshot.d.ts +5 -0
- package/dist/physics-facts-tfQYyNTD.js +337 -0
- package/dist/placement-policy-DY_FNRDu.js +405 -0
- package/dist/ports/asset-ingestor.d.ts +41 -0
- package/dist/ports/asset-source.d.ts +57 -0
- package/dist/ports/delivery.d.ts +13 -0
- package/dist/ports/persistence.d.ts +29 -0
- package/dist/project/asset-catalog.d.ts +21 -0
- package/dist/project/contracts.d.ts +272 -0
- package/dist/project/editorial.d.ts +16 -0
- package/dist/project/identity.d.ts +20 -0
- package/dist/project/index.d.ts +9 -0
- package/dist/project/scene-document.d.ts +5 -0
- package/dist/project/source-dependencies.d.ts +7 -0
- package/dist/remote-asset-resolver-Cb8cfNmw.js +136 -0
- package/dist/scene/index.d.ts +12 -0
- package/dist/scene-graph-DBLKAhxa.js +681 -0
- package/dist/scene-session-BV1HnxNh.js +3506 -0
- package/dist/scene.js +244 -0
- package/dist/studio/delivery-catalog.d.ts +28 -0
- package/dist/studio/in-memory-asset-source.d.ts +15 -0
- package/dist/studio/index.d.ts +31 -0
- package/dist/studio/indexeddb-asset-source.d.ts +32 -0
- package/dist/studio/indexeddb-persistence.d.ts +13 -0
- package/dist/studio/remote-asset-importer.d.ts +56 -0
- package/dist/studio/source-package.d.ts +9 -0
- package/dist/studio/usd-export-client.d.ts +13 -0
- package/dist/studio/usd-export-protocol.d.ts +98 -0
- package/dist/studio/usd-export-worker.d.ts +1 -0
- package/dist/studio/usd-zip-reader.d.ts +14 -0
- package/dist/studio/web-asset-ingestor.d.ts +10 -0
- package/dist/studio/web-host.d.ts +8 -0
- package/dist/studio.js +5544 -0
- package/dist/util/asset-facts.d.ts +3 -0
- package/dist/util/data.d.ts +17 -0
- package/dist/util/diagnostics.d.ts +38 -0
- package/dist/util/geometry.d.ts +11 -0
- package/dist/util/hash.d.ts +9 -0
- package/dist/util/ids.d.ts +20 -0
- package/dist/util/math.d.ts +47 -0
- package/dist/util/ply-metadata.d.ts +19 -0
- package/dist/util/studio-source.d.ts +23 -0
- package/dist/version.d.ts +5 -0
- package/dist/view/appearance.d.ts +13 -0
- package/dist/view/authoring-appearance.d.ts +25 -0
- package/dist/view/bounds-preview.d.ts +34 -0
- package/dist/view/bounds.d.ts +11 -0
- package/dist/view/camera-zoom.d.ts +3 -0
- package/dist/view/geometry-anchors.d.ts +20 -0
- package/dist/view/gizmo-appearance.d.ts +5 -0
- package/dist/view/gizmo.d.ts +81 -0
- package/dist/view/group-selection.d.ts +13 -0
- package/dist/view/node-features.d.ts +39 -0
- package/dist/view/picking.d.ts +49 -0
- package/dist/view/placement.d.ts +48 -0
- package/dist/view/region-editing.d.ts +25 -0
- package/dist/view/rotation-guide.d.ts +36 -0
- package/dist/view/runtime-capabilities.d.ts +22 -0
- package/dist/view/scene-session.d.ts +258 -0
- package/dist/view/screen-bounds.d.ts +17 -0
- package/dist/view/selection-transform.d.ts +20 -0
- package/node_modules/@nebula-spatial/cad-loader/CHANGELOG.md +48 -0
- package/node_modules/@nebula-spatial/cad-loader/README.md +108 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/cad-types.d.ts +26 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/errors.d.ts +5 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/index.d.ts +24 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/index.js +2354 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-group-reader.d.ts +9 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-parser.d.ts +78 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/dxbs-sidecar.d.ts +24 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/geometry-segments.d.ts +20 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/text-roundtrip.d.ts +4 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/types.d.ts +81 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/runtime-text-decoder.d.ts +8 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/types.d.ts +153 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/insert-bbox.d.ts +10 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/viewport-rect.d.ts +21 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/index.d.ts +36 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/index.js +5829 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/geo-loader.d.ts +59 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/automatic-external-resources.d.ts +26 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/external-variant-sidecar-fetch.d.ts +13 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/flow-control.d.ts +29 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/frame-budget-scheduler.d.ts +21 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-compact-executor.d.ts +19 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-local-adapter.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-pipeline.d.ts +92 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-worker-adapter.d.ts +13 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-builder.d.ts +34 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-load-sink.d.ts +28 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node.d.ts +304 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare-worker-types.d.ts +94 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.d.ts +38 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.worker.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-model-builder.d.ts +10 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-runtime-geometry.d.ts +15 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-canonical.d.ts +37 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-quality.d.ts +9 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/prepare-credit-gate.d.ts +20 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/transport.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/cad-render-node.d.ts +80 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/geo-node-cad-render-node.d.ts +12 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-geometry.d.ts +28 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-material.d.ts +18 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/block-geometry-registry.d.ts +35 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/insert-instance-table.d.ts +23 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/viewport-instance-presenter.d.ts +66 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-insert-selection.d.ts +35 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-text-selection.d.ts +31 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/annotation-idle-gate.d.ts +14 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-document-session.d.ts +187 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-font-runtime.d.ts +11 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-insert-id.d.ts +6 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-text-warmup.d.ts +38 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/create-cad-document-session.d.ts +5 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/load-session.d.ts +90 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/viewport-coverage.d.ts +32 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/abort.d.ts +3 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-display-color.d.ts +55 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-load-source.d.ts +8 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/color-buffer.d.ts +6 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/constants.d.ts +11 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/display-color-buffer.d.ts +27 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/errors.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-builder.d.ts +25 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-font.d.ts +12 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/types.d.ts +57 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/insert-bbox.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/timing.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/viewport-rect.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/viewer-theme.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/workers/geo-prepare.worker.js +2264 -0
- package/node_modules/@nebula-spatial/cad-loader/package.json +62 -0
- package/node_modules/@nebula-spatial/viewer/CHANGELOG.md +426 -0
- package/node_modules/@nebula-spatial/viewer/FBX-MATERIAL-CONVERSION.md +97 -0
- package/node_modules/@nebula-spatial/viewer/README.md +1056 -0
- package/node_modules/@nebula-spatial/viewer/USD-VISUAL-MATERIAL-SUPPORT.md +89 -0
- package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.js +19 -0
- package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.wasm +0 -0
- package/node_modules/@nebula-spatial/viewer/dist/asset-ir-DEOK9SqE.js +382 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/ground-grid.d.ts +6 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/source-types.d.ts +19 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/types.d.ts +393 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/usd-worker-Bom5cjz3.js +1392 -0
- package/node_modules/@nebula-spatial/viewer/dist/cad/text.d.ts +2 -0
- package/node_modules/@nebula-spatial/viewer/dist/cad/types.d.ts +368 -0
- package/node_modules/@nebula-spatial/viewer/dist/index-ByBlfVc0.js +12132 -0
- package/node_modules/@nebula-spatial/viewer/dist/index.d.ts +32 -0
- package/node_modules/@nebula-spatial/viewer/dist/index.js +26 -0
- package/node_modules/@nebula-spatial/viewer/dist/inspection/types.d.ts +112 -0
- package/node_modules/@nebula-spatial/viewer/dist/mjcf-visual-DVRa0w90.js +72 -0
- package/node_modules/@nebula-spatial/viewer/dist/mujoco-runtime-Dhx6Ua2u.js +463 -0
- package/node_modules/@nebula-spatial/viewer/dist/plugins.d.ts +179 -0
- package/node_modules/@nebula-spatial/viewer/dist/scene/instances.d.ts +36 -0
- package/node_modules/@nebula-spatial/viewer/dist/scene/types.d.ts +258 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-B-j6KdA-.js +389 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-B4AICTeJ.js +963 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-BAG5cDYe.js +9153 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-runtime.d.ts +118 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-wasm-module.d.ts +11 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/openusd-wasm-module.d.ts +10 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/physics-runtime-state.d.ts +75 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/types.d.ts +129 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-inspection.d.ts +66 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-query.d.ts +50 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-resource-policy.d.ts +28 -0
- package/node_modules/@nebula-spatial/viewer/dist/types.d.ts +278 -0
- package/node_modules/@nebula-spatial/viewer/dist/ui/types.d.ts +48 -0
- package/node_modules/@nebula-spatial/viewer/dist/urdf-session-kemAnBn8.js +3231 -0
- package/node_modules/@nebula-spatial/viewer/dist/usd-session-QtwGKI7v.js +6771 -0
- package/node_modules/@nebula-spatial/viewer/dist/version.d.ts +5 -0
- package/node_modules/@nebula-spatial/viewer/dist/viewer.d.ts +2 -0
- package/node_modules/@nebula-spatial/viewer/dist/xacro-CYTPS7mh.js +1537 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd-runtime-manifest.json +15 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.js +14 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.wasm +0 -0
- package/node_modules/@nebula-spatial/viewer/package.json +66 -0
- package/package.json +87 -6
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import type { CadInsertDetails, CadInsertSelectionId } from '../selection/cad-insert-selection';
|
|
2
|
+
import type { CadTextDetails, CadTextSelection, CadTextSelectionId } from '../selection/cad-text-selection';
|
|
3
|
+
import type { ResolveTextFont } from '../shared/text-font';
|
|
4
|
+
import type { CadTextWarmupOptions } from './cad-text-warmup';
|
|
5
|
+
import type { ViewportRect } from '../core';
|
|
6
|
+
export type { CadInsertDetails, CadInsertSelectionId } from '../selection/cad-insert-selection';
|
|
7
|
+
export type { CadTextDetails, CadTextSelection, CadTextSelectionId } from '../selection/cad-text-selection';
|
|
8
|
+
export type { CadLoadSource } from '../shared/cad-load-source';
|
|
9
|
+
export type { CadTextWarmupOptions, CadTextWarmupStats } from './cad-text-warmup';
|
|
10
|
+
export type { ViewportRect as CadViewportRect } from '../core';
|
|
11
|
+
export type CadSessionPhase = 'created' | 'header-ready' | 'initial-loading' | 'interactive' | 'failed' | 'disposed';
|
|
12
|
+
export declare const CAD_SESSION_PHASES: readonly ["created", "header-ready", "initial-loading", "interactive", "failed", "disposed"];
|
|
13
|
+
export interface CadWorldPoint {
|
|
14
|
+
readonly x: number;
|
|
15
|
+
readonly y: number;
|
|
16
|
+
readonly z: number;
|
|
17
|
+
}
|
|
18
|
+
/** Authoritative CAD bounds. Planar sources use a degenerate Z interval. */
|
|
19
|
+
export interface CadWorldBounds {
|
|
20
|
+
readonly minX: number;
|
|
21
|
+
readonly minY: number;
|
|
22
|
+
readonly minZ: number;
|
|
23
|
+
readonly maxX: number;
|
|
24
|
+
readonly maxY: number;
|
|
25
|
+
readonly maxZ: number;
|
|
26
|
+
readonly planar: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface CadLayerMeta {
|
|
29
|
+
readonly index: number;
|
|
30
|
+
readonly name: string;
|
|
31
|
+
readonly color: readonly [number, number, number];
|
|
32
|
+
readonly visible: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** Source units carried by a generated CAD pack when available. */
|
|
35
|
+
export interface CadDocumentUnits {
|
|
36
|
+
readonly source: string;
|
|
37
|
+
readonly scaleToMeters?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface CadVisibilityFilter {
|
|
40
|
+
readonly layerVisible?: ReadonlyMap<number, boolean> | ((layerIndex: number) => boolean);
|
|
41
|
+
readonly insertVisible?: ReadonlySet<string> | ((insertId: string) => boolean);
|
|
42
|
+
readonly includeUnmountedExternal?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface CadViewportDemand {
|
|
45
|
+
readonly documentRect: ViewportRect;
|
|
46
|
+
readonly worldUnitsPerPixel: number;
|
|
47
|
+
readonly viewportWidthPx: number;
|
|
48
|
+
readonly viewportHeightPx: number;
|
|
49
|
+
readonly viewMode: '2d' | '3d';
|
|
50
|
+
readonly interaction: 'active' | 'idle';
|
|
51
|
+
readonly visibilityRevision: number;
|
|
52
|
+
}
|
|
53
|
+
export interface CadDisplayContext {
|
|
54
|
+
/** Visible document-space bounds used to cull INSERT instances in 2D. */
|
|
55
|
+
readonly documentRect?: ViewportRect | null;
|
|
56
|
+
readonly viewportWidthPx: number;
|
|
57
|
+
readonly viewportHeightPx: number;
|
|
58
|
+
readonly devicePixelRatio: number;
|
|
59
|
+
readonly worldUnitsPerPixel: number;
|
|
60
|
+
readonly viewMode: '2d' | '3d';
|
|
61
|
+
readonly quality: 'auto' | 'full' | 'stress';
|
|
62
|
+
}
|
|
63
|
+
export interface CadDocumentHeader {
|
|
64
|
+
readonly bounds: CadWorldBounds | null;
|
|
65
|
+
readonly layers: readonly CadLayerMeta[];
|
|
66
|
+
readonly sourceFingerprint: string;
|
|
67
|
+
readonly format: string;
|
|
68
|
+
readonly filename: string | null;
|
|
69
|
+
readonly units?: CadDocumentUnits;
|
|
70
|
+
}
|
|
71
|
+
export interface CadInsertSelection {
|
|
72
|
+
readonly documentKey: string | null;
|
|
73
|
+
readonly id: CadInsertSelectionId;
|
|
74
|
+
readonly details: CadInsertDetails | null;
|
|
75
|
+
}
|
|
76
|
+
export interface CadSessionHeaderEvent {
|
|
77
|
+
readonly header: CadDocumentHeader;
|
|
78
|
+
}
|
|
79
|
+
export interface CadSessionContentAppendedEvent {
|
|
80
|
+
readonly contentRevision: number;
|
|
81
|
+
readonly kind: 'geometry' | 'annotation';
|
|
82
|
+
}
|
|
83
|
+
export interface CadSessionDemandProgressEvent {
|
|
84
|
+
readonly demandRevision: number;
|
|
85
|
+
readonly pending: number;
|
|
86
|
+
readonly loaded: number;
|
|
87
|
+
readonly settled: boolean;
|
|
88
|
+
}
|
|
89
|
+
/** A monotonic start clock plus load milestones elapsed from session creation. */
|
|
90
|
+
export interface CadSessionLoadTiming {
|
|
91
|
+
readonly startedAtMs: number;
|
|
92
|
+
readonly mainBufferLoadedMs?: number;
|
|
93
|
+
readonly headerReadyMs?: number;
|
|
94
|
+
readonly initialSidecarFetchStartedMs?: number;
|
|
95
|
+
readonly firstRenderableReadyMs?: number;
|
|
96
|
+
readonly baseGeometryReadyMs?: number;
|
|
97
|
+
readonly initialContentReadyMs?: number;
|
|
98
|
+
readonly initialSidecarFetchSettledMs?: number;
|
|
99
|
+
readonly initialExternalContentReadyMs?: number;
|
|
100
|
+
readonly initialViewportSettledMs?: number;
|
|
101
|
+
readonly failedMs?: number;
|
|
102
|
+
readonly initialRequiredVariantCount: number;
|
|
103
|
+
readonly initialSidecarLoadedCount: number;
|
|
104
|
+
readonly initialSidecarBytes: number;
|
|
105
|
+
}
|
|
106
|
+
export interface CadSessionPhaseChangeEvent {
|
|
107
|
+
readonly phase: CadSessionPhase;
|
|
108
|
+
}
|
|
109
|
+
export interface CadSessionErrorEvent {
|
|
110
|
+
readonly error: Error;
|
|
111
|
+
}
|
|
112
|
+
export interface CadSessionEventMap {
|
|
113
|
+
header: CadSessionHeaderEvent;
|
|
114
|
+
'content-appended': CadSessionContentAppendedEvent;
|
|
115
|
+
'initial-content-ready': void;
|
|
116
|
+
'demand-progress': CadSessionDemandProgressEvent;
|
|
117
|
+
'load-timing': {
|
|
118
|
+
readonly timing: CadSessionLoadTiming;
|
|
119
|
+
};
|
|
120
|
+
'phase-change': CadSessionPhaseChangeEvent;
|
|
121
|
+
'non-fatal-error': CadSessionErrorEvent;
|
|
122
|
+
'fatal-error': CadSessionErrorEvent;
|
|
123
|
+
}
|
|
124
|
+
export interface CadFontRequest {
|
|
125
|
+
readonly family?: string;
|
|
126
|
+
readonly styleName?: string;
|
|
127
|
+
readonly shxName?: string;
|
|
128
|
+
readonly weight?: number;
|
|
129
|
+
readonly italic?: boolean;
|
|
130
|
+
}
|
|
131
|
+
export interface CadResolvedFont {
|
|
132
|
+
readonly fontUrl?: string;
|
|
133
|
+
readonly family?: string;
|
|
134
|
+
readonly fallback: boolean;
|
|
135
|
+
readonly sourceFingerprint?: string;
|
|
136
|
+
}
|
|
137
|
+
export interface CadFontResolver {
|
|
138
|
+
resolve(request: CadFontRequest, signal?: AbortSignal): Promise<CadResolvedFont | null>;
|
|
139
|
+
}
|
|
140
|
+
export interface CadInsertUsageSummary {
|
|
141
|
+
readonly insertId: string;
|
|
142
|
+
readonly blockName: string;
|
|
143
|
+
readonly layerName: string;
|
|
144
|
+
readonly layerIndex: number;
|
|
145
|
+
readonly instanceId: number;
|
|
146
|
+
readonly variantId: number;
|
|
147
|
+
readonly label: string;
|
|
148
|
+
readonly canHighlight: boolean;
|
|
149
|
+
readonly visible: boolean;
|
|
150
|
+
}
|
|
151
|
+
export interface CadDocumentSession {
|
|
152
|
+
readonly phase: CadSessionPhase;
|
|
153
|
+
readonly loadTiming: CadSessionLoadTiming;
|
|
154
|
+
readonly headerReady: Promise<CadDocumentHeader>;
|
|
155
|
+
readonly initialContentReady: Promise<void>;
|
|
156
|
+
setViewportDemand(demand: CadViewportDemand): void;
|
|
157
|
+
setDisplayContext(context: CadDisplayContext): void;
|
|
158
|
+
on<K extends keyof CadSessionEventMap>(type: K, listener: (event: CadSessionEventMap[K]) => void): () => void;
|
|
159
|
+
getBounds(filter: CadVisibilityFilter): CadWorldBounds | null;
|
|
160
|
+
getLayers(): readonly CadLayerMeta[];
|
|
161
|
+
listInsertUsages(): readonly CadInsertUsageSummary[];
|
|
162
|
+
getBlockDetails(id: string): CadInsertDetails | null;
|
|
163
|
+
getTextDetails?(id: CadTextSelectionId): CadTextDetails | null;
|
|
164
|
+
pickInsertAtPoint(point: CadWorldPoint, viewport: ViewportRect): CadInsertSelection | null;
|
|
165
|
+
/** Optional for compatibility with pre-text-picking session adapters. */
|
|
166
|
+
pickTextAtPoint?(point: CadWorldPoint): CadTextSelection | null;
|
|
167
|
+
abort(reason?: unknown): void;
|
|
168
|
+
dispose(): void;
|
|
169
|
+
}
|
|
170
|
+
export interface CadDocumentSessionOptions {
|
|
171
|
+
readonly documentKey?: string;
|
|
172
|
+
readonly filename?: string;
|
|
173
|
+
readonly loadAnnotations?: boolean;
|
|
174
|
+
/** Override the package-relative geometry preparation Worker URL. */
|
|
175
|
+
readonly workerUrl?: string | URL;
|
|
176
|
+
/** Create the geometry preparation Worker. Takes precedence over `workerUrl`. */
|
|
177
|
+
readonly workerFactory?: () => Worker;
|
|
178
|
+
readonly fontResolver?: CadFontResolver;
|
|
179
|
+
readonly resolveTextFont?: ResolveTextFont;
|
|
180
|
+
/**
|
|
181
|
+
* Troika glyph warmup policy. Defaults to enabled: characters of appended
|
|
182
|
+
* texts (initial load, delta variants, annotations) are preloaded in
|
|
183
|
+
* idle-delayed background batches. Set to `false` to disable.
|
|
184
|
+
*/
|
|
185
|
+
readonly textWarmup?: boolean | CadTextWarmupOptions;
|
|
186
|
+
readonly signal?: AbortSignal;
|
|
187
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ResolveTextFont } from '../shared/text-font';
|
|
2
|
+
import type { CadFontResolver } from './cad-document-session';
|
|
3
|
+
export type CadFontRuntime = {
|
|
4
|
+
readonly resolveTextFont: ResolveTextFont;
|
|
5
|
+
dispose(): void;
|
|
6
|
+
};
|
|
7
|
+
export declare function createCadFontRuntime(input: {
|
|
8
|
+
readonly fontResolver?: CadFontResolver;
|
|
9
|
+
readonly signal: AbortSignal;
|
|
10
|
+
readonly onNonFatalError: (error: Error) => void;
|
|
11
|
+
}): CadFontRuntime;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CadInsertSelectionId } from '../selection/cad-insert-selection';
|
|
2
|
+
export declare function formatCadInsertId(id: CadInsertSelectionId): string;
|
|
3
|
+
export declare function parseCadInsertId(value: string): CadInsertSelectionId | {
|
|
4
|
+
readonly instanceId: number;
|
|
5
|
+
} | null;
|
|
6
|
+
export declare function cadInsertInstanceId(value: string): number | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ResolvedTextFont } from '../shared/text-font';
|
|
2
|
+
export interface CadTextWarmupOptions {
|
|
3
|
+
/** Idle delay before a scheduled warmup batch flushes. Default 600ms. */
|
|
4
|
+
readonly idleDelayMs?: number;
|
|
5
|
+
/** Max unique characters accumulated per font before capping. Default 256. */
|
|
6
|
+
readonly maxUniqueCharsPerFont?: number;
|
|
7
|
+
/** Per-preload timeout. Default 8000ms. */
|
|
8
|
+
readonly timeoutMs?: number;
|
|
9
|
+
/** Max remembered warm signatures. Default 96. */
|
|
10
|
+
readonly signatureCacheLimit?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface CadTextWarmupStats {
|
|
13
|
+
readonly scheduledTexts: number;
|
|
14
|
+
readonly preloadCalls: number;
|
|
15
|
+
readonly skippedRepeatedSignatures: number;
|
|
16
|
+
readonly failedWarmups: number;
|
|
17
|
+
readonly timedOutWarmups: number;
|
|
18
|
+
readonly evictedSignatures: number;
|
|
19
|
+
readonly warmedSignatures: number;
|
|
20
|
+
readonly inFlightWarmups: number;
|
|
21
|
+
}
|
|
22
|
+
export type CadTextWarmup = {
|
|
23
|
+
/** Schedules characters of `texts` for background glyph warmup (idle, deduped). */
|
|
24
|
+
scheduleForTexts(texts: readonly string[]): void;
|
|
25
|
+
/** Cancels pending timers and in-flight bookkeeping. In-flight preloads are left to settle. */
|
|
26
|
+
dispose(): void;
|
|
27
|
+
readonly stats: CadTextWarmupStats;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Session-scoped Troika glyph warmup runtime. Characters are bucketed per
|
|
31
|
+
* resolved font URL, deduped by (font, charset) signature, and preloaded in a
|
|
32
|
+
* single idle-delayed background flush. SSR/headless environments are a no-op.
|
|
33
|
+
*/
|
|
34
|
+
export declare function createCadTextWarmup(input: {
|
|
35
|
+
readonly resolveTextFont: (text: string) => ResolvedTextFont;
|
|
36
|
+
readonly signal: AbortSignal;
|
|
37
|
+
readonly options?: CadTextWarmupOptions;
|
|
38
|
+
}): CadTextWarmup;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type CadLoadSource } from '../shared/cad-load-source';
|
|
2
|
+
import type { CadRenderNode } from '../render-resource/cad-render-node';
|
|
3
|
+
import type { CadDocumentSession, CadDocumentSessionOptions } from './cad-document-session';
|
|
4
|
+
export declare function getCadDocumentRenderResource(session: CadDocumentSession): CadRenderNode;
|
|
5
|
+
export declare function createCadDocumentSession(source: CadLoadSource, options?: CadDocumentSessionOptions): CadDocumentSession;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { CadDisplayChunk, CadInsertInstance, CadPackDocument, CadPackHeader, CadTextChunk, ViewportRect } from '../core';
|
|
2
|
+
import { type CadLoadSource } from '../shared/cad-load-source';
|
|
3
|
+
import type { ExternalBlockVariantManifestEntry } from '../shared/types';
|
|
4
|
+
export type { CadLoadSource } from '../shared/cad-load-source';
|
|
5
|
+
export interface CadLoadFlowControlOptions {
|
|
6
|
+
highWatermarkBytes: number;
|
|
7
|
+
lowWatermarkBytes: number;
|
|
8
|
+
initialGeometryCredits: number;
|
|
9
|
+
initialTextCredits: number;
|
|
10
|
+
}
|
|
11
|
+
export interface CadExternalVariantFetchSource {
|
|
12
|
+
readonly baseUrl: string;
|
|
13
|
+
readonly entries: readonly ExternalBlockVariantManifestEntry[];
|
|
14
|
+
}
|
|
15
|
+
export interface CadLoadSessionOptions {
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
hiddenInstanceIds?: readonly number[];
|
|
18
|
+
keepTextsForHiddenInstances?: boolean;
|
|
19
|
+
loadBlocks?: boolean;
|
|
20
|
+
maxExpandedInstanceVertices?: number;
|
|
21
|
+
preferWorker?: boolean;
|
|
22
|
+
workerUrl?: string | URL;
|
|
23
|
+
workerFactory?: () => Worker;
|
|
24
|
+
externalVariantFetchSource?: CadExternalVariantFetchSource;
|
|
25
|
+
externalVariantBuffers?: ReadonlyMap<number, ArrayBuffer>;
|
|
26
|
+
requiredExternalVariantIds?: readonly number[];
|
|
27
|
+
externalVariantGeometryFetchIds?: readonly number[];
|
|
28
|
+
flowControl?: Partial<CadLoadFlowControlOptions>;
|
|
29
|
+
/** Cooperative decode budget before yielding to the next browser frame. */
|
|
30
|
+
frameBudgetMs?: number;
|
|
31
|
+
/** Time reserved for the renderer/UI within `frameBudgetMs`. */
|
|
32
|
+
frameReserveMs?: number;
|
|
33
|
+
}
|
|
34
|
+
export interface CadLoadMetaEvent {
|
|
35
|
+
readonly type: 'meta';
|
|
36
|
+
readonly meta: CadPackHeader;
|
|
37
|
+
/** Alias kept explicit for consumers that distinguish metadata from the parsed header. */
|
|
38
|
+
readonly header: CadPackHeader;
|
|
39
|
+
}
|
|
40
|
+
export interface CadLoadGeometryEvent {
|
|
41
|
+
readonly type: 'geometry';
|
|
42
|
+
readonly kind: 'line' | 'fill' | 'dot';
|
|
43
|
+
readonly chunk: CadDisplayChunk;
|
|
44
|
+
readonly layerIndex: number;
|
|
45
|
+
readonly lineweightPx?: number;
|
|
46
|
+
readonly bounds: ViewportRect | null;
|
|
47
|
+
}
|
|
48
|
+
export interface CadLoadTextEvent {
|
|
49
|
+
readonly type: 'text';
|
|
50
|
+
readonly chunk: CadTextChunk;
|
|
51
|
+
}
|
|
52
|
+
export interface CadLoadVariantGeometryChunk {
|
|
53
|
+
readonly pos: Float32Array;
|
|
54
|
+
readonly col: Uint8Array;
|
|
55
|
+
readonly count: number;
|
|
56
|
+
readonly layerIndex?: number;
|
|
57
|
+
readonly lineweightPx?: number;
|
|
58
|
+
readonly bounds?: ViewportRect | null;
|
|
59
|
+
}
|
|
60
|
+
export interface CadLoadVariantGeometry {
|
|
61
|
+
readonly variantId: number;
|
|
62
|
+
readonly line: readonly CadLoadVariantGeometryChunk[];
|
|
63
|
+
readonly fill: readonly CadLoadVariantGeometryChunk[];
|
|
64
|
+
readonly dot: readonly CadLoadVariantGeometryChunk[];
|
|
65
|
+
}
|
|
66
|
+
export interface CadLoadInsertEvent {
|
|
67
|
+
readonly type: 'insert';
|
|
68
|
+
readonly instances: readonly CadInsertInstance[];
|
|
69
|
+
readonly variants: readonly CadLoadVariantGeometry[];
|
|
70
|
+
}
|
|
71
|
+
export interface CadLoadVariantRequestEvent {
|
|
72
|
+
readonly type: 'variant-request';
|
|
73
|
+
readonly variantId: number;
|
|
74
|
+
}
|
|
75
|
+
export interface CadLoadReadyEvent {
|
|
76
|
+
readonly type: 'ready';
|
|
77
|
+
readonly document: CadPackDocument;
|
|
78
|
+
}
|
|
79
|
+
export interface CadLoadErrorEvent {
|
|
80
|
+
readonly type: 'error';
|
|
81
|
+
readonly error: Error;
|
|
82
|
+
}
|
|
83
|
+
export type CadLoadEvent = CadLoadMetaEvent | CadLoadGeometryEvent | CadLoadTextEvent | CadLoadInsertEvent | CadLoadVariantRequestEvent | CadLoadReadyEvent | CadLoadErrorEvent;
|
|
84
|
+
export interface CadLoadSession {
|
|
85
|
+
readonly events: AsyncIterable<CadLoadEvent>;
|
|
86
|
+
readonly ready: Promise<CadPackDocument>;
|
|
87
|
+
abort(reason?: unknown): void;
|
|
88
|
+
dispose(): void;
|
|
89
|
+
}
|
|
90
|
+
export declare function createLoadSession(source: CadLoadSource, options?: CadLoadSessionOptions): CadLoadSession;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ViewportRect } from '../core';
|
|
2
|
+
/** Copied from the product AppController viewport-sidecar refresh policy. */
|
|
3
|
+
export declare const EXTERNAL_VIEWPORT_REFRESH_COVERAGE_RATIO = 0.25;
|
|
4
|
+
export declare const EXTERNAL_VIEWPORT_REFRESH_SCALE_TOLERANCE_RATIO = 0.125;
|
|
5
|
+
export type CadViewportCoverageState = {
|
|
6
|
+
readonly viewport: ViewportRect | null;
|
|
7
|
+
readonly worldUnitsPerPixel: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function coarseExternalViewportSignature(state: CadViewportCoverageState): string | null;
|
|
10
|
+
export declare function hiddenInstanceSignature(hiddenInstanceIds: ReadonlySet<number>): string;
|
|
11
|
+
export declare function isWorldUnitsPerPixelClose(previous: number | null, next: number): boolean;
|
|
12
|
+
export declare function canReuseExternalViewportPlan(input: {
|
|
13
|
+
readonly coverage: ViewportRect | null;
|
|
14
|
+
readonly coverageWorldUnitsPerPixel: number | null;
|
|
15
|
+
readonly coverageHiddenSignature: string | null;
|
|
16
|
+
readonly viewport: ViewportRect | null;
|
|
17
|
+
readonly worldUnitsPerPixel: number;
|
|
18
|
+
readonly hiddenSignature: string;
|
|
19
|
+
}): boolean;
|
|
20
|
+
export declare function isExternalViewportRequestStillCurrent(input: {
|
|
21
|
+
readonly requestedViewport: ViewportRect;
|
|
22
|
+
readonly requestedWorldUnitsPerPixel: number;
|
|
23
|
+
readonly requestedHiddenSignature: string;
|
|
24
|
+
readonly latestViewport: ViewportRect | null;
|
|
25
|
+
readonly latestWorldUnitsPerPixel: number;
|
|
26
|
+
readonly latestHiddenSignature: string;
|
|
27
|
+
}): boolean;
|
|
28
|
+
export declare function markExternalViewportCoverage(viewport: ViewportRect, worldUnitsPerPixel: number, hiddenSignature: string): {
|
|
29
|
+
readonly coverage: ViewportRect;
|
|
30
|
+
readonly worldUnitsPerPixel: number;
|
|
31
|
+
readonly hiddenSignature: string;
|
|
32
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function toAbortError(reason: unknown, fallbackMessage?: string): Error;
|
|
2
|
+
export declare function forwardAbortSignal(signal: AbortSignal | undefined, controller: AbortController): () => void;
|
|
3
|
+
export declare function raceWithAbort<T>(promise: Promise<T>, signal: AbortSignal, fallbackMessage?: string): Promise<T>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ViewerThemeName } from './viewer-theme';
|
|
2
|
+
export type CadRgb = [number, number, number];
|
|
3
|
+
export type CadRawColor = {
|
|
4
|
+
kind: 'aci';
|
|
5
|
+
index: number;
|
|
6
|
+
} | {
|
|
7
|
+
kind: 'truecolor';
|
|
8
|
+
rgb: CadRgb;
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'bylayer';
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'byblock';
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'none';
|
|
15
|
+
};
|
|
16
|
+
export type CadDisplayElementKind = 'line' | 'fill' | 'dot' | 'text' | 'hatch' | 'overlay';
|
|
17
|
+
export type CadDisplayState = 'normal' | 'hover' | 'selected' | 'hidden' | 'locked' | 'xrefFaded';
|
|
18
|
+
export interface CadDisplayColorContext {
|
|
19
|
+
theme: ViewerThemeName;
|
|
20
|
+
layerColor?: CadRawColor | null;
|
|
21
|
+
byBlockColor?: CadRawColor | null;
|
|
22
|
+
parentByBlockColor?: CadRawColor | null;
|
|
23
|
+
fallbackColor?: CadRawColor | null;
|
|
24
|
+
elementKind?: CadDisplayElementKind;
|
|
25
|
+
state?: CadDisplayState;
|
|
26
|
+
enhanceContrast?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface CadDisplayColor {
|
|
29
|
+
rgb: CadRgb;
|
|
30
|
+
opacity: number;
|
|
31
|
+
raw: CadRawColor;
|
|
32
|
+
resolvedRaw: CadRawColor;
|
|
33
|
+
adapted: boolean;
|
|
34
|
+
}
|
|
35
|
+
type ThemeDisplayPalette = {
|
|
36
|
+
background: CadRgb;
|
|
37
|
+
foreground: CadRgb;
|
|
38
|
+
defaultLine: CadRgb;
|
|
39
|
+
defaultText: CadRgb;
|
|
40
|
+
hover: CadRgb;
|
|
41
|
+
selected: CadRgb;
|
|
42
|
+
lockedOpacity: number;
|
|
43
|
+
xrefOpacity: number;
|
|
44
|
+
hatchOpacity: number;
|
|
45
|
+
};
|
|
46
|
+
export declare function getCadThemeDisplayPalette(theme: ViewerThemeName): ThemeDisplayPalette;
|
|
47
|
+
export declare function resolveCadDisplayColor(raw: CadRawColor, context: CadDisplayColorContext): CadDisplayColor;
|
|
48
|
+
export declare function adaptCadDisplayRgb(rgb: readonly [number, number, number], context: Pick<CadDisplayColorContext, 'theme' | 'elementKind' | 'enhanceContrast'>): CadRgb;
|
|
49
|
+
export declare function resolveCadRawColor(raw: CadRawColor, context: CadDisplayColorContext, depth?: number): CadRawColor;
|
|
50
|
+
export declare function isLikelyLegacyForegroundRgb(rgb: readonly [number, number, number]): boolean;
|
|
51
|
+
export declare function isLegacyDefaultForegroundRgb(rgb: readonly [number, number, number]): boolean;
|
|
52
|
+
export declare function rawColorFromLegacyRgb(rgb: readonly [number, number, number], options?: {
|
|
53
|
+
treatLegacyForegroundAsAci7?: boolean;
|
|
54
|
+
}): CadRawColor;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GeoLoadSource } from './types';
|
|
2
|
+
export type CadLoadSource = GeoLoadSource | ArrayBuffer | string | URL | Pick<File, 'arrayBuffer'>;
|
|
3
|
+
export interface NormalizedCadLoadSource {
|
|
4
|
+
readonly source: GeoLoadSource;
|
|
5
|
+
readonly sourceSignal?: AbortSignal;
|
|
6
|
+
}
|
|
7
|
+
export declare function normalizeCadLoadSource(source: CadLoadSource, signal: AbortSignal): NormalizedCadLoadSource;
|
|
8
|
+
export declare function assertGeoLoadSource(source: unknown): asserts source is GeoLoadSource;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BufferAttribute } from 'three';
|
|
2
|
+
export type RgbColorArray = Uint8Array | Float32Array;
|
|
3
|
+
export declare function toRgbBytes(source: RgbColorArray): Uint8Array;
|
|
4
|
+
export declare function colorBytesToNormalizedFloat32(source: Uint8Array): Float32Array;
|
|
5
|
+
export declare function setNormalizedRgbColorAttribute(source: Uint8Array): BufferAttribute;
|
|
6
|
+
export declare function readColorAttributeAsBytes(attribute: BufferAttribute): Uint8Array;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const GEO_LOADER_FRAME_BUDGET_MS = 16.7;
|
|
2
|
+
export declare const GEO_LOADER_RENDER_RESERVE_MS = 6;
|
|
3
|
+
export declare const GEO_LOADER_HIGH_WATERMARK_BYTES: number;
|
|
4
|
+
export declare const GEO_LOADER_LOW_WATERMARK_BYTES: number;
|
|
5
|
+
export declare const GEO_LOADER_INITIAL_GEOMETRY_CREDITS = 2;
|
|
6
|
+
export declare const GEO_LOADER_INITIAL_TEXT_CREDITS = 1;
|
|
7
|
+
export declare const LINE_STRESS_ENTER_VERTS = 300000;
|
|
8
|
+
export declare const LINE_STRESS_EXIT_VERTS = 220000;
|
|
9
|
+
export declare const LINE_THICK_LW_PX = 2;
|
|
10
|
+
export declare const PROMOTED_INSERT_FAST_VISIBILITY_ENABLED = true;
|
|
11
|
+
export declare const PROMOTED_INSERT_MIN_REFCOUNT = 1;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type DisplayRgbResolver = (rgb: readonly [number, number, number]) => readonly [number, number, number];
|
|
2
|
+
export interface DisplayColorBuildStats {
|
|
3
|
+
readonly vertexCount: number;
|
|
4
|
+
readonly runCount: number;
|
|
5
|
+
readonly uniqueColorCount: number;
|
|
6
|
+
readonly cacheHitCount: number;
|
|
7
|
+
readonly repeatedRunVertexCount: number;
|
|
8
|
+
}
|
|
9
|
+
export interface DisplayColorBuildResult {
|
|
10
|
+
readonly color: Uint8Array;
|
|
11
|
+
readonly stats: DisplayColorBuildStats;
|
|
12
|
+
}
|
|
13
|
+
export interface DisplayColorFloatBuildResult {
|
|
14
|
+
readonly color: Float32Array;
|
|
15
|
+
readonly stats: DisplayColorBuildStats;
|
|
16
|
+
}
|
|
17
|
+
export interface SourceColorRun {
|
|
18
|
+
readonly startVertex: number;
|
|
19
|
+
readonly vertexCount: number;
|
|
20
|
+
readonly color: readonly [number, number, number];
|
|
21
|
+
}
|
|
22
|
+
export declare function hasCompleteSourceColorRuns(vertexCount: number, runs: readonly SourceColorRun[]): boolean;
|
|
23
|
+
export declare function buildDisplayColorBytesFromRuns(sourceColor: Uint8Array, resolveRgb: DisplayRgbResolver): DisplayColorBuildResult;
|
|
24
|
+
export declare function buildDisplayColorBytesFromSourceRuns(vertexCount: number, runs: readonly SourceColorRun[], resolveRgb: DisplayRgbResolver): DisplayColorBuildResult;
|
|
25
|
+
export declare function buildDisplayColorFloatsFromSourceRuns(vertexCount: number, runs: readonly SourceColorRun[], resolveRgb: DisplayRgbResolver): DisplayColorFloatBuildResult;
|
|
26
|
+
export declare function writeDisplayColorBytesFromSourceRuns(target: Uint8Array, vertexCount: number, runs: readonly SourceColorRun[], resolveRgb: DisplayRgbResolver): DisplayColorBuildStats;
|
|
27
|
+
export declare function writeDisplayColorFloatsFromSourceRuns(target: Float32Array, vertexCount: number, runs: readonly SourceColorRun[], resolveRgb: DisplayRgbResolver): DisplayColorBuildStats;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options accepted by Troika's global text builder configuration.
|
|
3
|
+
*
|
|
4
|
+
* This is intentionally a thin public surface over Troika. The configuration
|
|
5
|
+
* remains global to the module instance and must be supplied before the first
|
|
6
|
+
* font request. No defaults are applied here so an omitted configuration keeps
|
|
7
|
+
* Troika's original built-in behavior unchanged.
|
|
8
|
+
*/
|
|
9
|
+
export interface CadTextBuilderOptions {
|
|
10
|
+
readonly defaultFontURL?: string;
|
|
11
|
+
readonly unicodeFontsURL?: string;
|
|
12
|
+
readonly sdfGlyphSize?: number;
|
|
13
|
+
readonly sdfMargin?: number;
|
|
14
|
+
readonly sdfExponent?: number;
|
|
15
|
+
readonly textureWidth?: number;
|
|
16
|
+
readonly useWorker?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Configures the Troika text builder used by cad-loader.
|
|
20
|
+
*
|
|
21
|
+
* This function deliberately does not add its own lifecycle, retry, fallback,
|
|
22
|
+
* or per-viewer state. Troika remains responsible for its existing
|
|
23
|
+
* module-level, one-time configuration semantics.
|
|
24
|
+
*/
|
|
25
|
+
export declare function configureCadTextBuilder(options: CadTextBuilderOptions): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ResolvedTextFont {
|
|
2
|
+
readonly text: string;
|
|
3
|
+
readonly fontUrl?: string;
|
|
4
|
+
readonly kind?: string;
|
|
5
|
+
readonly replacedUnsupported: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type ResolveTextFont = (text: string) => ResolvedTextFont;
|
|
8
|
+
export declare function normalizeCadTextForRendering(text: string): {
|
|
9
|
+
text: string;
|
|
10
|
+
replacedUnsupported: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function defaultResolveTextFont(text: string): ResolvedTextFont;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compatibility facade while the renderer-neutral contracts live in
|
|
3
|
+
* `@nebula-spatial/cad-loader/core`.
|
|
4
|
+
*/
|
|
5
|
+
export type * from '../core';
|
|
6
|
+
import type { ViewportRect } from '../core';
|
|
7
|
+
/** Browser source contract owned by the loader runtime, not its core parser. */
|
|
8
|
+
export type GeoLoadSource = {
|
|
9
|
+
kind: 'buffer';
|
|
10
|
+
buffer: ArrayBuffer;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'packFile';
|
|
13
|
+
file: File;
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'url';
|
|
16
|
+
url: string;
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
};
|
|
19
|
+
/** Three viewer compatibility types retained in cad-loader during the package transition. */
|
|
20
|
+
export interface LayerVertexChunk {
|
|
21
|
+
posArray: Float32Array;
|
|
22
|
+
start: number;
|
|
23
|
+
count: number;
|
|
24
|
+
bbox: ViewportRect;
|
|
25
|
+
}
|
|
26
|
+
export interface LayerVertexStat {
|
|
27
|
+
chunks: LayerVertexChunk[];
|
|
28
|
+
}
|
|
29
|
+
export type LineRenderMode = 'width' | 'full' | 'stress';
|
|
30
|
+
export interface SplitBlockLayerDetail {
|
|
31
|
+
variantId: number;
|
|
32
|
+
blockName: string;
|
|
33
|
+
layerCount: number;
|
|
34
|
+
instanceCount: number;
|
|
35
|
+
layers: string[];
|
|
36
|
+
}
|
|
37
|
+
export interface RenderDebugBreakdownEntry {
|
|
38
|
+
kind: 'line' | 'fill' | 'dot' | 'text' | 'insertPresenter' | 'other';
|
|
39
|
+
label: string;
|
|
40
|
+
renderables: number;
|
|
41
|
+
submittedVertexRefs: number;
|
|
42
|
+
}
|
|
43
|
+
export interface SceneStats {
|
|
44
|
+
fpsCurrent: number;
|
|
45
|
+
drawCalls: number;
|
|
46
|
+
renderableCount?: number;
|
|
47
|
+
viewportVertexCount: number;
|
|
48
|
+
submittedVertexRefs: number;
|
|
49
|
+
lineRenderMode: LineRenderMode;
|
|
50
|
+
visibleLayerCount: number;
|
|
51
|
+
totalLayerCount: number;
|
|
52
|
+
renderDebugBreakdown?: RenderDebugBreakdownEntry[];
|
|
53
|
+
blockVariantCount?: number;
|
|
54
|
+
blockInstanceCount?: number;
|
|
55
|
+
splitBlockLayerGroupCount?: number;
|
|
56
|
+
splitBlockLayerDetails?: SplitBlockLayerDetail[];
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../core';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../core';
|