diff --git a/src/core/abut/visibility.ts b/src/core/abut/visibility.ts index 3e8e0f7..0186904 100644 --- a/src/core/abut/visibility.ts +++ b/src/core/abut/visibility.ts @@ -2,7 +2,7 @@ * What the 3D view draws for the selection (2026-11-03, 형상계획 ②). * In ② only the selected object is drawn: a selected abutment hides the piers, and a selected pier hides the abutments. * In ① (형상 생성) the abutments are always drawn, as before; the piers follow 전체 보기 in ①, not this rule. - * In ③ (2026-11-04, 교대 배근) a selected abutment is drawn alone too; with a pier selected, ③ draws as before. + * In ③ (2026-11-04) only the selected object is drawn too, the same as ②: a selected pier hides the abutments. */ /** True when the pier scene (and its rebar) should be built for this stage and selection. */ @@ -12,7 +12,6 @@ export function piersShown(stage: string, abutActive: string | null): boolean { /** True when the abutment with this name should be drawn. */ export function abutShown(stage: string, abutActive: string | null, name: string): boolean { - if (stage === 'rebar') return abutActive === null || name === abutActive; - if (stage !== 'plan') return true; + if (stage !== 'plan' && stage !== 'rebar') return true; return name === abutActive; } diff --git a/src/main.ts b/src/main.ts index fe8d2c2..6e79a7f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2559,8 +2559,9 @@ function setStage(stage: Stage): void { const previous = state.stage; state.stage = stage; // Switching 전체 보기 on or off in ① needs the scene rebuilt for the new layout. - // Entering or leaving ② changes which objects are drawn (visibility.ts), so the scene is rebuilt then. - if ((allPiers !== null) !== multiSceneOn() || stage === 'plan' || previous === 'plan') setupScene(); + // Entering or leaving ② or ③ changes which objects are drawn (visibility.ts), so the scene is rebuilt then. + const selectionOnly = (s: Stage) => s === 'plan' || s === 'rebar'; + if ((allPiers !== null) !== multiSceneOn() || selectionOnly(stage) !== selectionOnly(previous)) setupScene(); if (state.scene) setRebarView(state.scene, stage === 'rebar'); for (const g of abutGroups) setRebarViewOn(g, stage === 'rebar'); $('view-shape').hidden = stage !== 'shape'; diff --git a/tests/abut-visibility.test.ts b/tests/abut-visibility.test.ts index 1954321..fdb99ef 100644 --- a/tests/abut-visibility.test.ts +++ b/tests/abut-visibility.test.ts @@ -21,12 +21,12 @@ describe('형상계획 ②: 선택한 객체만 3D에 그림', () => { expect(abutShown('shape', null, 'A1')).toBe(true); }); - it('③ draws a selected abutment alone (2026-11-04); with no abutment selected ③ and ④ draw as before', () => { + it('③ draws only the selected object, as ② (2026-11-04); ④ draws as before', () => { expect(piersShown('rebar', 'A1')).toBe(false); expect(abutShown('rebar', 'A1', 'A1')).toBe(true); expect(abutShown('rebar', 'A1', 'A2')).toBe(false); expect(piersShown('rebar', null)).toBe(true); - expect(abutShown('rebar', null, 'A1')).toBe(true); + expect(abutShown('rebar', null, 'A1')).toBe(false); expect(piersShown('quantity', 'A1')).toBe(true); }); });