viewer: egui depth format 불일치 수정 + 변수명 경고 제거
- egui_wgpu::Renderer:🆕 depth format None (UI는 depth 불필요) - bridge_scene.rs: SPAN_M 등 snake_case로 전환 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -71,22 +71,22 @@ fn merge(meshes: Vec<Mesh>) -> Mesh {
|
|||||||
|
|
||||||
/// Build a complete bridge scene mesh using the provided kernel and parameters.
|
/// Build a complete bridge scene mesh using the provided kernel and parameters.
|
||||||
pub fn build_bridge_scene<K: GeomKernel>(kernel: &K, p: &SceneParams) -> Result<Mesh, KernelError> {
|
pub fn build_bridge_scene<K: GeomKernel>(kernel: &K, p: &SceneParams) -> Result<Mesh, KernelError> {
|
||||||
let SPAN_M = p.span_m;
|
let span_m = p.span_m;
|
||||||
let SPAN_MM = (p.span_m * 1_000.0) as f32;
|
let span_mm = (p.span_m * 1_000.0) as f32;
|
||||||
let N_GIRDERS = p.girder_count.max(1).min(10);
|
let n_girders = p.girder_count.max(1).min(10);
|
||||||
let SPACING = p.girder_spacing;
|
let spacing = p.girder_spacing;
|
||||||
let GIRDER_H = p.girder_height;
|
let girder_h = p.girder_height;
|
||||||
const BEARING_H: f32 = 60.0; // mm
|
const BEARING_H: f32 = 60.0; // mm
|
||||||
|
|
||||||
let mut parts: Vec<Mesh> = Vec::new();
|
let mut parts: Vec<Mesh> = Vec::new();
|
||||||
|
|
||||||
// ── Girders ────────────────────────────────────────────────────────────────
|
// ── Girders ────────────────────────────────────────────────────────────────
|
||||||
for i in 0..N_GIRDERS {
|
for i in 0..n_girders {
|
||||||
let x = (i as f32 - (N_GIRDERS as f32 - 1.0) * 0.5) * SPACING;
|
let x = (i as f32 - (n_girders as f32 - 1.0) * 0.5) * spacing;
|
||||||
let ir = GirderIR {
|
let ir = GirderIR {
|
||||||
id: FeatureId::new(),
|
id: FeatureId::new(),
|
||||||
station_start: 0.0,
|
station_start: 0.0,
|
||||||
station_end: SPAN_M,
|
station_end: span_m,
|
||||||
offset_from_alignment: x as f64,
|
offset_from_alignment: x as f64,
|
||||||
section_type: SectionType::PscI,
|
section_type: SectionType::PscI,
|
||||||
section: SectionParams::PscI(PscISectionParams::kds_standard()),
|
section: SectionParams::PscI(PscISectionParams::kds_standard()),
|
||||||
@@ -101,11 +101,11 @@ pub fn build_bridge_scene<K: GeomKernel>(kernel: &K, p: &SceneParams) -> Result<
|
|||||||
|
|
||||||
// ── Deck Slab ──────────────────────────────────────────────────────────────
|
// ── Deck Slab ──────────────────────────────────────────────────────────────
|
||||||
// KDS: min 220 mm, width = (N-1)*spacing + 2 × cantilever
|
// KDS: min 220 mm, width = (N-1)*spacing + 2 × cantilever
|
||||||
let half_width = ((N_GIRDERS as f32 - 1.0) * SPACING) * 0.5 + 1_000.0; // 1 m cantilever
|
let half_width = ((n_girders as f32 - 1.0) * spacing) * 0.5 + 1_000.0; // 1 m cantilever
|
||||||
let deck_ir = DeckSlabIR {
|
let deck_ir = DeckSlabIR {
|
||||||
id: FeatureId::new(),
|
id: FeatureId::new(),
|
||||||
station_start: 0.0,
|
station_start: 0.0,
|
||||||
station_end: SPAN_M,
|
station_end: span_m,
|
||||||
width_left: half_width as f64,
|
width_left: half_width as f64,
|
||||||
width_right: half_width as f64,
|
width_right: half_width as f64,
|
||||||
thickness: p.slab_thickness as f64,
|
thickness: p.slab_thickness as f64,
|
||||||
@@ -115,16 +115,16 @@ pub fn build_bridge_scene<K: GeomKernel>(kernel: &K, p: &SceneParams) -> Result<
|
|||||||
};
|
};
|
||||||
let mut deck_mesh = kernel.deck_slab_mesh(&deck_ir)?;
|
let mut deck_mesh = kernel.deck_slab_mesh(&deck_ir)?;
|
||||||
deck_mesh.recolor(COL_DECK);
|
deck_mesh.recolor(COL_DECK);
|
||||||
parts.push(translate(deck_mesh, 0.0, GIRDER_H + p.slab_thickness, 0.0));
|
parts.push(translate(deck_mesh, 0.0, girder_h + p.slab_thickness, 0.0));
|
||||||
|
|
||||||
// ── Bearings ───────────────────────────────────────────────────────────────
|
// ── Bearings ───────────────────────────────────────────────────────────────
|
||||||
// 5 per abutment, one under each girder
|
// 5 per abutment, one under each girder
|
||||||
for &z in &[0.0_f32, SPAN_MM] {
|
for &z in &[0.0_f32, span_mm] {
|
||||||
for i in 0..N_GIRDERS {
|
for i in 0..n_girders {
|
||||||
let x = (i as f32 - (N_GIRDERS as f32 - 1.0) * 0.5) * SPACING;
|
let x = (i as f32 - (n_girders as f32 - 1.0) * 0.5) * spacing;
|
||||||
let bearing_ir = BearingIR {
|
let bearing_ir = BearingIR {
|
||||||
id: FeatureId::new(),
|
id: FeatureId::new(),
|
||||||
station: if z < 1.0 { 0.0 } else { SPAN_M },
|
station: if z < 1.0 { 0.0 } else { span_m },
|
||||||
bearing_type: BearingType::Elastomeric,
|
bearing_type: BearingType::Elastomeric,
|
||||||
plan_length: 350.0,
|
plan_length: 350.0,
|
||||||
plan_width: 450.0,
|
plan_width: 450.0,
|
||||||
@@ -139,10 +139,10 @@ pub fn build_bridge_scene<K: GeomKernel>(kernel: &K, p: &SceneParams) -> Result<
|
|||||||
|
|
||||||
// ── Abutments ──────────────────────────────────────────────────────────────
|
// ── Abutments ──────────────────────────────────────────────────────────────
|
||||||
let wing = WingWallIR { length: 5_000.0, height: 2_500.0, thickness: 500.0 };
|
let wing = WingWallIR { length: 5_000.0, height: 2_500.0, thickness: 500.0 };
|
||||||
let total_w = (N_GIRDERS as f64 - 1.0) * SPACING as f64 + 3_000.0;
|
let total_w = (n_girders as f64 - 1.0) * spacing as f64 + 3_000.0;
|
||||||
let breast_wall_h = (GIRDER_H + BEARING_H) as f64;
|
let breast_wall_h = (girder_h + BEARING_H) as f64;
|
||||||
|
|
||||||
for &(station, z) in &[(0.0f64, -800.0_f32), (SPAN_M, SPAN_MM)] {
|
for &(station, z) in &[(0.0f64, -800.0_f32), (span_m, span_mm)] {
|
||||||
let abut_ir = AbutmentIR {
|
let abut_ir = AbutmentIR {
|
||||||
id: FeatureId::new(),
|
id: FeatureId::new(),
|
||||||
station,
|
station,
|
||||||
|
|||||||
@@ -284,8 +284,9 @@ impl RenderState {
|
|||||||
&*window,
|
&*window,
|
||||||
None, None, None,
|
None, None, None,
|
||||||
);
|
);
|
||||||
|
// egui renders 2D UI overlay — no depth buffer
|
||||||
let egui_renderer = egui_wgpu::Renderer::new(
|
let egui_renderer = egui_wgpu::Renderer::new(
|
||||||
&device, format, Some(DEPTH_FORMAT), 1, false,
|
&device, format, None, 1, false,
|
||||||
);
|
);
|
||||||
|
|
||||||
RenderState {
|
RenderState {
|
||||||
|
|||||||
Reference in New Issue
Block a user