feat(3d): refine scene controls and camera views
Generic Container CI/CD / test-build-publish (push) Successful in 2m20s
Frontend CI/CD v2 / build-test-publish-and-deploy (push) Successful in 2m20s

Keep the control panel geometry stable when toggling building context, and use accessible switch controls to prevent focus-driven movement. Add browser coverage for camera framing, opacity, responsive layout, and the default 6x pipe scale.
This commit is contained in:
2026-09-14 15:41:44 +08:00
parent 69ad145e75
commit a9b25b94d8
11 changed files with 567 additions and 56 deletions
@@ -85,14 +85,14 @@ export function enhanceMaterials(object){
}
// Restore the authored appearance on every mode change. In network overview,
// opaque buildings fade more than glass so the curtain wall remains legible.
export function applyBuildingContext(material,fade){
// all architectural context follows the same user-controlled opacity ceiling.
export function applyBuildingContext(material,fade,contextOpacity=.4){
const original=material.userData.original??{opacity:material.opacity,transparent:material.transparent,depthWrite:material.depthWrite};
material.userData.original=original;
const facade=/v3_glass|coatedcurtainglass/i.test(material.name);
material.opacity=fade?(facade?Math.min(original.opacity,.38):.12):original.opacity;
material.transparent=fade||original.transparent;
material.depthWrite=fade?false:original.depthWrite;material.needsUpdate=true;
const opacity=THREE.MathUtils.clamp(contextOpacity,0,1),contextualOpacity=Math.min(original.opacity,opacity);
material.opacity=fade?contextualOpacity:original.opacity;
material.transparent=fade?(contextualOpacity<1||original.transparent):original.transparent;
material.depthWrite=fade&&contextualOpacity<1?false:original.depthWrite;material.needsUpdate=true;
}
const presets={