Files
modeling-app/docs/kcl/mirror2d.md
Jess Frazelle 790af3842c Recusive docs (#4023)
updates



updates



updates



updates



updates



updates



better



updates



array of



updates



updates



updates



updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-09-27 19:50:44 -07:00

293 KiB

title, excerpt, layout
title excerpt layout
mirror2d Mirror a sketch. manual

Mirror a sketch.

Only works on unclosed sketches for now. Mirror occurs around a local sketch axis rather than a global axis.

mirror2d(data: Mirror2dData, sketch_set: SketchSet) -> [Sketch]

Arguments

Name Type Description Required
data Mirror2dData Data for a mirror. Yes
sketch_set SketchSet A sketch or a group of sketches. Yes

Returns

[Sketch]

Examples

// Mirror an un-closed sketch across the Y axis.
const sketch001 = startSketchOn('XZ')
  |> startProfileAt([0, 10], %)
  |> line([15, 0], %)
  |> line([-7, -3], %)
  |> line([9, -1], %)
  |> line([-8, -5], %)
  |> line([9, -3], %)
  |> line([-8, -3], %)
  |> line([9, -1], %)
  |> line([-19, -0], %)
  |> mirror2d({ axis: 'Y' }, %)

const example = extrude(10, sketch001)

Rendered example of mirror2d 0

// Mirror a un-closed sketch across the Y axis.
const sketch001 = startSketchOn('XZ')
  |> startProfileAt([0, 8.5], %)
  |> line([20, -8.5], %)
  |> line([-20, -8.5], %)
  |> mirror2d({ axis: 'Y' }, %)

const example = extrude(10, sketch001)

Rendered example of mirror2d 1

// Mirror a un-closed sketch across an edge.
const helper001 = startSketchOn('XZ')
  |> startProfileAt([0, 0], %)
  |> line([0, 10], %, $edge001)

const sketch001 = startSketchOn('XZ')
  |> startProfileAt([0, 8.5], %)
  |> line([20, -8.5], %)
  |> line([-20, -8.5], %)
  |> mirror2d({ axis: edge001 }, %)

const example = extrude(10, sketch001)

Rendered example of mirror2d 2

// Mirror an un-closed sketch across a custom axis.
const sketch001 = startSketchOn('XZ')
  |> startProfileAt([0, 8.5], %)
  |> line([20, -8.5], %)
  |> line([-20, -8.5], %)
  |> mirror2d({
       axis: {
         custom: { axis: [0.0, 1.0], origin: [0.0, 0.0] }
       }
     }, %)

const example = extrude(10, sketch001)

Rendered example of mirror2d 3