Skip to content

Trim decals between brushes, a clearly defined edge, image turns - #55

Merged
LogicalError merged 12 commits into
RadicalCSG:mainfrom
LogicalError:trim-between-brushes
Oct 24, 2026
Merged

LogicalError merged 12 commits into
RadicalCSG:mainfrom
LogicalError:trim-between-brushes

Conversation

@LogicalError

@LogicalError LogicalError commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Fixes #32. Fixes #53.

Trim decals

  • Place Where Materials Meet also finds edges between two brushes: a wall standing on a floor, seams of brushes side by side (flush, nearly flush, or overlapping with their tops in one plane).
  • The whole edge: a trim between a wall and a floor runs along the wall's whole foot, and its halves draw, like a box decal, on every surface in their range that faces them (within 45°), so a floor half carries on across neighbouring floor brushes.
  • A clearly defined edge: the trim stores which edge it lies on (its number along a surface's outline), set by Pick Edge and Place Where Materials Meet; a trim without one keeps to the line it is on while its decal is on it, so dragging a Single trim along its edge doesn't jump to another seam.
  • Not mirrored: the image reads left to right from its surface, whichever way the line between the surfaces runs.
  • Pick Edge skips surfaces the CSG discarded, and when its probe past the edge misses, takes another brush's drawn surface across the edge before the clicked brush's own (possibly buried) face.
  • Chains round corners (Trim decals round corners (chains): revisit and fix #53): every edge of a chain keeps the edge it was picked on; corners are joined where the edges' lines cross (also where brushes overlap at a corner, so an edge runs past it) and mitred where the two halves lie in one plane, whichever brushes they are on; the image reads one way along the whole chain. Shift-click with Pick Edge adds edges.
  • Dragging: a trim stays on its line while its decal is dragged, however far off it; only picking moves it to another seam.

Decals

  • 90° Left / 90° Right turn the image a quarter turn, on box and trim decals (above UV Scale). A box decal's width, height and repeats swap with it, so the image keeps its shape. In the core: ChiselDecalSettings.imageTurns.
  • The target fields are gone from the inspector.

Tests

New tests for each of the above (seams, overlaps, nearly flush brushes, mirroring, the stored edge, drawn surfaces, image turns); the full suite passes: 2055 of 2055.

A surface of one brush and a surface of another meet when their planes cross on a line along an edge of either, both reach a stretch of it, and each has some of itself in front of the other's plane: a wall standing on a floor, not one sunk into it.
…e Materials Meet across brushes

Rotate turns the selected box decals a quarter turn about the direction they project in. Placing trims where materials meet now also skips edges between two brushes that already have a trim (#32).
When only one of the two surfaces has an edge on the line they meet on (a wall standing on a floor), the trim runs along that whole edge rather than only where the named floor brush reaches. Two surfaces in one plane (brushes side by side) meet on the edge they share, so a trim on such a seam lies flat across it, and Place Where Materials Meet finds those seams.
… trim decals

ChiselDecalSettings.imageTurns turns the image about its middle before uvScale and uvOffset. A box decal's width, height and repeats swap with each turn so the image keeps its shape; on a trim decal what ran along the edge runs across it. The buttons sit above UV Scale.
…es beside a floor brush

A trim's image reads left to right from its surface whichever way the line the surfaces meet on runs. Two faces meet on an edge they share (up to 1 cm apart) before where their planes cross, so brushes that are nearly flush, a step of millimetres or a fraction of a degree, get a trim across their seam; the edge picker accepts the neighbouring surface within 1 cm too. A half that runs past the end of its surface (a wall standing across two floor brushes) also draws on the surfaces in the same plane beside it.
…n their range

Of the edges two surfaces share, or (in one plane) an edge of one running through the other, a trim takes the one nearest to the decal (where its edge was picked), and the next edges of a chain the one nearest to the edge before; an edge that only lies along the other surface's border no longer counts. Like a box decal, each half now draws on every surface in its thin box that faces it (within 45 degrees), so a trim reaches across neighbouring and overlapping brushes; the surfaces beside a half are no longer collected. The test helper that made boxes now makes the boxes it is given.
…s; chaining off for now

A trim decal stores the edge it lies on (its number along a surface's outline), set by Pick Edge and Place Where Materials Meet, so it lies on exactly that edge and follows it; a trim without one keeps to the line it lay on while its decal is on it. Pick Edge skips surfaces the CSG discarded, and when its probe past the edge misses, takes another brush's drawn surface that goes on across the edge before the clicked brush's own face. Chains round corners are off until they are fixed (#53): a trim uses its first edge only and Shift-click no longer adds edges. The target fields are gone from the decal inspector.
Every edge of a chain keeps the edge it was picked on, not only the first; corners are joined within 1 cm and mitred where the two halves lie in one plane, whichever brushes they are on; the image reads one way along the whole chain. Shift-click with Pick Edge adds edges again.
The line a trim lies on wins for as long as its two surfaces still meet on it, however far the decal is dragged off it before it is put back on the edge; only picking moves a trim to another seam. Giving a decal new targets forgets the line.
Edges of a chain that run past a corner (the walls overlapping there) or stop short of it end where their lines cross, when that is within reach of their ends, so the corner is mitred instead of drawn twice.
Edges that overlap at a corner (thick walls overlapping) are always ended where their lines cross; the reach only limits edges that stop short of it.
An edge on the line of an earlier one in the chain that overlaps it (the same surface's edge picked beside two brushes) is drawn once, and Shift-click doesn't add an edge the chain already has. At a corner a half is mitred only with the next edge's half on its own side of the chain (left or right of the way it runs), so on a seam where all four halves lie in one plane the halves across the line no longer overwrite each other's cuts and overlap.
@LogicalError
LogicalError merged commit dd52bf0 into RadicalCSG:main Oct 24, 2026
2 checks passed
@LogicalError
LogicalError deleted the trim-between-brushes branch October 24, 2026 20:04
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.

Trim decals round corners (chains): revisit and fix Trim decals placed where the materials of two brushes meet

1 participant