vim-web 0.6.0-dev.9 → 1.0.0-alpha.1
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/style.css +3 -0
- package/dist/vim-web.d.ts +106 -108
- package/dist/vim-web.iife.js +21245 -9128
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +21244 -9127
- package/dist/vim-web.js.map +1 -1
- package/package.json +4 -3
package/dist/style.css
CHANGED
package/dist/vim-web.d.ts
CHANGED
|
@@ -89,21 +89,15 @@ type RecursivePartial<T> = {
|
|
|
89
89
|
@module viw-webgl-viewer
|
|
90
90
|
*/
|
|
91
91
|
|
|
92
|
+
/**
|
|
93
|
+
* How selected elements are filled (beyond the outline).
|
|
94
|
+
* - 'none': Outline only, no fill.
|
|
95
|
+
* - 'default': Tint selected meshes in the main render pass (zero cost).
|
|
96
|
+
* - 'xray': Tint + render selected on top of everything (1 extra pass).
|
|
97
|
+
* - 'seethrough': Tint + render a semi-transparent ghost where behind geometry (1 extra pass).
|
|
98
|
+
*/
|
|
99
|
+
type SelectionFillMode = 'none' | 'default' | 'xray' | 'seethrough';
|
|
92
100
|
type MaterialSettings = {
|
|
93
|
-
/**
|
|
94
|
-
* Use fast simple materials instead of standard Lambert materials
|
|
95
|
-
* - Enables: Significantly faster rendering (no Lambert lighting calculations)
|
|
96
|
-
* - Trade-off: Simpler pseudo-lighting using screen-space derivatives
|
|
97
|
-
* - Useful for: Performance-critical scenarios, large models, lower-end hardware
|
|
98
|
-
* Default: false
|
|
99
|
-
*/
|
|
100
|
-
useFastMaterials: boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Default color of standard material
|
|
103
|
-
*/
|
|
104
|
-
standard: {
|
|
105
|
-
color: THREE.Color;
|
|
106
|
-
};
|
|
107
101
|
/**
|
|
108
102
|
* Ghost material options
|
|
109
103
|
*/
|
|
@@ -120,45 +114,58 @@ type MaterialSettings = {
|
|
|
120
114
|
opacity: number;
|
|
121
115
|
};
|
|
122
116
|
/**
|
|
123
|
-
*
|
|
117
|
+
* Selection outline options
|
|
124
118
|
*/
|
|
125
|
-
|
|
119
|
+
outline: {
|
|
120
|
+
/**
|
|
121
|
+
* Selection outline opacity (0 = invisible, 1 = fully opaque).
|
|
122
|
+
* Default: 1
|
|
123
|
+
*/
|
|
124
|
+
opacity: number;
|
|
126
125
|
/**
|
|
127
|
-
*
|
|
128
|
-
* Default: 0
|
|
126
|
+
* Selection outline color.
|
|
127
|
+
* Default: rgb(0, 255, 255)
|
|
129
128
|
*/
|
|
130
|
-
|
|
129
|
+
color: THREE.Color;
|
|
131
130
|
/**
|
|
132
|
-
*
|
|
131
|
+
* Scale factor for outline render target resolution (0-1).
|
|
132
|
+
* Lower = faster, higher = sharper outlines.
|
|
133
133
|
* Default: 0.75
|
|
134
134
|
*/
|
|
135
|
-
|
|
135
|
+
scale: number;
|
|
136
136
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
137
|
+
* Outline thickness in pixels (of the outline render target).
|
|
138
|
+
* Higher values sample more pixels per fragment (4 fetches per level).
|
|
139
|
+
* Range: 1-5. Default: 2
|
|
139
140
|
*/
|
|
140
|
-
|
|
141
|
+
thickness: number;
|
|
141
142
|
};
|
|
142
143
|
/**
|
|
143
|
-
* Selection
|
|
144
|
+
* Selection fill options (beyond outlines).
|
|
144
145
|
*/
|
|
145
|
-
|
|
146
|
+
selection: {
|
|
146
147
|
/**
|
|
147
|
-
*
|
|
148
|
-
* Default:
|
|
148
|
+
* How selected elements are filled.
|
|
149
|
+
* Default: 'none'
|
|
149
150
|
*/
|
|
150
|
-
|
|
151
|
+
fillMode: SelectionFillMode;
|
|
151
152
|
/**
|
|
152
|
-
*
|
|
153
|
-
* Default: rgb(0,
|
|
153
|
+
* Tint color applied to selected elements.
|
|
154
|
+
* Default: rgb(0, 100, 255) — blue
|
|
154
155
|
*/
|
|
155
156
|
color: THREE.Color;
|
|
156
157
|
/**
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
* Default: 0.75
|
|
158
|
+
* Tint blend strength (0 = no tint, 1 = solid color).
|
|
159
|
+
* Default: 0.3
|
|
160
160
|
*/
|
|
161
|
-
|
|
161
|
+
opacity: number;
|
|
162
|
+
/**
|
|
163
|
+
* Opacity of the overlay pass in 'xray' and 'seethrough' modes.
|
|
164
|
+
* In xray: applies to all selected geometry rendered on top.
|
|
165
|
+
* In seethrough: applies to selected geometry rendered behind other objects.
|
|
166
|
+
* Default: 0.25
|
|
167
|
+
*/
|
|
168
|
+
overlayOpacity: number;
|
|
162
169
|
};
|
|
163
170
|
};
|
|
164
171
|
/**
|
|
@@ -169,7 +176,6 @@ type MaterialSettings = {
|
|
|
169
176
|
* @example
|
|
170
177
|
* const viewer = Core.Webgl.createViewer({
|
|
171
178
|
* camera: { orthographic: true, fov: 50 },
|
|
172
|
-
* materials: { useFastMaterials: true }
|
|
173
179
|
* })
|
|
174
180
|
*/
|
|
175
181
|
type ViewerSettings = {
|
|
@@ -310,27 +316,6 @@ type ViewerSettings = {
|
|
|
310
316
|
*/
|
|
311
317
|
color: THREE.Color;
|
|
312
318
|
};
|
|
313
|
-
/**
|
|
314
|
-
* Skybox options
|
|
315
|
-
*/
|
|
316
|
-
skybox: {
|
|
317
|
-
/**
|
|
318
|
-
* Enables/Disables skybox.
|
|
319
|
-
*/
|
|
320
|
-
enable: boolean;
|
|
321
|
-
/**
|
|
322
|
-
* Color for the lower part of the skybox.
|
|
323
|
-
*/
|
|
324
|
-
groundColor: THREE.Color;
|
|
325
|
-
/**
|
|
326
|
-
* Color for the upper part of the skybox.
|
|
327
|
-
*/
|
|
328
|
-
skyColor: THREE.Color;
|
|
329
|
-
/**
|
|
330
|
-
* Controls the gradient transition between the sky and the ground.
|
|
331
|
-
*/
|
|
332
|
-
sharpness: number;
|
|
333
|
-
};
|
|
334
319
|
/**
|
|
335
320
|
* Material options
|
|
336
321
|
*/
|
|
@@ -339,39 +324,6 @@ type ViewerSettings = {
|
|
|
339
324
|
* Axes gizmo options
|
|
340
325
|
*/
|
|
341
326
|
axes: Partial<AxesSettings>;
|
|
342
|
-
/**
|
|
343
|
-
* Skylight (hemisphere light) options
|
|
344
|
-
*/
|
|
345
|
-
skylight: {
|
|
346
|
-
/**
|
|
347
|
-
* Skylight sky Color.
|
|
348
|
-
* Default: THREE.Color(153, 204, 255)
|
|
349
|
-
*/
|
|
350
|
-
skyColor: THREE.Color;
|
|
351
|
-
/**
|
|
352
|
-
* Skylight ground color.
|
|
353
|
-
* Default: THREE.Color(242, 213, 181)
|
|
354
|
-
*/
|
|
355
|
-
groundColor: THREE.Color;
|
|
356
|
-
/**
|
|
357
|
-
* Skylight intensity.
|
|
358
|
-
* Default: 0.8
|
|
359
|
-
*/
|
|
360
|
-
intensity: number;
|
|
361
|
-
};
|
|
362
|
-
/**
|
|
363
|
-
* Sunlight (directional light) options
|
|
364
|
-
* Two Blue-Green lights at odd angles. See defaultViewerSettings.
|
|
365
|
-
*/
|
|
366
|
-
sunlights: {
|
|
367
|
-
followCamera: boolean;
|
|
368
|
-
/** Light position. */
|
|
369
|
-
position: THREE.Vector3;
|
|
370
|
-
/** Light color. */
|
|
371
|
-
color: THREE.Color;
|
|
372
|
-
/** Light intensity. */
|
|
373
|
-
intensity: number;
|
|
374
|
-
}[];
|
|
375
327
|
rendering: {
|
|
376
328
|
/**
|
|
377
329
|
* When true, only renders when changes are detected. When false, renders every frame.
|
|
@@ -446,24 +398,26 @@ interface IMaterials {
|
|
|
446
398
|
readonly modelTransparentMaterial: THREE.Material;
|
|
447
399
|
/** The ghost material used to render hidden/ghosted elements. */
|
|
448
400
|
readonly ghostMaterial: THREE.Material;
|
|
449
|
-
/** Base color tint applied to opaque and transparent model materials. */
|
|
450
|
-
modelColor: THREE.Color;
|
|
451
401
|
/** Opacity of the ghost material (0 = invisible, 1 = fully opaque). */
|
|
452
402
|
ghostOpacity: number;
|
|
453
403
|
/** Color of the ghost material. */
|
|
454
404
|
ghostColor: THREE.Color;
|
|
455
|
-
/**
|
|
456
|
-
|
|
405
|
+
/** Opacity of the selection outline (0 = invisible, 1 = fully opaque). */
|
|
406
|
+
outlineOpacity: number;
|
|
407
|
+
/** Thickness of the selection outline in pixels (of the outline render target). Range: 1-5. */
|
|
408
|
+
outlineThickness: number;
|
|
457
409
|
/** Color of the selection outline post-process effect. */
|
|
458
410
|
outlineColor: THREE.Color;
|
|
459
|
-
/** Width of the stroke rendered where the section box intersects the model. */
|
|
460
|
-
sectionStrokeWidth: number;
|
|
461
|
-
/** Gradient falloff of the section box intersection stroke. */
|
|
462
|
-
sectionStrokeFalloff: number;
|
|
463
|
-
/** Color of the section box intersection stroke. */
|
|
464
|
-
sectionStrokeColor: THREE.Color;
|
|
465
411
|
/** Clipping planes applied to all materials. Set to undefined to disable clipping. */
|
|
466
412
|
clippingPlanes: THREE.Plane[] | undefined;
|
|
413
|
+
/** Selection fill mode: 'none' | 'default' | 'xray' | 'seethrough'. */
|
|
414
|
+
selectionFillMode: SelectionFillMode;
|
|
415
|
+
/** Color used to tint selected elements. */
|
|
416
|
+
selectionColor: THREE.Color;
|
|
417
|
+
/** Blend strength for selection tint (0 = off, 1 = solid). */
|
|
418
|
+
selectionOpacity: number;
|
|
419
|
+
/** Opacity of the overlay pass in 'xray' and 'seethrough' modes. */
|
|
420
|
+
selectionOverlayOpacity: number;
|
|
467
421
|
/** Applies a full set of material settings from the viewer configuration. */
|
|
468
422
|
applySettings(settings: MaterialSettings): void;
|
|
469
423
|
}
|
|
@@ -1020,19 +974,22 @@ interface IWebglCamera {
|
|
|
1020
974
|
* The default forward direction in Z-up space (X = right, Y = forward, Z = up).
|
|
1021
975
|
*/
|
|
1022
976
|
defaultForward: THREE.Vector3;
|
|
977
|
+
/**
|
|
978
|
+
* When true, lockMovement and lockRotation are bypassed.
|
|
979
|
+
* Set temporarily to position the camera while ignoring user-configured constraints.
|
|
980
|
+
*/
|
|
981
|
+
ignoreConstraints: boolean;
|
|
1023
982
|
/**
|
|
1024
983
|
* Interface for instantaneously moving the camera.
|
|
1025
|
-
* @param {boolean} [force=false] - Set to true to ignore locked axis and rotation.
|
|
1026
984
|
* @returns {ICameraMovement} The camera movement api.
|
|
1027
985
|
*/
|
|
1028
|
-
snap(
|
|
986
|
+
snap(): ICameraMovement;
|
|
1029
987
|
/**
|
|
1030
988
|
* Interface for smoothly moving the camera over time.
|
|
1031
989
|
* @param {number} [duration=1] - The duration of the camera movement animation.
|
|
1032
|
-
* @param {boolean} [force=false] - Set to true to ignore locked axis and rotation.
|
|
1033
990
|
* @returns {ICameraMovement} The camera movement api.
|
|
1034
991
|
*/
|
|
1035
|
-
lerp(duration: number
|
|
992
|
+
lerp(duration: number): ICameraMovement;
|
|
1036
993
|
/**
|
|
1037
994
|
* Calculates the frustum size at a given point in the scene.
|
|
1038
995
|
* @param {THREE.Vector3} point - The point in the scene to calculate the frustum size at.
|
|
@@ -1623,6 +1580,10 @@ interface IWebglRenderer {
|
|
|
1623
1580
|
getBoundingBox(target?: THREE.Box3): THREE.Box3 | undefined;
|
|
1624
1581
|
/** When true (default), only renders when dirty (`requestRender()` was called). When false, renders every frame. */
|
|
1625
1582
|
autoRender: boolean;
|
|
1583
|
+
/** Whether selection outlines are enabled. */
|
|
1584
|
+
outlineEnabled: boolean;
|
|
1585
|
+
/** Selection fill mode for the rendering pipeline. */
|
|
1586
|
+
selectionFillMode: SelectionFillMode;
|
|
1626
1587
|
}
|
|
1627
1588
|
|
|
1628
1589
|
/**
|
|
@@ -1651,7 +1612,6 @@ interface IWebglRenderer {
|
|
|
1651
1612
|
*/
|
|
1652
1613
|
interface IWebglViewer {
|
|
1653
1614
|
readonly type: 'webgl';
|
|
1654
|
-
readonly settings: ViewerSettings;
|
|
1655
1615
|
readonly renderer: IWebglRenderer;
|
|
1656
1616
|
readonly viewport: IWebglViewport;
|
|
1657
1617
|
readonly selection: IWebglSelection;
|
|
@@ -1690,7 +1650,7 @@ declare function createCoreWebglViewer(settings?: PartialViewerSettings): IWebgl
|
|
|
1690
1650
|
|
|
1691
1651
|
declare namespace Core_Webgl {
|
|
1692
1652
|
export { MaterialSet, createCoreWebglViewer as createViewer, isElement3D };
|
|
1693
|
-
export type { AxesSettings, ICameraMovement, IElement3D, IGizmoAxes, IGizmoMarkers, IGizmoOrbit, IGizmos, IMarker, IMaterials, IMeasure, IRenderingSection, IScene, ISelectable, ISubset, IWebglCamera, IWebglLoadRequest, IWebglRaycastResult, IWebglRaycaster, IWebglRenderer, IWebglSectionBox, IWebglSelection, IWebglViewport, IWebglVim, MaterialSettings, MeasureStage, PartialViewerSettings, RequestSource, SubsetFilter, TransparencyMode, IWebglViewer as Viewer, ViewerSettings, VimPartialSettings, VimSettings };
|
|
1653
|
+
export type { AxesSettings, ICameraMovement, IElement3D, IGizmoAxes, IGizmoMarkers, IGizmoOrbit, IGizmos, IMarker, IMaterials, IMeasure, IRenderingSection, IScene, ISelectable, ISubset, IWebglCamera, IWebglLoadRequest, IWebglRaycastResult, IWebglRaycaster, IWebglRenderer, IWebglSectionBox, IWebglSelection, IWebglViewport, IWebglVim, MaterialSettings, MeasureStage, PartialViewerSettings, RequestSource, SelectionFillMode, SubsetFilter, TransparencyMode, IWebglViewer as Viewer, ViewerSettings, VimPartialSettings, VimSettings };
|
|
1694
1654
|
}
|
|
1695
1655
|
|
|
1696
1656
|
/**
|
|
@@ -2385,6 +2345,16 @@ interface IsolationApi {
|
|
|
2385
2345
|
ghostOpacity: StateRef<number>;
|
|
2386
2346
|
/** Whether transparent materials are rendered (observable). */
|
|
2387
2347
|
transparency: StateRef<boolean>;
|
|
2348
|
+
/** Whether selection outlines are enabled (observable). */
|
|
2349
|
+
outlineEnabled: StateRef<boolean>;
|
|
2350
|
+
/** Outline quality: 'low' (0.5x) | 'medium' (1x) | 'high' (2x) render target scale. */
|
|
2351
|
+
outlineQuality: StateRef<string>;
|
|
2352
|
+
/** Outline thickness in screen pixels (1-5). */
|
|
2353
|
+
outlineThickness: StateRef<number>;
|
|
2354
|
+
/** Selection fill mode: 'none' | 'default' | 'xray' | 'seethrough' (observable). */
|
|
2355
|
+
selectionFillMode: StateRef<string>;
|
|
2356
|
+
/** Opacity of the overlay pass in 'xray' and 'seethrough' modes (0-1). */
|
|
2357
|
+
selectionOverlayOpacity: StateRef<number>;
|
|
2388
2358
|
/** Whether room elements are shown (observable). */
|
|
2389
2359
|
showRooms: StateRef<boolean>;
|
|
2390
2360
|
/** Hook called when auto-isolate triggers. Use `update()` to add middleware. */
|
|
@@ -2914,7 +2884,19 @@ interface GenericBoolEntry {
|
|
|
2914
2884
|
visible?: () => boolean;
|
|
2915
2885
|
state: StateRef<boolean>;
|
|
2916
2886
|
}
|
|
2917
|
-
|
|
2887
|
+
interface GenericSelectEntry {
|
|
2888
|
+
type: "select";
|
|
2889
|
+
id: string;
|
|
2890
|
+
label: string;
|
|
2891
|
+
enabled?: () => boolean;
|
|
2892
|
+
visible?: () => boolean;
|
|
2893
|
+
options: {
|
|
2894
|
+
label: string;
|
|
2895
|
+
value: string;
|
|
2896
|
+
}[];
|
|
2897
|
+
state: StateRef<string>;
|
|
2898
|
+
}
|
|
2899
|
+
type GenericEntryType = GenericTextEntry | GenericBoolEntry | GenericNumberEntry | GenericSelectEntry;
|
|
2918
2900
|
|
|
2919
2901
|
type GenericPanelApi = {
|
|
2920
2902
|
customize(fn: (entries: GenericEntryType[]) => GenericEntryType[]): void;
|
|
@@ -2928,7 +2910,7 @@ type GenericPanelApi = {
|
|
|
2928
2910
|
type AnySettings = WebglSettings | UltraSettings;
|
|
2929
2911
|
|
|
2930
2912
|
type SettingsCustomization<T extends AnySettings> = (items: SettingsItem<T>[]) => SettingsItem<T>[];
|
|
2931
|
-
type SettingsItem<T extends AnySettings> = SettingsSubtitle | SettingsToggle<T> | SettingsBox<T> | SettingsElement;
|
|
2913
|
+
type SettingsItem<T extends AnySettings> = SettingsSubtitle | SettingsToggle<T> | SettingsBox<T> | SettingsSelect<T> | SettingsElement;
|
|
2932
2914
|
type SettingsSubtitle = {
|
|
2933
2915
|
type: 'subtitle';
|
|
2934
2916
|
key: string;
|
|
@@ -2950,6 +2932,17 @@ type SettingsBox<T extends AnySettings> = {
|
|
|
2950
2932
|
getter: (settings: T) => number;
|
|
2951
2933
|
setter: (settings: T, b: number) => void;
|
|
2952
2934
|
};
|
|
2935
|
+
type SettingsSelect<T extends AnySettings> = {
|
|
2936
|
+
type: 'select';
|
|
2937
|
+
key: string;
|
|
2938
|
+
label: string;
|
|
2939
|
+
options: {
|
|
2940
|
+
label: string;
|
|
2941
|
+
value: string;
|
|
2942
|
+
}[];
|
|
2943
|
+
getter: (settings: T) => string;
|
|
2944
|
+
setter: (settings: T, value: string) => void;
|
|
2945
|
+
};
|
|
2953
2946
|
type SettingsElement = {
|
|
2954
2947
|
type: 'element';
|
|
2955
2948
|
key: string;
|
|
@@ -3342,6 +3335,11 @@ declare const IsolationPanel: {
|
|
|
3342
3335
|
showGhost: string;
|
|
3343
3336
|
ghostOpacity: string;
|
|
3344
3337
|
transparency: string;
|
|
3338
|
+
outlineEnabled: string;
|
|
3339
|
+
outlineQuality: string;
|
|
3340
|
+
outlineThickness: string;
|
|
3341
|
+
selectionFillMode: string;
|
|
3342
|
+
selectionOverlayOpacity: string;
|
|
3345
3343
|
};
|
|
3346
3344
|
};
|
|
3347
3345
|
|