vim-web 0.6.0-dev.11 → 0.6.0-dev.12
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/vim-web.d.ts +0 -43
- package/dist/vim-web.iife.js +3 -88
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +3 -88
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
package/dist/vim-web.d.ts
CHANGED
|
@@ -90,20 +90,6 @@ type RecursivePartial<T> = {
|
|
|
90
90
|
*/
|
|
91
91
|
|
|
92
92
|
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
93
|
/**
|
|
108
94
|
* Ghost material options
|
|
109
95
|
*/
|
|
@@ -120,26 +106,6 @@ type MaterialSettings = {
|
|
|
120
106
|
opacity: number;
|
|
121
107
|
};
|
|
122
108
|
/**
|
|
123
|
-
* Section box intersection highlight options
|
|
124
|
-
*/
|
|
125
|
-
section: {
|
|
126
|
-
/**
|
|
127
|
-
* Intersection highlight stroke width.
|
|
128
|
-
* Default: 0.01
|
|
129
|
-
*/
|
|
130
|
-
strokeWidth: number;
|
|
131
|
-
/**
|
|
132
|
-
* Intersection highlight stroke falloff.
|
|
133
|
-
* Default: 0.75
|
|
134
|
-
*/
|
|
135
|
-
strokeFalloff: number;
|
|
136
|
-
/**
|
|
137
|
-
* Intersection highlight stroke color.
|
|
138
|
-
* Default: rgb(246, 246, 246)
|
|
139
|
-
*/
|
|
140
|
-
strokeColor: THREE.Color;
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
109
|
* Selection outline options
|
|
144
110
|
*/
|
|
145
111
|
outline: {
|
|
@@ -175,7 +141,6 @@ type MaterialSettings = {
|
|
|
175
141
|
* @example
|
|
176
142
|
* const viewer = Core.Webgl.createViewer({
|
|
177
143
|
* camera: { orthographic: true, fov: 50 },
|
|
178
|
-
* materials: { useFastMaterials: true }
|
|
179
144
|
* })
|
|
180
145
|
*/
|
|
181
146
|
type ViewerSettings = {
|
|
@@ -398,8 +363,6 @@ interface IMaterials {
|
|
|
398
363
|
readonly modelTransparentMaterial: THREE.Material;
|
|
399
364
|
/** The ghost material used to render hidden/ghosted elements. */
|
|
400
365
|
readonly ghostMaterial: THREE.Material;
|
|
401
|
-
/** Base color tint applied to opaque and transparent model materials. */
|
|
402
|
-
modelColor: THREE.Color;
|
|
403
366
|
/** Opacity of the ghost material (0 = invisible, 1 = fully opaque). */
|
|
404
367
|
ghostOpacity: number;
|
|
405
368
|
/** Color of the ghost material. */
|
|
@@ -410,12 +373,6 @@ interface IMaterials {
|
|
|
410
373
|
outlineThickness: number;
|
|
411
374
|
/** Color of the selection outline post-process effect. */
|
|
412
375
|
outlineColor: THREE.Color;
|
|
413
|
-
/** Width of the stroke rendered where the section box intersects the model. */
|
|
414
|
-
sectionStrokeWidth: number;
|
|
415
|
-
/** Gradient falloff of the section box intersection stroke. */
|
|
416
|
-
sectionStrokeFalloff: number;
|
|
417
|
-
/** Color of the section box intersection stroke. */
|
|
418
|
-
sectionStrokeColor: THREE.Color;
|
|
419
376
|
/** Clipping planes applied to all materials. Set to undefined to disable clipping. */
|
|
420
377
|
clippingPlanes: THREE.Plane[] | undefined;
|
|
421
378
|
/** Applies a full set of material settings from the viewer configuration. */
|
package/dist/vim-web.iife.js
CHANGED
|
@@ -47544,25 +47544,6 @@ void main() {
|
|
|
47544
47544
|
};
|
|
47545
47545
|
__publicField(_CameraMovementSnap, "_ZERO", new Vector3());
|
|
47546
47546
|
let CameraMovementSnap = _CameraMovementSnap;
|
|
47547
|
-
function createOpaque() {
|
|
47548
|
-
return new StandardMaterial(createBasicOpaque());
|
|
47549
|
-
}
|
|
47550
|
-
function createTransparent() {
|
|
47551
|
-
return new StandardMaterial(createBasicTransparent());
|
|
47552
|
-
}
|
|
47553
|
-
function createBasicOpaque() {
|
|
47554
|
-
return new MeshLambertMaterial({
|
|
47555
|
-
color: 13421772,
|
|
47556
|
-
flatShading: true,
|
|
47557
|
-
side: DoubleSide
|
|
47558
|
-
});
|
|
47559
|
-
}
|
|
47560
|
-
function createBasicTransparent() {
|
|
47561
|
-
const mat = createBasicOpaque();
|
|
47562
|
-
mat.transparent = true;
|
|
47563
|
-
mat.opacity = 0.25;
|
|
47564
|
-
return mat;
|
|
47565
|
-
}
|
|
47566
47547
|
class StandardMaterial {
|
|
47567
47548
|
constructor(material) {
|
|
47568
47549
|
__publicField(this, "three");
|
|
@@ -54571,9 +54552,7 @@ void main() {
|
|
|
54571
54552
|
mesh.visible = true;
|
|
54572
54553
|
}
|
|
54573
54554
|
const _Materials = class _Materials {
|
|
54574
|
-
constructor(
|
|
54575
|
-
__publicField(this, "_opaque");
|
|
54576
|
-
__publicField(this, "_transparent");
|
|
54555
|
+
constructor(modelOpaque, modelTransparent, ghost2, mask, outline, merge) {
|
|
54577
54556
|
__publicField(this, "_modelOpaque");
|
|
54578
54557
|
__publicField(this, "_modelTransparent");
|
|
54579
54558
|
__publicField(this, "_ghost");
|
|
@@ -54582,14 +54561,9 @@ void main() {
|
|
|
54582
54561
|
__publicField(this, "_outline");
|
|
54583
54562
|
__publicField(this, "_merge");
|
|
54584
54563
|
__publicField(this, "_clippingPlanes");
|
|
54585
|
-
__publicField(this, "_sectionStrokeWidth", 0.01);
|
|
54586
|
-
__publicField(this, "_sectionStrokeFalloff", 0.75);
|
|
54587
|
-
__publicField(this, "_sectionStrokeColor", new Color(16185078));
|
|
54588
54564
|
__publicField(this, "_onUpdate", new distExports$2.SignalDispatcher());
|
|
54589
54565
|
// Shared color palette texture for all scene materials
|
|
54590
54566
|
__publicField(this, "_colorPaletteTexture");
|
|
54591
|
-
this._opaque = opaque ?? createOpaque();
|
|
54592
|
-
this._transparent = transparent ?? createTransparent();
|
|
54593
54567
|
const onUpdate = () => this._onUpdate.dispatch();
|
|
54594
54568
|
this._modelOpaque = modelOpaque ?? createModelOpaque(onUpdate);
|
|
54595
54569
|
this._modelTransparent = modelTransparent ?? createModelTransparent(onUpdate);
|
|
@@ -54641,12 +54615,8 @@ void main() {
|
|
|
54641
54615
|
* Updates material settings based on the provided configuration.
|
|
54642
54616
|
*/
|
|
54643
54617
|
applySettings(settings2) {
|
|
54644
|
-
this.modelColor = settings2.standard.color;
|
|
54645
54618
|
this._ghost.opacity = settings2.ghost.opacity;
|
|
54646
54619
|
this._ghost.color = settings2.ghost.color;
|
|
54647
|
-
this.sectionStrokeWidth = settings2.section.strokeWidth;
|
|
54648
|
-
this.sectionStrokeFalloff = settings2.section.strokeFalloff;
|
|
54649
|
-
this.sectionStrokeColor = settings2.section.strokeColor;
|
|
54650
54620
|
this.outlineOpacity = settings2.outline.opacity;
|
|
54651
54621
|
this.outlineColor = settings2.outline.color;
|
|
54652
54622
|
this.outlineThickness = settings2.outline.thickness;
|
|
@@ -54655,15 +54625,6 @@ void main() {
|
|
|
54655
54625
|
get onUpdate() {
|
|
54656
54626
|
return this._onUpdate.asEvent();
|
|
54657
54627
|
}
|
|
54658
|
-
/** Base color tint applied to opaque and transparent model materials. */
|
|
54659
|
-
get modelColor() {
|
|
54660
|
-
return this._opaque.color;
|
|
54661
|
-
}
|
|
54662
|
-
set modelColor(color) {
|
|
54663
|
-
this._opaque.color = color;
|
|
54664
|
-
this._transparent.color = color;
|
|
54665
|
-
this._onUpdate.dispatch();
|
|
54666
|
-
}
|
|
54667
54628
|
/** Opacity of the selection outline (0 = invisible, 1 = fully opaque). */
|
|
54668
54629
|
get outlineOpacity() {
|
|
54669
54630
|
return this._merge.opacity;
|
|
@@ -54693,45 +54654,10 @@ void main() {
|
|
|
54693
54654
|
this._clippingPlanes = value;
|
|
54694
54655
|
this._modelOpaque.clippingPlanes = value ?? null;
|
|
54695
54656
|
this._modelTransparent.clippingPlanes = value ?? null;
|
|
54696
|
-
this._opaque.clippingPlanes = value ?? null;
|
|
54697
|
-
this._transparent.clippingPlanes = value ?? null;
|
|
54698
54657
|
this._ghost.clippingPlanes = value ?? null;
|
|
54699
54658
|
this._mask.clippingPlanes = value ?? null;
|
|
54700
54659
|
this._onUpdate.dispatch();
|
|
54701
54660
|
}
|
|
54702
|
-
/** Width of the stroke rendered where the section box intersects the model. */
|
|
54703
|
-
get sectionStrokeWidth() {
|
|
54704
|
-
return this._sectionStrokeWidth;
|
|
54705
|
-
}
|
|
54706
|
-
set sectionStrokeWidth(value) {
|
|
54707
|
-
if (this._sectionStrokeWidth === value) return;
|
|
54708
|
-
this._sectionStrokeWidth = value;
|
|
54709
|
-
this._opaque.sectionStrokeWidth = value;
|
|
54710
|
-
this._transparent.sectionStrokeWidth = value;
|
|
54711
|
-
this._onUpdate.dispatch();
|
|
54712
|
-
}
|
|
54713
|
-
/** Gradient falloff of the section box intersection stroke. */
|
|
54714
|
-
get sectionStrokeFalloff() {
|
|
54715
|
-
return this._sectionStrokeFalloff;
|
|
54716
|
-
}
|
|
54717
|
-
set sectionStrokeFalloff(value) {
|
|
54718
|
-
if (this._sectionStrokeFalloff === value) return;
|
|
54719
|
-
this._sectionStrokeFalloff = value;
|
|
54720
|
-
this._opaque.sectionStrokeFalloff = value;
|
|
54721
|
-
this._transparent.sectionStrokeFalloff = value;
|
|
54722
|
-
this._onUpdate.dispatch();
|
|
54723
|
-
}
|
|
54724
|
-
/** Color of the section box intersection stroke. */
|
|
54725
|
-
get sectionStrokeColor() {
|
|
54726
|
-
return this._sectionStrokeColor;
|
|
54727
|
-
}
|
|
54728
|
-
set sectionStrokeColor(value) {
|
|
54729
|
-
if (this._sectionStrokeColor === value) return;
|
|
54730
|
-
this._sectionStrokeColor = value;
|
|
54731
|
-
this._opaque.sectionStrokeColor = value;
|
|
54732
|
-
this._transparent.sectionStrokeColor = value;
|
|
54733
|
-
this._onUpdate.dispatch();
|
|
54734
|
-
}
|
|
54735
54661
|
/**
|
|
54736
54662
|
* Creates the fixed quantized color palette texture if it doesn't exist.
|
|
54737
54663
|
* The palette is deterministic (25³ = 15,625 quantized colors in 128×128 texture)
|
|
@@ -54741,6 +54667,8 @@ void main() {
|
|
|
54741
54667
|
if (this._colorPaletteTexture) return;
|
|
54742
54668
|
const textureData = buildPaletteTexture();
|
|
54743
54669
|
this._colorPaletteTexture = new DataTexture(
|
|
54670
|
+
// Cast: TS 5.7 narrows Uint8Array.buffer to ArrayBufferLike (includes SharedArrayBuffer),
|
|
54671
|
+
// but Three.js expects BufferSource (ArrayBuffer only). Safe — Uint8Array always backs ArrayBuffer.
|
|
54744
54672
|
textureData,
|
|
54745
54673
|
128,
|
|
54746
54674
|
128,
|
|
@@ -54750,8 +54678,6 @@ void main() {
|
|
|
54750
54678
|
this._colorPaletteTexture.needsUpdate = true;
|
|
54751
54679
|
this._colorPaletteTexture.minFilter = NearestFilter;
|
|
54752
54680
|
this._colorPaletteTexture.magFilter = NearestFilter;
|
|
54753
|
-
this._opaque.setColorPaletteTexture(this._colorPaletteTexture);
|
|
54754
|
-
this._transparent.setColorPaletteTexture(this._colorPaletteTexture);
|
|
54755
54681
|
this._modelOpaque.setColorPaletteTexture(this._colorPaletteTexture);
|
|
54756
54682
|
this._modelTransparent.setColorPaletteTexture(this._colorPaletteTexture);
|
|
54757
54683
|
this._onUpdate.dispatch();
|
|
@@ -54762,8 +54688,6 @@ void main() {
|
|
|
54762
54688
|
this._colorPaletteTexture.dispose();
|
|
54763
54689
|
this._colorPaletteTexture = void 0;
|
|
54764
54690
|
}
|
|
54765
|
-
this._opaque.dispose();
|
|
54766
|
-
this._transparent.dispose();
|
|
54767
54691
|
this._modelOpaque.dispose();
|
|
54768
54692
|
this._modelTransparent.dispose();
|
|
54769
54693
|
this._ghost.dispose();
|
|
@@ -55497,19 +55421,10 @@ void main() {
|
|
|
55497
55421
|
},
|
|
55498
55422
|
background: { color: new Color(16777215) },
|
|
55499
55423
|
materials: {
|
|
55500
|
-
useFastMaterials: false,
|
|
55501
|
-
standard: {
|
|
55502
|
-
color: new Color(13421772)
|
|
55503
|
-
},
|
|
55504
55424
|
ghost: {
|
|
55505
55425
|
color: new Color(921102),
|
|
55506
55426
|
opacity: 7 / 255
|
|
55507
55427
|
},
|
|
55508
|
-
section: {
|
|
55509
|
-
strokeWidth: 0.01,
|
|
55510
|
-
strokeFalloff: 0.75,
|
|
55511
|
-
strokeColor: new Color(16185078)
|
|
55512
|
-
},
|
|
55513
55428
|
outline: {
|
|
55514
55429
|
opacity: 0.85,
|
|
55515
55430
|
color: new Color(65535),
|