mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-03 02:25:55 +00:00
smlib: rustfmt after the C++ kernel's removal
Blank lines the deleted tests left, and lines that fit on one now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
This commit is contained in:
@@ -281,8 +281,6 @@ fn solidcore_case(name: &'static str) -> Got {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
macro_rules! cases {
|
||||
($($m:ident $(: $ign:meta)?),* $(,)?) => {$(
|
||||
mod $m {
|
||||
@@ -668,7 +666,6 @@ fn the_first_distance_goes_on_the_face_along_first() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// The capi's `knife_edge_chamfers` (fork e96898d): a 10 high extrusion of the profile whose arc
|
||||
/// of radius R = 21 runs out tangent into its top line at the tip x = 62 1/6 (a knife edge, a
|
||||
/// cusp), chamfered d at the tip. No ball lies d back along both faces there; the chamfer is the
|
||||
@@ -747,7 +744,6 @@ fn edges_871() -> Vec<[f64; 3]> {
|
||||
[23.5, 9.5].iter().flat_map(|x| yz.iter().map(move |(y, z)| [*x, *y, *z])).collect()
|
||||
}
|
||||
|
||||
|
||||
/// #871's rounds at r 0.5 fit (the wall between the window and the block's side is 1.26 thick):
|
||||
/// 38 faces, and the closed form `issue_871_tests::rounds_that_fit_are_closed` derives. At r 1 they
|
||||
/// overlap, which is refused.
|
||||
|
||||
@@ -186,8 +186,6 @@ fn solidcore_case(name: &'static str) -> Option<Measured> {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
macro_rules! cases {
|
||||
($($m:ident $(: $ign:meta)?),* $(,)?) => {$(
|
||||
mod $m {
|
||||
@@ -323,7 +321,6 @@ fn a_failed_closest_point_counts_as_off_the_piece() {
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
|
||||
/// Rig case booleans/2928, reduced (fork c2e3d9d): a ring, r 3..5 about (0, 10), z 0..2, unioned
|
||||
/// with a half annulus prism, r 4..5 about (e, 10), z 2..20, whose cap sits on the ring's top. Two
|
||||
/// equal circles a little apart cross; they do not coincide over a tiny edge. The stack's volume
|
||||
|
||||
@@ -2492,7 +2492,6 @@ fn extent2d(u0: f64, v0: f64, u1: f64, v1: f64) -> Result<Extent2d> {
|
||||
Ok(Extent2d::from_bounds(u0, v0, u1, v1))
|
||||
}
|
||||
|
||||
|
||||
/// A body from the flat arrays the C API imports (`BrepFromFlat`): `Validate`,
|
||||
/// `FlatToBrepData`, then `MakeTopologyFromData` with the B-rep's tolerance as it is ([`own_tolerances`]) and no UV
|
||||
/// trims or analytic conversion made; it heals unless `SOURCE` says SMLib wrote the arrays.
|
||||
|
||||
@@ -90,8 +90,6 @@ fn round_trips(name: &str) {
|
||||
assert!(rel(v, c.volume) < 1e-9, "{name}: {v} vs {}", c.volume);
|
||||
}
|
||||
|
||||
|
||||
|
||||
macro_rules! primitive {
|
||||
($m:ident, $name:literal $(, volume: $vol:meta)? $(, round_trip: $rt:meta)?) => {
|
||||
mod $m {
|
||||
@@ -166,8 +164,6 @@ fn a_parabola_gives_its_nurb_or_says_it_cannot() {
|
||||
assert!(matches!(&none, Err(e) if e.to_string().contains("MakeNurb")), "{none:?}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// Each edge's and vertex's tolerance crosses the kernels as it is. One box edge given eight times
|
||||
/// the box's tolerance, in arrays whose TOLERANCE is the largest (as SMLib's export wrote them),
|
||||
/// keeps it round after round, and the B-rep and every other edge and vertex keep the box's. Every
|
||||
@@ -286,5 +282,3 @@ fn shells_listed_inner_first_import_outer_first() {
|
||||
let v = volume(&back, 1e-9).unwrap();
|
||||
assert!(rel(v, SEALED_VOID_VOLUME) < 1e-9, "inner first: {v}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -108,15 +108,6 @@ fn check_refuses_only_an_unknown_naming() {
|
||||
name(NamingScheme::Caller).unwrap();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
macro_rules! primitive {
|
||||
($m:ident, $name:literal $(, mass: $mass:meta)? $(, area: $area:meta)?) => {
|
||||
mod $m {
|
||||
@@ -162,7 +153,6 @@ primitive!(cone, "cone");
|
||||
primitive!(frustum, "frustum");
|
||||
primitive!(torus, "torus");
|
||||
|
||||
|
||||
/// A valid box passes every test at level 2 (SolidCraft's level), with an empty report.
|
||||
#[test]
|
||||
fn a_valid_box_passes_level_2() {
|
||||
|
||||
@@ -199,8 +199,6 @@ fn solidcore_case(name: &str) -> Got {
|
||||
judge(name, "solidcore", got)
|
||||
}
|
||||
|
||||
|
||||
|
||||
macro_rules! cases {
|
||||
($($m:ident $(: $ign:meta)?),* $(,)?) => {$(
|
||||
mod $m {
|
||||
@@ -345,7 +343,6 @@ fn a_flap_on_a_cube_edge_stays_beside_it() {
|
||||
assert!((v - 1000.0).abs() < 1e-6 && (a - 700.0).abs() < 1e-6, "volume {v}, area {a}");
|
||||
}
|
||||
|
||||
|
||||
/// The inputs are never changed.
|
||||
#[test]
|
||||
fn the_body_stays_as_it_was() {
|
||||
@@ -357,4 +354,3 @@ fn the_body_stays_as_it_was() {
|
||||
let _ = merge_faces(&block, &[], TOL).unwrap();
|
||||
assert_eq!(counts(&block).unwrap(), was);
|
||||
}
|
||||
|
||||
|
||||
@@ -335,8 +335,6 @@ fn solidcore_case(name: &'static str) -> Got {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
macro_rules! cases {
|
||||
($($m:ident $(: $ign:meta)?),* $(,)?) => {$(
|
||||
mod $m {
|
||||
@@ -526,10 +524,6 @@ fn a_draft_leaves_no_mark() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// A stepped block, 40 x 30 x 10 with its half x < 20 raised to 20 (rig case
|
||||
/// shell/cov-replace-face-step-onto-the-higher-face, the fork's `offset_faces_close_a_step_wall`):
|
||||
/// a top moved onto the other's plane closes the step wall between them to nothing, and the tops
|
||||
@@ -549,7 +543,6 @@ fn offset_faces_close_a_step_wall() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Rig case shell/4492's rounded box: four mitred rounds, r 3, come off a 40 x 30 x 10 box's top
|
||||
/// together and follow it. From height 0 the outline is the 34 x 24 top moved out by the round's
|
||||
/// w(z) = sqrt(9 - (z - axis)^2), or 3 below the axis. With the fork's values at +19, and bodies
|
||||
|
||||
@@ -127,9 +127,6 @@ fn solidcore_case(name: &str) -> Got {
|
||||
judge(name, "solidcore", got)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
macro_rules! cases {
|
||||
($($m:ident $(: $ign:meta)?),* $(,)?) => {$(
|
||||
mod $m {
|
||||
@@ -258,7 +255,6 @@ fn the_body_stays_as_it_was() {
|
||||
assert!(rel(volume(&b, 1e-8).unwrap(), 1000.0) < 1e-12);
|
||||
}
|
||||
|
||||
|
||||
/// A one-face sheet on a B-spline surface (as SolidCraft's extrude of a sketch spline makes it:
|
||||
/// the cubic through (0, 0), (13, -8), (27, 8), (40, 0) in x and z, straight along y over
|
||||
/// [0, 40]) cut by four plane strips standing on the square [12, 28]^2: the strips meet the
|
||||
|
||||
@@ -1594,12 +1594,7 @@ fn put_curve(c: &Curve) -> solidcore::Result<Out<(Profile, [f64; 2])>> {
|
||||
knots.extend(std::iter::repeat_n(u, m));
|
||||
}
|
||||
let clamped = can.knot_multiplicities.first().is_some_and(|&m| m > degree) && can.knot_multiplicities.last().is_some_and(|&m| m > degree);
|
||||
if !(1..=CURVE_MAX_DEGREE).contains(°ree)
|
||||
|| count < degree + 1
|
||||
|| count > CURVE_MAX_POINTS
|
||||
|| knots.len() != count + degree + 1
|
||||
|| !clamped
|
||||
{
|
||||
if !(1..=CURVE_MAX_DEGREE).contains(°ree) || count < degree + 1 || count > CURVE_MAX_POINTS || knots.len() != count + degree + 1 || !clamped {
|
||||
return Ok(Err(Error::Unsupported));
|
||||
}
|
||||
let points = can.control_points.iter().enumerate().map(|(i, p)| [p.x, p.y, p.z, can.weights.get(i).copied().unwrap_or(1.0)]).collect();
|
||||
|
||||
@@ -355,8 +355,6 @@ fn solidcore_case(name: &'static str) -> Got {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
macro_rules! cases {
|
||||
($($m:ident $([$pign:meta])? $(: $ign:meta)?),* $(,)?) => {$(
|
||||
mod $m {
|
||||
@@ -471,7 +469,6 @@ fn sweep_placed_reports_the_motions() {
|
||||
check_motions(&turned, &quarter_turn());
|
||||
}
|
||||
|
||||
|
||||
/// A diagonal 10 above a 10 x 10 x 10 box's top, projected down onto the top: the same diagonal
|
||||
/// at z = 10.
|
||||
#[test]
|
||||
@@ -573,7 +570,6 @@ fn a_box_top_section_is_the_line_across_it() {
|
||||
assert!((len - 10.0).abs() < 1e-6, "{len} against 10");
|
||||
}
|
||||
|
||||
|
||||
/// The capi's argument checks, before any kernel call.
|
||||
#[test]
|
||||
fn hostile_arguments_are_refused() {
|
||||
|
||||
@@ -174,8 +174,6 @@ fn solidcore_case(name: &str) -> Got {
|
||||
judge(name, "solidcore", got)
|
||||
}
|
||||
|
||||
|
||||
|
||||
macro_rules! cases {
|
||||
($($m:ident $(: $ign:meta)?),* $(,)?) => {$(
|
||||
mod $m {
|
||||
@@ -240,4 +238,3 @@ fn the_body_stays_as_it_was() {
|
||||
assert_eq!(bounds(x).unwrap(), ([1.0, 2.0, 3.0], [11.0, 22.0, 33.0]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -132,8 +132,6 @@ fn solidcore_case(name: &str) -> Got {
|
||||
judge(name, "solidcore", got)
|
||||
}
|
||||
|
||||
|
||||
|
||||
macro_rules! cases {
|
||||
($($m:ident $(: $ign:meta)?),* $(,)?) => {$(
|
||||
mod $m {
|
||||
@@ -185,7 +183,6 @@ fn the_body_stays_as_it_was() {
|
||||
assert_eq!(counts(&b).unwrap(), was);
|
||||
}
|
||||
|
||||
|
||||
/// A one-face sheet on `surface` over `domain`, the face its whole box.
|
||||
fn whole_face(surface: solidcore::surface::surface::Surface) -> Body {
|
||||
use solidcore::topology::brep::p3::new_brep;
|
||||
@@ -275,8 +272,6 @@ fn extend_solidcore(name: &str) -> Got {
|
||||
extend_judge(name, "solidcore", got)
|
||||
}
|
||||
|
||||
|
||||
|
||||
macro_rules! extend_cases {
|
||||
($($m:ident $(: $ign:meta)?),* $(,)?) => {$(
|
||||
mod $m {
|
||||
|
||||
@@ -280,7 +280,6 @@ impl Brep {
|
||||
}
|
||||
core::blend::blend(self.core(), kind, edges, sizes, tolerance, corners, setbacks, open).map(Brep::made_core)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -33,7 +33,6 @@ impl Brep {
|
||||
/// normal and the part in front. A `sheet` that is no sheet, or a `face` it does not have, is
|
||||
/// [`Error::Argument`].
|
||||
pub fn split_body_by_sheet(&self, sheet: &Brep, face: usize) -> Result<Option<(Brep, Brep)>> {
|
||||
core::split::split_body_by_sheet(self.core(), sheet.core(), face)
|
||||
.map(|r| r.map(|(b, f)| (Brep::made_core(b), Brep::made_core(f))))
|
||||
core::split::split_body_by_sheet(self.core(), sheet.core(), face).map(|r| r.map(|(b, f)| (Brep::made_core(b), Brep::made_core(f))))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -616,7 +616,6 @@ fn global_intersect_scores() -> Vec<Score> {
|
||||
scores
|
||||
}
|
||||
|
||||
|
||||
/// solidcore passes every case SMLib passed ([`GSI_1E6_PASS`]). The self-crossing
|
||||
/// curves it missed (Viviani's figure eight, the crossing loops) are split at their crossings
|
||||
/// since solidcore's `ssi_split_curves_at_singular_points` (tangency-labs/solidcore#2110).
|
||||
|
||||
Reference in New Issue
Block a user