boolean
boolean()
Performs a boolean operation on the paths produced by two CeTZ bodies. The supported operations are "union", "intersection", "difference", and "xor".
Each operand can either be one or more type:elements or the name of an already-defined element (a string).
All input subpaths must be closed and lie in a single z-plane. The output is a single path drawable in the z-plane of the first input.
Each operand has its own fill-rule, which decides how its self-overlapping or nested subpaths are interpreted as a filled region before the boolean operation runs. By default (auto) the fill-rule is inferred from the operand: if every path drawable produced by the body agrees on one fill-rule (e.g. the body is a single compound-path(..., fill-rule:), that value is used; otherwise it falls back to
"even-odd")boolean’s own resolved style.
boolean(
{ rect((-1, -1), (1, 0)) },
{ circle((0, 0), radius: 0.8) },
op: "difference",
fill: blue,
)
rect((-1, -1), (1, 0), name: "r")
circle((0, 0), radius: 0.8, name: "c")
boolean("r", "c", op: "difference", fill: blue)
"non-zero" or "even-odd", applied to a. If auto, inferred from a’s drawables
"non-zero" or "even-odd", applied to b. If auto, inferred from b’s drawables