Built-in Modifiers

A collection of functions for modifying geometry. These are the code equivalents of the modifiers available in the editor. Parameters are optional, and the defaults are shown in the code examples.

Functions

AddHole(parameters,input)Geometry
AddHole({
  holePlacement: 0,
  holeSize: 0.19,
  holeThickness: 0.10,
  style: "outer",
  includeHole: true,
}, input)
  • holePlacement (Angle)

  • holeSize (Distance)

  • holeThickness (Distance)

  • style ("outer" | "inner")

  • includeHole (boolean) – This is just a convenient way to turn on and off adding the hole.

parameters
object
input
Attach(parameters,input)Geometry
Attach({
  direction: "closest",
  extraDistance: 0.05,
  keepBase: true,
}, input)
  • direction ("closest" | "horizontal" | "vertical")

  • extraDistance (Distance) – Shapes will be moved until just touching, and then by this amount extra

  • keepBase (boolean)

Learn more

parameters
object
input
BooleanDifference(parameters,input)Geometry
BooleanDifference({}, input)
parameters
object
input
BooleanIntersect(parameters,input)Geometry
BooleanIntersect({}, input)
parameters
object
input
BooleanUnion(parameters,input)Geometry
BooleanUnion({}, input)
parameters
object
input
Contract(parameters,input)Geometry
Contract({
  distance: 0.1,
  miterLimit: 4,
  join: "round",
  holes: "include",
}, input)
  • distance (Distance)

  • miterLimit (number)

  • join ("miter" | "round" | "bevel")

  • holes ("include" | "ignore" | "remove")

parameters
object
input
DashedLines(parameters,input)Geometry
DashedLines({
  dashLength: 0.1,
  offset: 0.0,
}, input)
  • dashLength (Distance) – Length of dashes and gaps along the path. To make a pattern with different dash and gap lengths use an array expression, for example: [0.2, 0.1]

  • offset (Distance) – Offsets the start of the dash pattern.

parameters
object
input
Expand(parameters,input)Geometry
Expand({
  distance: 0.1,
  miterLimit: 4,
  join: "round",
  holes: "include",
}, input)
  • distance (Distance) – For kerf compensation, set distance to half the kerf width.

  • miterLimit (number)

  • join ("miter" | "round" | "bevel")

  • holes ("include" | "ignore" | "remove")

parameters
object
input
FitWithin(parameters,input)Geometry
FitWithin({
  position: Vec(),
  scale: 1,
  keepContainer: true,
}, input)
  • position (Vec)

  • scale (Percentage)

  • keepContainer (boolean)

parameters
object
input
Flatten(parameters,input)Geometry
Flatten({
  backgroundColor: Color(1, 1, 1, 1),
  strokeResult: false,
  distribute: false,
}, input)
  • backgroundColor (Color) – Anything filled with this color will be subtracted out of your result.

  • strokeResult (boolean) – Replaces all fills with strokes in the result.

  • distribute (boolean) – Spaces out each colored layer separately.

Learn more

parameters
object
input
LayeredStack(parameters,input)Geometry
LayeredStack({
  backgroundColor: Color(1, 1, 1, 1),
  strokeResult: false,
  distribute: false,
}, input)
  • backgroundColor (Color)

  • strokeResult (boolean) – Replaces all fills with strokes in the result.

  • distribute (boolean) – Spaces out each colored layer separately.

parameters
object
input
LinearRepeat(parameters,input)Geometry
LinearRepeat({
  displacement: Vec(1, 0),
  repetitions: 6,
  alignment: "start",
}, input)
  • displacement (Vec)

  • repetitions (Integer)

  • alignment ("start" | "center")

parameters
object
input
Mask(parameters,input)Geometry

The top-most shape serves as the mask. Everything else is clipped so that only the portions within the mask remain.

Mask({
  invertMask: false,
  keepMask: false,
}, input)
  • invertMask (boolean) – When checked, only the contents outside the mask will be kept.

  • keepMask (boolean) – When checked, the masking shape will be kept.

Learn more

parameters
object
input
MergePaths(parameters,input)Geometry
MergePaths({}, input)
parameters
object
input
MirrorRepeat(parameters,input)Geometry
MirrorRepeat({
  point1: Vec(0, 0),
  point2: Vec(0, 1),
  reverse: false,
}, input)
  • point1 (Vec)

  • point2 (Vec)

  • reverse (boolean) – Use this to reverse the order of the points in the path.

