Repository navigation
feat(booleans): subtract a slanted planar cutter from arc-edged extrusions, with exact ellipse ends - #59
Merged
Conversation
Half-round, full-round and ogee extrusions and a primitive cylinder lying on their side, cut by a slanted cuboid or parallelogram prism at 30, 45 and 60 degrees in plan, and two gutters mitred on a corner bisector, singly and as a two-cutter batch. Each result must be closed and valid, keep its cylinder faces analytic and carry an exact ellipse trim. Today every case is a coverage gap.
A planar cutter that crosses an extrusion of lines and arcs at an angle to its axis fell through every handler as a coverage gap, so gutters and rods could not be mitred. The new handler reads the host as a straight prism from its two caps, finds the one convex-cutter face that crosses every generator strictly between the caps while the cutter holds all of the removed end, and rebuilds the prism with that face as its new cap: cylinder sides stay analytic and each arc gets an exact ellipse trim. A batch of such cutters replaces one cap per cutter, so a gutter mitred at both ends is one result. It sits right after the vertical arc-extrusion handler, so the stored half-space ring case (a cube with a round bore under the section clipper) now takes this handler instead of prismatic_curved_boolean, with the same eight faces, a valid solid and the same half volume. Every other change to recorded results is the new name in attempt lists: the half-space torus and revolved-bowl outcomes, the rail-minus-wall gap in the acceptance session, and the golden handler coverage lists.
Drawings take the cut end from the B-rep's ellipse edges, so the end face itself must be bounded by ellipse arcs that lie on both the bisector plane and the gutter cylinders and cover the whole half-round. Red on the code before the half-space handler (a coverage gap), green after.
A slanted cuboid minus a rod must keep a blind round hole with an ellipse rim, a slanted slab minus a rod a through hole with two rims, and a slanted prism minus a half-round gutter a gutter-shaped pocket, each valid and closed with analytic cylinder walls and the right removed volume. Today each is a coverage gap. The tilted cuboid minus cylinder case leaves the coverage-gap test, which now holds only for their union.
The reverse order of the half-space cut, a cuboid or prism minus a rod or gutter lying across one of its faces at a slant, was still a coverage gap. The prism model is trimmed by every face of the convex host it crosses cleanly, until each remaining face holds the trimmed piece inside it. The host is then copied with the trimmed piece's ends as holes in the faces it enters through. The piece's walls are reversed into the host, and an end of the rod that stays inside becomes the floor of a blind hole. Rims are exact ellipses and walls stay analytic cylinders. Holes square to the axis are left to the existing handlers, and so is a face that also cuts the rod's end discs. It shares the half-space handler's dispatch entry, so no attempt list moves. The golden cylinder-box oblique-20 and oblique-45 reversed subtractions, recorded as coverage gaps, now return a nine-face result; oblique-70 stays a gap because that face reaches past both ends of the cylinder.
…c-extrusions # Conflicts: # main/opengeometry/src/operations/modifying/boolean/dispatch/table.rs # main/opengeometry/tests/fixtures/golden/aarch64-apple-darwin.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Solid.operate(OG_OPERATION_SUBTRACT, { tools })now subtracts a slanted planar cutter from an extrusion whose profile has arcs (handlersubtract_half_space_from_arc_extrusion):OG_PRIMITIVE_CYLINDER.Ellipseedges on the B-rep), and the cylinder faces stayCylinder.tools: [mitre0, mitre1].Conditions
CoverageGap, as before.Why
Floorkit draws two gutters that meet at a roof corner with a mitre on the corner bisector. Before this change, the cut failed with
CoverageGap {generic analytic solid, intersecting analytic solid}.Tests
6270c65,e6ea670,cca6793), then the implementations.cargo test945 passed, 1 ignored, 0 failed; kernel node tests 319 of 319.Note
This PR and #58 both start from
main. They conflict inboolean/dispatch/table.rsand in the golden fixturetests/fixtures/golden/aarch64-apple-darwin.json. The second one to merge needs those two files resolved and the golden fixture regenerated.