Skip to main content

Module test_fixtures

Module test_fixtures 

Source
Expand description

Test fixture — this crate’s tests, and others’ with the testing feature: a plain axis-aligned unit-cube-shaped solid, described whole and built at once (see crate::build).

This crate sits below geop-lib-sweep in the workspace’s dependency order (that crate is what actually builds shapes like a real cube_solid via extrude), so validation/edit tests here that just need “some realistic populated Model” to run structural or numerical checks against can’t reach for it — a dev-dependency back on geop-lib-sweep would make Cargo compile this crate twice (once under #[cfg(test)], once as that crate’s plain library dependency), and the two copies’ Model types don’t unify, which surfaces as expected Model, found Model at every call site. This is a small, self-contained stand-in scoped to exactly what these tests need: six planar faces, twelve shared edges, eight shared vertices — no extrude generality (arbitrary footprints, holes) required.

Functions§

check_errors
The errors check finds in model, under the default parameters.
line2
The straight pcurve from (u, v) a to b, over [0, 1].
line3
The straight line from a to b, over [0, 1].
test_cube_model
A new model holding only test_cube_solid.
test_cube_solid
Build model’s unit cube (corners at 0/1 on every axis) and return its SolidId. Every face is a flat, degree-1 bilinear patch; every edge a straight degree-1 line — plenty for the structural/numerical checks these tests actually exercise.

Type Aliases§

Check
One check of crate::validation: it adds what it finds wrong with a model to the errors.