Skip to content

Commit

Permalink
Update examples in appearance.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchalmers committed Dec 17, 2024
1 parent 1dd003d commit 5f6057f
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions src/wasm-lib/kcl/src/std/appearance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// // Add color to an extruded solid.
/// exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> lineTo([10, 0], %)
/// |> lineTo([0, 10], %)
/// |> lineTo([-10, 0], %)
/// |> close(%)
/// |> line(end = [10, 0])
/// |> line(end = [0, 10])
/// |> line(end = [-10, 0])
/// |> close()
///
/// example = extrude(5, exampleSketch)
/// example = extrude(exampleSketch, length = 5)
/// |> appearance({color= '#ff0000', metalness= 50, roughness= 50}, %)
/// ```
///
Expand All @@ -94,11 +94,11 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// fn cube(center) {
/// return startSketchOn('XY')
/// |> startProfileAt([center[0] - 10, center[1] - 10], %)
/// |> lineTo([center[0] + 10, center[1] - 10], %)
/// |> lineTo([center[0] + 10, center[1] + 10], %)
/// |> lineTo([center[0] - 10, center[1] + 10], %)
/// |> line(end = [center[0] + 10, center[1] - 10])
/// |> line(end = [center[0] + 10, center[1] + 10])
/// |> line(end = [center[0] - 10, center[1] + 10])
/// |> close(%)
/// |> extrude(10, %)
/// |> extrude(length = 10)
/// }
///
/// example0 = cube([0, 0])
Expand All @@ -114,11 +114,11 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// // This example shows setting the appearance _after_ the shell.
/// firstSketch = startSketchOn('XY')
/// |> startProfileAt([-12, 12], %)
/// |> line([24, 0], %)
/// |> line([0, -24], %)
/// |> line([-24, 0], %)
/// |> close(%)
/// |> extrude(6, %)
/// |> line(to = [24, 0])
/// |> line(to = [0, -24])
/// |> line(to = [-24, 0])
/// |> close()
/// |> extrude(length = 6)
///
/// shell({
/// faces = ['end'],
Expand All @@ -136,11 +136,11 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// // This example shows setting the appearance _before_ the shell.
/// firstSketch = startSketchOn('XY')
/// |> startProfileAt([-12, 12], %)
/// |> line([24, 0], %)
/// |> line([0, -24], %)
/// |> line([-24, 0], %)
/// |> close(%)
/// |> extrude(6, %)
/// |> line(to = [24, 0])
/// |> line(to = [0, -24])
/// |> line(to = [-24, 0])
/// |> close()
/// |> extrude(length = 6)
/// |> appearance({
/// color = '#ff0000',
/// metalness = 90,
Expand All @@ -158,12 +158,12 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// // This example shows _before_ the pattern.
/// exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line([0, 2], %)
/// |> line([3, 1], %)
/// |> line([0, -4], %)
/// |> close(%)
/// |> line(to = [0, 2])
/// |> line(to = [3, 1])
/// |> line(to = [0, -4])
/// |> close()
///
/// example = extrude(1, exampleSketch)
/// example = extrude(exampleSketch, length = 1)
/// |> appearance({
/// color = '#ff0000',
/// metalness = 90,
Expand All @@ -181,12 +181,12 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// // This example shows _after_ the pattern.
/// exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line([0, 2], %)
/// |> line([3, 1], %)
/// |> line([0, -4], %)
/// |> close(%)
/// |> line(to = [0, 2])
/// |> line(to = [3, 1])
/// |> line(to = [0, -4])
/// |> close()
///
/// example = extrude(1, exampleSketch)
/// example = extrude(exampleSketch, length = 1)
/// |> patternLinear3d({
/// axis = [1, 0, 1],
/// instances = 7,
Expand All @@ -203,18 +203,18 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// // Color the result of a 2D pattern that was extruded.
/// exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([.5, 25], %)
/// |> line([0, 5], %)
/// |> line([-1, 0], %)
/// |> line([0, -5], %)
/// |> close(%)
/// |> line(to = [0, 5])
/// |> line(to = [-1, 0])
/// |> line(to = [0, -5])
/// |> close()
/// |> patternCircular2d({
/// center = [0, 0],
/// instances = 13,
/// arcDegrees = 360,
/// rotateDuplicates = true
/// }, %)
///
/// example = extrude(1, exampleSketch)
/// example = extrude(exampleSketch, length = 1)
/// |> appearance({
/// color = '#ff0000',
/// metalness = 90,
Expand All @@ -228,17 +228,17 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// // Create a path for the sweep.
/// sweepPath = startSketchOn('XZ')
/// |> startProfileAt([0.05, 0.05], %)
/// |> line([0, 7], %)
/// |> line(to = [0, 7])
/// |> tangentialArc({
/// offset: 90,
/// radius: 5
/// }, %)
/// |> line([-3, 0], %)
/// |> line(to = [-3, 0])
/// |> tangentialArc({
/// offset: -90,
/// radius: 5
/// }, %)
/// |> line([0, 7], %)
/// |> line(to = [0, 7])
///
/// pipeHole = startSketchOn('XY')
/// |> circle({
Expand Down

0 comments on commit 5f6057f

Please sign in to comment.