#3830: tell a 3-entry .3dl mesh apart by the row count alone

This commit is contained in:
arnav-hiwarkar committed 2026-11-18 15:46:04 +05:30
1 parent bf31b65271
commit c6612da798
1 file changed
+2 -6
+2 -6
View File
@@ -77,12 +77,8 @@ pub(super) fn parse_3dl_limited(text: &str, max_side: usize) -> Option<Lut> {
return None;
}
}
let is_cube = |k: usize| {
let n = (k as f64).cbrt().round() as usize;
n * n * n == k
};
// A 3-entry input mesh (3³ lattice) looks like a data row: tell them apart by the count.
if mesh.is_none() && !is_cube(rows.len()) && rows.len() == 28 {
// A 3-entry input mesh (3³ lattice) looks like a data row: 28 rows are a mesh and 27.
if mesh.is_none() && rows.len() == 28 {
mesh = Some(rows.remove(0).to_vec());
}
let n = match &mesh {