diff --git a/cimery/crates/kernel/src/abutment.rs b/cimery/crates/kernel/src/abutment.rs index 68c4d25..e2cc595 100644 --- a/cimery/crates/kernel/src/abutment.rs +++ b/cimery/crates/kernel/src/abutment.rs @@ -20,27 +20,49 @@ pub fn build_abutment_mesh(ir: &AbutmentIR) -> Result { let mut parts: Vec = Vec::new(); - // Breast wall: along transverse (Z), thickness along span (X), height (Y) - parts.push(sweep::centred_box(0.0, bw_h * 0.5, bw_t * 0.5, bw_h * 0.5, bw_w)); - - // Footing: below grade, spans along X (span direction) + // Coordinate convention (bridge): X=transverse, Y=vertical, Z=along span + // + // Breast wall: WIDE along X (bw_w), TALL along Y (bw_h), THIN along Z (bw_t) + // → profile in XY plane, swept bw_t along Z { + let hw = bw_w * 0.5; let profile = vec![ - [-ft_l * 0.5, -ft_t], - [ ft_l * 0.5, -ft_t], - [ ft_l * 0.5, 0.0 ], - [-ft_l * 0.5, 0.0 ], + [-hw, 0.0 ], + [ hw, 0.0 ], + [ hw, bw_h], + [-hw, bw_h], ]; - parts.push(sweep::sweep_profile_flat(&profile, ft_w)); + parts.push(sweep::sweep_profile_flat(&profile, bw_t)); } - // Wing walls (left and right) - for side in [&ir.wing_wall_left, &ir.wing_wall_right] { + // Footing: WIDE along X (ft_w), thin along Y (ft_t), LENGTH along Z (ft_l) + // → profile in XY plane, swept ft_l along Z + { + let hw = ft_w * 0.5; + let profile = vec![ + [-hw, -ft_t], + [ hw, -ft_t], + [ hw, 0.0 ], + [-hw, 0.0 ], + ]; + parts.push(sweep::sweep_profile_flat(&profile, ft_l)); + } + + // Wing walls: extend transversely (±X) from abutment ends. + // Left wing: from X = -bw_w/2 extending further in -X + // Right wing: from X = +bw_w/2 extending further in +X + for (side, sign) in [(&ir.wing_wall_left, -1.0_f32), (&ir.wing_wall_right, 1.0_f32)] { let wl = side.length as f32; let wh = side.height as f32; let wt = side.thickness as f32; - // Simplified: vertical rectangle, oriented in XY, length along Z - parts.push(sweep::centred_box(0.0, wh * 0.5, wt * 0.5, wh * 0.5, wl)); + // Profile in XY: length wl, height wh; swept wt along Z + let x_start = sign * bw_w * 0.5; + let x_end = x_start + sign * wl; + let (xl, xr) = if x_start < x_end { (x_start, x_end) } else { (x_end, x_start) }; + let profile = vec![ + [xl, 0.0], [xr, 0.0], [xr, wh], [xl, wh], + ]; + parts.push(sweep::sweep_profile_flat(&profile, wt)); } Ok(sweep::merge_meshes(parts)) diff --git a/cimery/crates/viewer/src/lib.rs b/cimery/crates/viewer/src/lib.rs index 79ca973..67f6afa 100644 --- a/cimery/crates/viewer/src/lib.rs +++ b/cimery/crates/viewer/src/lib.rs @@ -24,13 +24,10 @@ use winit::{ window::{Window, WindowId}, }; use wgpu::util::DeviceExt; -use cimery_core::{MaterialGrade, SectionType}; -use cimery_ir::{FeatureId, GirderIR, PscISectionParams, SectionParams}; #[cfg(feature = "occt")] use cimery_kernel::OcctKernel; #[cfg(not(feature = "occt"))] use cimery_kernel::PureRustKernel; -use cimery_kernel::GeomKernel; use camera::{Camera, StandardView}; use glam;