@sequent-org/ifc-viewer 1.2.4-ci.41.0 → 1.2.4-ci.42.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/package.json +1 -1
- package/src/viewer/Viewer.js +41 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequent-org/ifc-viewer",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.2.4-ci.
|
|
4
|
+
"version": "1.2.4-ci.42.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "IFC 3D model viewer component for web applications - fully self-contained with local IFCLoader",
|
|
7
7
|
"main": "src/index.js",
|
package/src/viewer/Viewer.js
CHANGED
|
@@ -150,6 +150,8 @@ export class Viewer {
|
|
|
150
150
|
this._sectionOriginalMaterial = new WeakMap();
|
|
151
151
|
// +50% яркости при активном сечении (комнаты светлее)
|
|
152
152
|
this._sectionLightBoost = { mul: 1.5, snapshot: null };
|
|
153
|
+
// При активном сечении: AO выключаем (убирает "сетку"), а контраст возвращаем лёгкой цветокоррекцией
|
|
154
|
+
this._sectionPostBoost = { snapshot: null, brightness: 0.03, contrast: 0.15 };
|
|
153
155
|
|
|
154
156
|
// Snapshot начального состояния для Home
|
|
155
157
|
this._home = {
|
|
@@ -1983,6 +1985,45 @@ export class Viewer {
|
|
|
1983
1985
|
}
|
|
1984
1986
|
} catch (_) {}
|
|
1985
1987
|
|
|
1988
|
+
// 0.5) Пост-эффекты: AO OFF + лёгкий контраст (только при сечении)
|
|
1989
|
+
try {
|
|
1990
|
+
if (this._sectionClippingActive) {
|
|
1991
|
+
if (!this._sectionPostBoost.snapshot) {
|
|
1992
|
+
this._sectionPostBoost.snapshot = {
|
|
1993
|
+
ao: { ...this.visual.ao },
|
|
1994
|
+
color: { ...this.visual.color },
|
|
1995
|
+
};
|
|
1996
|
+
}
|
|
1997
|
+
// AO OFF
|
|
1998
|
+
this.setAOEnabled(false);
|
|
1999
|
+
// Color correction ON (без изменения hue/saturation)
|
|
2000
|
+
this.setColorCorrectionEnabled(true);
|
|
2001
|
+
this.setColorBrightness(this._sectionPostBoost.brightness);
|
|
2002
|
+
this.setColorContrast(this._sectionPostBoost.contrast);
|
|
2003
|
+
} else {
|
|
2004
|
+
const snap = this._sectionPostBoost.snapshot;
|
|
2005
|
+
if (snap) {
|
|
2006
|
+
// Restore AO
|
|
2007
|
+
this.setAOEnabled(!!snap.ao?.enabled);
|
|
2008
|
+
if (typeof snap.ao?.intensity === 'number') this.setAOIntensity(snap.ao.intensity);
|
|
2009
|
+
if (typeof snap.ao?.radius === 'number') this.setAORadius(snap.ao.radius);
|
|
2010
|
+
if (typeof snap.ao?.minDistance === 'number') this.visual.ao.minDistance = snap.ao.minDistance;
|
|
2011
|
+
if (typeof snap.ao?.maxDistance === 'number') this.visual.ao.maxDistance = snap.ao.maxDistance;
|
|
2012
|
+
if (this._ssaoPass) {
|
|
2013
|
+
this._ssaoPass.minDistance = this.visual.ao.minDistance;
|
|
2014
|
+
this._ssaoPass.maxDistance = this.visual.ao.maxDistance;
|
|
2015
|
+
}
|
|
2016
|
+
// Restore color correction
|
|
2017
|
+
this.setColorCorrectionEnabled(!!snap.color?.enabled);
|
|
2018
|
+
if (typeof snap.color?.hue === 'number') this.setColorHue(snap.color.hue);
|
|
2019
|
+
if (typeof snap.color?.saturation === 'number') this.setColorSaturation(snap.color.saturation);
|
|
2020
|
+
if (typeof snap.color?.brightness === 'number') this.setColorBrightness(snap.color.brightness);
|
|
2021
|
+
if (typeof snap.color?.contrast === 'number') this.setColorContrast(snap.color.contrast);
|
|
2022
|
+
}
|
|
2023
|
+
this._sectionPostBoost.snapshot = null;
|
|
2024
|
+
}
|
|
2025
|
+
} catch (_) {}
|
|
2026
|
+
|
|
1986
2027
|
// 1) self-shadowing (комнаты/стены)
|
|
1987
2028
|
if (this.activeModel) {
|
|
1988
2029
|
this.activeModel.traverse?.((node) => {
|