Skip to content

Fix failing tests after three-mesh-bvh upgrade to ^0.9.9#174

Merged
jgphilpott merged 4 commits intomainfrom
copilot/fix-failing-tests-after-update
Mar 4, 2026
Merged

Fix failing tests after three-mesh-bvh upgrade to ^0.9.9#174
jgphilpott merged 4 commits intomainfrom
copilot/fix-failing-tests-after-update

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

three-mesh-bvh@0.9.9 introduced ObjectBVH extends BVH where BVH is self-imported from the same package. In the UMD/CJS build this circular reference resolves to undefined at evaluation time, crashing the entire module load — which cascades to break three-bvh-csg.

Changes

  • src/slicer/slice.test.coffee — Removed three-bvh-csg from both Wall Print Order with Holes tests; replaced CSG box-minus-cylinders geometry with native three.js THREE.Shape + THREE.ExtrudeGeometry. Extracted a shared buildSheetWithHolesMesh() helper with named constants (SHEET_SIZE, THICKNESS, GRID_SIZE, HOLE_RADIUS) to eliminate duplication. Fixed absarc clockwise flag to false for robust full-circle arc generation.

  • src/slicer/walls/walls.test.coffee — Removed three-bvh-csg from both Travel Path Combing tests; replaced CSG box-minus-cylinder(s) geometry with native three.js THREE.Shape + THREE.ExtrudeGeometry. Extracted a shared buildSheetWithHolesMesh(holePositions) helper with named constants (SHEET_W, DEPTH, HOLE_RADIUS) and removed the try/catch guard and console.warn fallback that was silently skipping these tests when the package was unavailable.

The resulting geometries are equivalent — a thin rectangular sheet with through-holes — constructed entirely without CSG. No three-bvh-csg references remain in the test suite.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing tests after updating three-mesh-bvh Fix failing tests after three-mesh-bvh upgrade to ^0.9.9 Mar 4, 2026
@jgphilpott jgphilpott marked this pull request as ready for review March 4, 2026 05:49
Copilot AI review requested due to automatic review settings March 4, 2026 05:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates slicer tests to avoid three-bvh-csg (currently broken due to a three-mesh-bvh@0.9.9 circular reference issue in some builds) by rebuilding the “sheet with holes” test geometry using native three.js Shape + ExtrudeGeometry.

Changes:

  • Replaced CSG-based “box minus cylinders” geometry generation with THREE.Shape + circular hole paths and THREE.ExtrudeGeometry.
  • Removed test-only console.warn suppression that was specific to three-bvh-csg warnings.

@jgphilpott
Copy link
Owner

@copilot apply changes based on the comments in this thread

Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 4, 2026

@copilot apply changes based on the comments in this thread

Done in 20d1607:

  • Extracted a buildSheetWithHolesMesh helper with named constants (SHEET_SIZE, THICKNESS, GRID_SIZE, HOLE_RADIUS) at the top of the describe block, eliminating the duplication.
  • Fixed the absarc clockwise flag from true to false in the helper, matching the convention used in concentric.test.coffee.

@jgphilpott
Copy link
Owner

@copilot I am still seeing some console warnings:

 ● Console

    console.warn
      three-bvh-csg not available, skipping combing test

      409 |       } catch (error1) {
      410 |         error = error1;
    > 411 |         console.warn('three-bvh-csg not available, skipping combing test');
          |                 ^
      412 |         return;
      413 |       }
      414 |       // Suppress MeshBVH deprecation warnings from three-bvh-csg.

      at Object.<anonymous> (src/slicer/walls/walls.test.js:411:17)

    console.warn
      three-bvh-csg not available, skipping combing test

      455 |       } catch (error1) {
      456 |         error = error1;
    > 457 |         console.warn('three-bvh-csg not available, skipping combing test');
          |                 ^
      458 |         return;
      459 |       }
      460 |       // Suppress MeshBVH deprecation warnings from three-bvh-csg.

      at Object.<anonymous> (src/slicer/walls/walls.test.js:457:17)

Could these either be removed or suppressed please?

…th Combing tests

Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 4, 2026

@copilot I am still seeing some console warnings:

...

Fixed in 934bd30. The warnings were coming from two more tests in walls.test.coffee (Travel Path Combing describe block) that still used three-bvh-csg with a try/catch guard. Both tests have been rewritten using the same THREE.Shape + THREE.ExtrudeGeometry approach, with a shared buildSheetWithHolesMesh(holePositions) helper and named constants (SHEET_W, DEPTH, HOLE_RADIUS). No three-bvh-csg references remain anywhere in the test suite.

@jgphilpott jgphilpott merged commit 5531a8c into main Mar 4, 2026
1 check passed
@jgphilpott jgphilpott deleted the copilot/fix-failing-tests-after-update branch March 4, 2026 06:11
Copilot AI mentioned this pull request Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants