feat(view): ③ rebar view at 50% for members, ground and blinding; deeper rebar colour
On ③ the members, the ground and the blinding concrete are drawn at half opacity without depth writes, so the bars show through. Outside ③ each part returns to its own opacity. Rebar colours are shaded to 0.8 and slightly glossier so they read through the members. Approved 2026-10-23. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e0e220f35c
commit
398fa997e2
4 files changed
+52
-3
No files matched your search
@@ -87,6 +87,7 @@ export function buildPierScene(m: PierModel): PierScene {
|
||||
side: THREE.DoubleSide,
|
||||
clippingPlanes,
|
||||
});
|
||||
material.userData.baseOpacity = opacity;
|
||||
parts[part].add(new THREE.Mesh(geometry, material));
|
||||
};
|
||||
|
||||
@@ -146,6 +147,24 @@ export function buildPierScene(m: PierModel): PierScene {
|
||||
return { root, parts, size };
|
||||
}
|
||||
|
||||
/** ③ rebar view: members and the ground at half opacity so the bars show through (승인 2026-10-23). */
|
||||
const REBAR_VIEW_ALPHA = 0.5;
|
||||
|
||||
/** Turns the ③ rebar view on or off. Off restores each part's own opacity. Depth writes stop while on, so bars behind a member stay visible. */
|
||||
export function setRebarView(scene: PierScene, on: boolean): void {
|
||||
for (const group of Object.values(scene.parts)) {
|
||||
group.traverse((o) => {
|
||||
if (!(o instanceof THREE.Mesh)) return;
|
||||
const mat = o.material as THREE.MeshStandardMaterial;
|
||||
const base = mat.userData.baseOpacity as number;
|
||||
mat.opacity = on ? REBAR_VIEW_ALPHA : base;
|
||||
mat.transparent = on || base < 1;
|
||||
mat.depthWrite = !on;
|
||||
mat.needsUpdate = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export type ViewKind = 'iso' | 'front' | 'side' | 'top';
|
||||
|
||||
/** Camera position for one of the four view presets, looking at the centre of the model. */
|
||||
|
||||
Reference in new issue
Block a user