parameters
object
input
OutlineStroke(parameters,input)Geometry
OutlineStroke({
  width: 0.1,
  alignment: "centered",
  miterLimit: 4,
  join: "round",
  cap: "round",
}, input)
  • width (Distance)

  • alignment ("centered" | "inner" | "outer")

  • miterLimit (number)

  • join ("miter" | "round" | "bevel")

  • cap ("butt" | "round" | "square")

parameters
object
input
RemoveHoles(parameters,input)Geometry
RemoveHoles({}, input)
parameters
object
input
RemoveOverlaps(parameters,input)Geometry
RemoveOverlaps({
  tolerance: 0.001,
  overlapColor: "none",
  mergePaths: true,
}, input)
  • tolerance (number) – Overlaps that are within this distance will be removed.

  • overlapColor (Color) – Optionally re-color all overlapping segments with this color. Choose “none” if you don’t want to use this feature.

  • mergePaths (boolean)

parameters
object
input
RotationalRepeat(parameters,input)Geometry
RotationalRepeat({
  center: Vec(),
  repetitions: 6,
  endAngle: 360,
  includeEnd: false,
}, input)
  • center (Vec)

  • repetitions (Integer)

  • endAngle (Angle) – Set this lower than 360° to repeat partially around the center point.

  • includeEnd (boolean) – Turn this on to include a repetition at the endAngle. You usually want this off if endAngle is 360°.

parameters
object
input
RoundCorners(parameters,input)Geometry
RoundCorners({
  radius: 0.25,
}, input)
  • radius (Distance)
parameters
object
input
SplitText(parameters,input)Geometry
SplitText({
  text: "SPLIT",
  font: Font("https://fonts.gstatic.com/s/literata/v39/or3PQ6P12-iJxAIgLa78DkrbXsDgk0oVDaDPYLanFLHpPf2TbBG_F_bcTWCWp8g.ttf", {capitalize: "uppercase", connect: "dots"}),
  align: "center",
  welding: "everything and remove extra",
  bars: "both",
  barWidth: "box",
  barHeight: 0.15,
  overlap: 0.02,
}, input)
  • text (RichText | string)

  • font (Font | font url string)

  • align ("left" | "center" | "right")

  • welding ("none" | "everything" | "everything and remove extra")

  • bars ("underline" | "overline" | "both")

  • barWidth ("box" | "text")

  • barHeight (Distance)

  • overlap (Percentage)

parameters
object
input
TextAlongPath(parameters,input)Geometry
TextAlongPath({
  text: "Text Along Path",
  font: "https://fonts.gstatic.com/s/notosans/v39/o-0mIpQlx3QUlC5A4PNB6Ryti20_6n1iPHjcz6L1SoM-jCpoiyD9A99d41P6zHtY.ttf",
  size: 1,
  align: "center",
  verticalAlign: "middle",
  offset: 0,
  verticalOffset: 0,
  welding: "none",
  fit: "grow",
  multipleLines: "one line per path",
  flip: "none",
  transform: "rigid",
}, input)
  • text (RichText | string)

  • font (Font | font url string)

  • size (Distance)

  • align ("start" | "center" | "end")

  • verticalAlign ("top" | "middle" | "baseline" | "bottom")

  • offset (Percentage)

  • verticalOffset (Percentage)

  • welding ("everything" | "letters" | "none")

  • fit ("none" | "shrink" | "scale" | "grow")

    • none: Uses the "size" parameter for scaling.

    • shrink: Uses the size parameter, but if the text is too long this will shrink the text to fit on the path.

    • scale: Fits text to the path exactly. Overrides the "size" and "align" parameters.

    • grow: Ignores the text's metrics and grows the text to be as large as possible while fitting within the path length and the "size" parameter.

  • multipleLines ("one line per path" | "lines evenly spaced")

    • one line per path: Each line of text is placed on its own path.

    • lines evenly spaced: All lines of text are placed on every path, with even spacing between each line.

  • flip ("none" | "all" | "auto")

    • none: Default direction along path.

    • all: Reverse direction along path.

    • auto: Flip each text item to be right-side-up, for example at the bottom of a circle.

  • transform ("rigid" | "warped")

    • rigid: Rotates each individual letter to align with the path direction. Works best with print fonts.

    • warped: Warps the letters to flow along the path. This distorts letters but preserves connections. Works best with connected text, handwriting, and bubbly fonts.

