* Get libslic3r tests closer to passing

I can't get geometry tests to do anything useful. I've added extra
output, but it hasn't helped me figure out why they don't work
yet. That's also probably the last broken 3mf test doesn't work.

The config tests were mostly broken because of config name changes.

The placeholder_parser tests have some things that may-or-may-not
still apply to Orca.

* Vendor a 3.x version of Catch2

Everything is surely broken at this point.

* Allow building tests separately from Orca with build_linux.sh

* Remove unnecessary log message screwing up ctest

Same solution as Prusaslicer

* Make 2 TriangleMesh methods const

Since they can be.

* Move method comment to the header where it belongsc

* Add indirectly-included header directly

Transform3d IIRC

* libslic3r tests converted to Catch2 v3

Still has 3 failing tests, but builds and runs.

* Disable 2D convex hull test and comment what I've learned

Not sure the best way to solve this yet.

* Add diff compare method for DynamicConfig

Help the unit test report errors better.

* Perl no longer used, remove comment line

* Clang-format Config.?pp

So difficult to work with ATM

* Remove cpp17 unit tests

Who gives a shit

* Don't need explicit "example" test

We have lots of tests to serve as examples.

* Leave breadcrumb to enable sla_print tests

* Fix serialization of DynamicConfig

Add comments to test, because these code paths might not be even used
anymore.

* Update run_unit_tests to run all the tests

By the time I'm done with the PR all tests will either excluded by
default or passing, so just do all.

* Update how-to-test now that build_linux.sh builds tests separately

* Update cmake regenerate instructions

Read this online; hopefully works.

* Enable slic3rutils test with Catch2 v3

* Port libnest2d and fff_print to Catch2 v3

They build. Many failing.

* Add slightly more info to Objects not fit on bed exception

* Disable failing fff_print tests from running

They're mostly failing for "objects don't fit on bed" for an
infinite-sized bed. Given infinite bed is probably only used in tests,
it probably was incidentally broken long ago.

* Must checkout tests directory in GH Actions

So we get the test data

* Missed a failing fff_print test

* Disable (most/all) broken libnest2d tests

Trying all, not checking yet though

* Fix Polygon convex/concave detection tests

Document the implementation too. Reorganize the tests to be cleaner.

* Update the test script to run tests in parallel

* Get sla_print tests to build

Probably not passing

* Don't cause full project rebuild when updating test CMakeLists.txts

* Revert "Clang-format Config.?pp"

This reverts commit 771e4c0ad2fdbaa26a8fee77030650afacdc5083.

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
coryrc
2025-12-08 06:42:11 -08:00
committed by GitHub
parent 680735361b
commit 4dee32429f
388 changed files with 59565 additions and 19524 deletions

View File

@@ -647,7 +647,6 @@ ModelMaterial* Model::add_material(t_model_material_id material_id, const ModelM
return material;
}
// makes sure all objects have at least one instance
bool Model::add_default_instances()
{
// apply a default position to all objects not having one
@@ -1641,17 +1640,31 @@ Polygon ModelObject::convex_hull_2d(const Transform3d& trafo_instance) const
Points pts;
for (const ModelVolume* v : volumes) {
if (v->is_model_part())
if (v->is_model_part()) {
//BBS: use convex hull vertex instead of all
append(pts, its_convex_hull_2d_above(v->get_convex_hull().its, (trafo_instance * v->get_matrix()).cast<float>(), 0.0f).points);
// The next commented line instead of the previous + the rest of this #if0 section is the same as PrusaSlicer until https://github.com/prusa3d/PrusaSlicer/commit/2f7f3578d531f2d34f7732a64449606d86bb4aaa where it was parallelised.
//append(pts, its_convex_hull_2d_above(v->mesh().its, (trafo_instance * v->get_matrix()).cast<float>(), 0.0f).points);
// its_convex_hull_2d_above calls its_collect_mesh_projection_points_above
// The latter multiplies each vertex by the full matrix
// For every vector which crosses the Z plane, the intersection is used instead of any point below. Consecutive points below the Z plane are ignored.
}
}
return Geometry::convex_hull(std::move(pts));
#else
// This seems to differ from PrusaSlicer (and the old code above) in that
// points below the Z plane aren't treated specially.
Points pts;
for (const ModelVolume *v : this->volumes)
if (v->is_model_part()) {
const Polygon& volume_hull = v->get_convex_hull_2d(trafo_instance);
// In comparison to the old code above, get_convex_hull_2d starts with:
// new_matrix = trafo_instance * m_transformation.get_matrix();
// which is the same matrix multiplication as above.
// Then checks caches, maybe calling ModelVolume::calculate_convex_hull_2d(const Geometry::Transformation &) if no hit
// That method accesses v->get_convex_hull().its (also used above).
// It multiplies each point by the matrix w/o translate, then calls convex_hull(pts)
// Then translates polygon in X & Y
pts.insert(pts.end(), volume_hull.points.begin(), volume_hull.points.end());
}