Add START and END constants to std (#6270)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-04-14 20:37:45 +12:00
committed by GitHub
parent 8f487a441b
commit 7d7b153085
130 changed files with 2741 additions and 2292 deletions

View File

@ -132,7 +132,7 @@ pub async fn appearance(exec_state: &mut ExecState, args: Args) -> Result<KclVal
///
/// shell(
/// firstSketch,
/// faces = ['end'],
/// faces = [END],
/// thickness = 0.25,
/// )
/// |> appearance(
@ -160,7 +160,7 @@ pub async fn appearance(exec_state: &mut ExecState, args: Args) -> Result<KclVal
///
/// shell(
/// firstSketch,
/// faces = ['end'],
/// faces = [END],
/// thickness = 0.25,
/// )
/// ```

View File

@ -828,11 +828,11 @@ pub async fn pattern_linear_3d(exec_state: &mut ExecState, args: Args) -> Result
/// |> close(%)
/// |> extrude(length = 65)
///
/// const thing1 = startSketchOn(case, 'end')
/// const thing1 = startSketchOn(case, END)
/// |> circle(center = [-size / 2, -size / 2], radius = 25)
/// |> extrude(length = 50)
///
/// const thing2 = startSketchOn(case, 'end')
/// const thing2 = startSketchOn(case, END)
/// |> circle(center = [size / 2, -size / 2], radius = 25)
/// |> extrude(length = 50)
///
@ -856,7 +856,7 @@ pub async fn pattern_linear_3d(exec_state: &mut ExecState, args: Args) -> Result
/// |> close(%)
/// |> extrude(length = 65)
///
/// const thing1 = startSketchOn(case, 'end')
/// const thing1 = startSketchOn(case, END)
/// |> circle(center =[-size / 2, -size / 2], radius = 25)
/// |> extrude(length = 50)
///

View File

@ -38,7 +38,7 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
/// // Remove the end face for the extrusion.
/// shell(
/// firstSketch,
/// faces = ['end'],
/// faces = [END],
/// thickness = 0.25,
/// )
/// ```
@ -56,7 +56,7 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
/// // Remove the start face for the extrusion.
/// shell(
/// firstSketch,
/// faces = ['start'],
/// faces = [START],
/// thickness = 0.25,
/// )
/// ```
@ -92,7 +92,7 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
/// // Remove a tagged face and the end face for the extrusion.
/// shell(
/// firstSketch,
/// faces = [myTag, 'end'],
/// faces = [myTag, END],
/// thickness = 0.25,
/// )
/// ```
@ -108,16 +108,16 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
/// |> close()
/// |> extrude(length = 65)
///
/// thing1 = startSketchOn(case, 'end')
/// thing1 = startSketchOn(case, END)
/// |> circle( center = [-size / 2, -size / 2], radius = 25 )
/// |> extrude(length = 50)
///
/// thing2 = startSketchOn(case, 'end')
/// thing2 = startSketchOn(case, END)
/// |> circle( center = [size / 2, -size / 2], radius = 25 )
/// |> extrude(length = 50)
///
/// // We put "case" in the shell function to shell the entire object.
/// shell(case, faces = ['start'], thickness = 5)
/// shell(case, faces = [START], thickness = 5)
/// ```
///
/// ```no_run
@ -131,16 +131,16 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
/// |> close()
/// |> extrude(length = 65)
///
/// thing1 = startSketchOn(case, 'end')
/// thing1 = startSketchOn(case, END)
/// |> circle( center = [-size / 2, -size / 2], radius = 25 )
/// |> extrude(length = 50)
///
/// thing2 = startSketchOn(case, 'end')
/// thing2 = startSketchOn(case, END)
/// |> circle( center = [size / 2, -size / 2], radius = 25 )
/// |> extrude(length = 50)
///
/// // We put "thing1" in the shell function to shell the end face of the object.
/// shell(thing1, faces = ['end'], thickness = 5)
/// shell(thing1, faces = [END], thickness = 5)
/// ```
///
/// ```no_run
@ -156,16 +156,16 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
/// |> close()
/// |> extrude(length = 65)
///
/// thing1 = startSketchOn(case, 'end')
/// thing1 = startSketchOn(case, END)
/// |> circle( center = [-size / 2, -size / 2], radius = 25 )
/// |> extrude(length = 50)
///
/// thing2 = startSketchOn(case, 'end')
/// thing2 = startSketchOn(case, END)
/// |> circle( center = [size / 2, -size / 2], radius = 25)
/// |> extrude(length = 50)
///
/// // We put "thing1" and "thing2" in the shell function to shell the end face of the object.
/// shell([thing1, thing2], faces = ['end'], thickness = 5)
/// shell([thing1, thing2], faces = [END], thickness = 5)
/// ```
#[stdlib {
name = "shell",
@ -291,11 +291,11 @@ pub async fn hollow(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// |> close()
/// |> extrude(length = 65)
///
/// thing1 = startSketchOn(case, 'end')
/// thing1 = startSketchOn(case, END)
/// |> circle( center = [-size / 2, -size / 2], radius = 25 )
/// |> extrude(length = 50)
///
/// thing2 = startSketchOn(case, 'end')
/// thing2 = startSketchOn(case, END)
/// |> circle( center = [size / 2, -size / 2], radius = 25 )
/// |> extrude(length = 50)
///

View File

@ -251,7 +251,7 @@ pub async fn line(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
/// ```no_run
/// triangle = startSketchOn(XZ)
/// |> startProfileAt([0, 0], %)
/// // The 'end' argument means it ends at exactly [10, 0].
/// // The END argument means it ends at exactly [10, 0].
/// // This is an absolute measurement, it is NOT relative to
/// // the start of the sketch.
/// |> line(endAbsolute = [10, 0])
@ -1005,7 +1005,7 @@ pub async fn start_sketch_on(exec_state: &mut ExecState, args: Args) -> Result<K
///
/// example = extrude(exampleSketch, length = 5)
///
/// exampleSketch002 = startSketchOn(example, 'end')
/// exampleSketch002 = startSketchOn(example, END)
/// |> startProfileAt([1, 1], %)
/// |> line(end = [8, 0])
/// |> line(end = [0, 8])
@ -1014,7 +1014,7 @@ pub async fn start_sketch_on(exec_state: &mut ExecState, args: Args) -> Result<K
///
/// example002 = extrude(exampleSketch002, length = 5)
///
/// exampleSketch003 = startSketchOn(example002, 'end')
/// exampleSketch003 = startSketchOn(example002, END)
/// |> startProfileAt([2, 2], %)
/// |> line(end = [6, 0])
/// |> line(end = [0, 6])
@ -1098,7 +1098,7 @@ pub async fn start_sketch_on(exec_state: &mut ExecState, args: Args) -> Result<K
///
/// example = revolve(exampleSketch, axis = Y, angle = 180)
///
/// exampleSketch002 = startSketchOn(example, 'end')
/// exampleSketch002 = startSketchOn(example, END)
/// |> startProfileAt([4.5, -5], %)
/// |> line(end = [0, 5])
/// |> line(end = [5, 0])