Learn more

parameters
object
input
TextWithinBox(parameters,input)Geometry
TextWithinBox({
  text: "Text",
  font: "https://fonts.gstatic.com/s/notosans/v39/o-0mIpQlx3QUlC5A4PNB6Ryti20_6n1iPHjcz6L1SoM-jCpoiyD9A99d41P6zHtY.ttf",
  align: "center",
  verticalAlign: "middle",
  scaling: "grow",
  welding: "none",
}, input)
  • text (RichText | string)

  • font (Font | font url string)

  • align ("left" | "center" | "right")

  • verticalAlign ("top" | "middle" | "bottom")

  • scaling ("shrink" | "metrics" | "grow")

    metrics - will size using the font’s metrics

    shrink - will size using the font's metrics but then shrink if necessary to force text to always lie strictly within the box, even if the font has characters that overhang their boundaries (some script fonts)

    grow - will ignore font's metrics and grow the text to be as large as possible so that it’s still fitting within the box.

  • welding ("everything" | "letters" | "none")

Learn more

parameters
object
input
TileRepeat(parameters,input)Geometry
TileRepeat({
  displacement1: Vec(1, 0),
  displacement2: Vec(0, 1),
  repetitions1: 4,
  repetitions2: 4,
  alignment: "start",
  zigzag: false,
}, input)
  • displacement1 (Vec)

  • displacement2 (Vec)

  • repetitions1 (Integer)

  • repetitions2 (Integer)

  • alignment ("start" | "center")

  • zigzag (boolean)

parameters
object
input
TransformRepeat(parameters,input)Geometry
TransformRepeat({
  repetitions: 6,
  position: Vec(1, 0),
  rotation: 0,
  scale: Vec(1),
  skew: 0,
  origin: Vec(0, 0),
  scaleStroke: 1,
}, input)
  • repetitions (Integer)

  • position (Vec)

  • rotation (Angle)

  • scale (Vec | number)

  • skew (Angle)

  • origin (Vec)

  • scaleStroke (Distance)

parameters
object
input
Visible(parameters,input)Geometry
Visible({
  visible: true,
}, input)
  • visible (boolean)

Learn more

parameters
object
input
WarpCoordinates(parameters,input)Geometry
const wavelength = Vec(1.00, 1.00);
const amplitude = Vec(0.10, 0.10);
return WarpCoordinates({
  mapping: (p) => {
    const frequency = 360 / wavelength;
    const displacement = Vec(
      sin(p.y * frequency.y),
      sin(p.x * frequency.x)
    );
    return p + amplitude * displacement;
  },
  tolerance: 0.001,
}, input)
  • tolerance (number)
parameters
object
input
WarpedText(parameters,input)Geometry
WarpedText({
  text: "Warp",
  font: "https://fonts.gstatic.com/s/notosans/v39/o-0mIpQlx3QUlC5A4PNB6Ryti20_6n1iPHjcz6L1SoM-jCpoiyD9A99d41P6zHtY.ttf",
  align: "center",
  verticalAlign: "middle",
  welding: "none",
  scaling: "grow",
  orientation: "upright",
  parameterization: "distance",
}, input)
  • text (RichText | string)

  • font (Font | font url string)

  • align ("left" | "center" | "right" | "stretch left" | "stretch center" | "stretch right")

  • verticalAlign ("top" | "middle" | "bottom" | "stretch")

  • welding ("everything" | "letters" | "none")

  • scaling ("grow" | "metrics")

    grow - Will make the text as large as possible to fit within the warped box.

    metrics - Will size the text using the font’s metrics (allows the use of spaces).

  • orientation ("upright" | "fixed")

    upright - Will automatically orient your text so it’s always right side up.

    fixed - Will use the ordering of your anchor points to orient the text. This lets you rotate or flip the warp envelope and your text will follow.

  • parameterization ("distance" | "time")

    distance - Uses distance along edges and results in a more uniform scaling. Usually looks best.

    time - Uses time along edges. Results in variable scaling.

Learn more

parameters
object
input
WeldAndScore(parameters,input)Geometry
WeldAndScore({
  scoreColor: Color(0, 0, 1, 1),
  engraveColor: Color(0, 0, 0, 1),
}, input)
  • scoreColor (Color)

  • engraveColor (Color)

Learn more

parameters
object
input