Repository navigation
Contour grid points from the root origin and a global index so split render jobs share seam vertices - #459
Open
dylanoliverdo-coder wants to merge 1 commit into
Conversation
Split render jobs computed the points on their shared planes from differently accumulated offsets, which can differ in the last bit. On a surface that lies on a bisection midpoint this moves the vertex by one bisection step (1/128 of a cell) on one side of the seam only, leaving the mesh open along the plane. Each grid now carries the root origin and its integer index, and every point is computed as origin + resolution * (index + i), so both jobs get the same vertex.
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.
When the surface grid is split into render jobs, two neighbouring jobs can compute the plane they share by different floating-point sums:
(origin + a*res) + b*resin one job andorigin + (a+b)*resin the other. These can differ in the last bits (for example x = 35.0 against x = 34.999999999999996 on a 70 mm block at 0.3 mm).FieldFunction::linearIntersectbisects each edge 8 times. Where a cut wall crosses the seam edges exactly at a bisection midpoint (a 45° cone wall does this), the tool's inside test cancels to about zero and rounding decides the branch. The two jobs then take different branches, their seam vertices land 1/128 of a cell apart on one side only, and the exported mesh is open along the seam.Fix: each
Gridcarries the root origin and its integer index.CubeSlice,VertexSliceandSliceContourGeneratorcompute every point asorigin + resolution * (index + i), andsplit,sliceandGridTreeRefpass the origin and index on. Both jobs now bisect the same edge between bit-identical endpoints.offsetis kept equal to the grid's first point, so other users ofgetOffset()are unchanged.Repro: a 70 x 20 x 10 mm block at 0.3 mm resolution, a 90° V tool, and 12 grooves along X with non-round endpoints, run with
camsim --threads 1 --binary --reduce=false. Counting edges with corners merged by exact coordinate:Tests: the
tests/testHarnessgcodetool suites (oCodeTests, offsetTests, varRefTests) pass 15 of 15 on master and on this branch. Built with scons,with_gui=0 with_tpl=0, MSVC 14.38.Repro job (vgroove3.camotics and vgroove3.nc)
{ "units": "metric", "resolution-mode": "manual", "resolution": 0.3, "tools": { "1": { "units": "metric", "shape": "conical", "length": 3, "diameter": 6, "description": "" } }, "workpiece": { "automatic": false, "margin": 0, "bounds": { "min": [ 0.0, 0.0, -10.0 ], "max": [ 70.0, 20.0, 0.0 ] } }, "files": [ "vgroove3.nc" ] }🤖 Generated with Claude Code