fix: 거더 높이 변경 시 씬 미갱신 + 받침 치수 오류 수정

[버그 1] Apply 후 카메라 자동 피트 누락
- rebuild_mesh() 에서 scene_extents 만 업데이트하고 camera target/radius 는
  갱신하지 않아, 거더 높이를 올려도 카메라가 구 씬 중심을 가리켜 변화가 안 보임.
- 수정: rebuild_mesh() 끝에 camera.zoom_extents(mn, mx) + update_camera() 추가.

[버그 2] bearing.rs plan_length / plan_width 방향 오류
- plan_length(350mm, 경간 방향)를 profile X(횡방향)에, plan_width(450mm, 횡방향)를
  sweep Z(경간방향)에 사용 → 받침이 90° 회전된 치수로 생성됨.
- Z 센터링 오프셋도 plan_width/2=225mm 로 계산 → 올바른 plan_length/2=175mm 보다
  50mm 더 교대 밖으로 튀어나옴 (스크린샷의 부유 블록).
- 수정:
  · bearing.rs: trans_dim=plan_width(profile X), span_dim=plan_length(sweep Z)
  · bridge_scene.rs: build_bridge_scene + build_selectable_scene 의 Z 오프셋을
    z - 225 → z - plan_length/2 = z - 175 로 변경.

cargo check --workspace 0 errors/warnings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
minsung
2026-04-15 09:30:13 +09:00
parent 824c18610b
commit 24b15f15ec
3 changed files with 25 additions and 14 deletions

View File

@@ -7,18 +7,20 @@ pub fn build_bearing_mesh(ir: &BearingIR) -> Result<Mesh, KernelError> {
if ir.plan_length <= 0.0 || ir.plan_width <= 0.0 || ir.total_height <= 0.0 {
return Err(KernelError::InvalidInput("bearing dimensions must be positive".into()));
}
// Box: X=[-l/2, +l/2] centred, Y=[-h, 0] (top at Y=0 = girder soffit), Z=[0, w]
// Caller translates to girder X offset; Y=0 means bearing top sits at soffit.
let l = ir.plan_length as f32;
// 좌표계: X = 횡방향(transverse), Y = 높이(vertical, top = 0), Z = 경간방향(span).
// plan_length = 경간 방향 치수 [mm] → sweep 축(Z).
// plan_width = 횡방향 치수 [mm] → profile X 축.
// Y=0 = 거더 소핏(soffit); bearing 상부가 소핏에 밀착.
let trans_dim = ir.plan_width as f32; // 횡 방향 (profile X)
let span_dim = ir.plan_length as f32; // 경간 방향 (sweep Z)
let h = ir.total_height as f32;
let w = ir.plan_width as f32;
let profile = vec![
[-l * 0.5, -h ],
[ l * 0.5, -h ],
[ l * 0.5, 0.0],
[-l * 0.5, 0.0],
[-trans_dim * 0.5, -h ],
[ trans_dim * 0.5, -h ],
[ trans_dim * 0.5, 0.0],
[-trans_dim * 0.5, 0.0],
];
Ok(sweep::sweep_profile_flat(&profile, w))
Ok(sweep::sweep_profile_flat(&profile, span_dim))
}
#[cfg(test)]