받침 중심 정렬 + 부재별 색상 구분
bearing.rs: X 중심, Y 하방향 (-h to 0) 기하학 수정 bridge_scene.rs: 받침 X 오프셋 제거 (girder 정렬) Mesh: colors 필드 추가 + recolor() 메서드 sweep.rs / occt.rs: 기본 콘크리트 색 자동 채움 bridge_scene: 부재별 색상 (거더/슬래브/받침/교대) shader.wgsl: base_color 입력 → 조명 계산에 적용 선택(Selection) 기능은 계획대로 별도 Sprint에 구현. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,12 @@ use cimery_ir::{
|
||||
};
|
||||
use cimery_kernel::{GeomKernel, KernelError, Mesh};
|
||||
|
||||
// ── Part colours (linear sRGB) ──────────────────────────────────────────────
|
||||
pub const COL_GIRDER: [f32; 3] = [0.85, 0.82, 0.72]; // light concrete
|
||||
pub const COL_DECK: [f32; 3] = [0.72, 0.70, 0.62]; // slightly darker slab
|
||||
pub const COL_BEARING: [f32; 3] = [0.30, 0.30, 0.35]; // dark rubber/steel
|
||||
pub const COL_ABUTMENT: [f32; 3] = [0.65, 0.60, 0.50]; // brown concrete
|
||||
|
||||
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
||||
|
||||
fn translate(mut mesh: Mesh, dx: f32, dy: f32, dz: f32) -> Mesh {
|
||||
@@ -58,7 +64,8 @@ pub fn build_bridge_scene<K: GeomKernel>(kernel: &K) -> Result<Mesh, KernelError
|
||||
spacing: 0.0,
|
||||
material: MaterialGrade::C50,
|
||||
};
|
||||
let mesh = kernel.girder_mesh(&ir)?;
|
||||
let mut mesh = kernel.girder_mesh(&ir)?;
|
||||
mesh.recolor(COL_GIRDER);
|
||||
parts.push(translate(mesh, x, 0.0, 0.0));
|
||||
}
|
||||
|
||||
@@ -76,8 +83,8 @@ pub fn build_bridge_scene<K: GeomKernel>(kernel: &K) -> Result<Mesh, KernelError
|
||||
cross_slope: 2.0,
|
||||
material: MaterialGrade::C40,
|
||||
};
|
||||
let deck_mesh = kernel.deck_slab_mesh(&deck_ir)?;
|
||||
// Slab Y=0 is its top face; place it so bottom aligns with girder top
|
||||
let mut deck_mesh = kernel.deck_slab_mesh(&deck_ir)?;
|
||||
deck_mesh.recolor(COL_DECK);
|
||||
parts.push(translate(deck_mesh, 0.0, GIRDER_H + 220.0, 0.0));
|
||||
|
||||
// ── Bearings ───────────────────────────────────────────────────────────────
|
||||
@@ -94,9 +101,9 @@ pub fn build_bridge_scene<K: GeomKernel>(kernel: &K) -> Result<Mesh, KernelError
|
||||
total_height: BEARING_H as f64,
|
||||
capacity_vertical: 1_500.0,
|
||||
};
|
||||
let mesh = kernel.bearing_mesh(&bearing_ir)?;
|
||||
// Place bearing centred under each girder, top at Y=0 (girder soffit)
|
||||
parts.push(translate(mesh, x - 175.0, -BEARING_H, z - 225.0));
|
||||
let mut mesh = kernel.bearing_mesh(&bearing_ir)?;
|
||||
mesh.recolor(COL_BEARING);
|
||||
parts.push(translate(mesh, x, 0.0, z - 225.0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,10 +127,9 @@ pub fn build_bridge_scene<K: GeomKernel>(kernel: &K) -> Result<Mesh, KernelError
|
||||
wing_wall_right: wing.clone(),
|
||||
material: MaterialGrade::C40,
|
||||
};
|
||||
let mesh = kernel.abutment_mesh(&abut_ir)?;
|
||||
// Place abutment: breast wall top at Y = -(BEARING_H)
|
||||
let mut mesh = kernel.abutment_mesh(&abut_ir)?;
|
||||
mesh.recolor(COL_ABUTMENT);
|
||||
let y = -(BEARING_H + abut_ir.breast_wall_height as f32);
|
||||
// Abutment geometry is already centred at X=0; only Y and Z offset needed.
|
||||
parts.push(translate(mesh, 0.0, y, z));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user