Add KCL constants for sweep relativeTo strings (#6974)
* Add KCL constants for sweep relativeTo strings Before: ``` sweep(pill, path = sweepPath, relativeTo = "trajectoryCurve") ``` After: ``` sweep(pill, path = sweepPath, relativeTo = sweep::TRAJECTORY) ``` * Update docs
This commit is contained in:
16
docs/kcl-std/consts/std-sweep-SKETCH_PLANE.md
Normal file
16
docs/kcl-std/consts/std-sweep-SKETCH_PLANE.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
title: "sweep::SKETCH_PLANE"
|
||||||
|
subtitle: "Constant in std::sweep"
|
||||||
|
excerpt: "Local/relative to a position centered within the plane being sketched on"
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
Local/relative to a position centered within the plane being sketched on
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
sweep::SKETCH_PLANE: string = 'sketchPlane'
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
16
docs/kcl-std/consts/std-sweep-TRAJECTORY.md
Normal file
16
docs/kcl-std/consts/std-sweep-TRAJECTORY.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
title: "sweep::TRAJECTORY"
|
||||||
|
subtitle: "Constant in std::sweep"
|
||||||
|
excerpt: "Local/relative to the trajectory curve"
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
Local/relative to the trajectory curve
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
sweep::TRAJECTORY: string = 'trajectoryCurve'
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -128,6 +128,9 @@ layout: manual
|
|||||||
* [`E`](/docs/kcl-std/consts/std-math-E)
|
* [`E`](/docs/kcl-std/consts/std-math-E)
|
||||||
* [`PI`](/docs/kcl-std/consts/std-math-PI)
|
* [`PI`](/docs/kcl-std/consts/std-math-PI)
|
||||||
* [`TAU`](/docs/kcl-std/consts/std-math-TAU)
|
* [`TAU`](/docs/kcl-std/consts/std-math-TAU)
|
||||||
|
* [**std::sweep**](/docs/kcl-std/modules/std-sweep)
|
||||||
|
* [`sweep::SKETCH_PLANE`](/docs/kcl-std/consts/std-sweep-SKETCH_PLANE)
|
||||||
|
* [`sweep::TRAJECTORY`](/docs/kcl-std/consts/std-sweep-TRAJECTORY)
|
||||||
* [**std::turns**](/docs/kcl-std/modules/std-turns)
|
* [**std::turns**](/docs/kcl-std/modules/std-turns)
|
||||||
* [`turns::HALF_TURN`](/docs/kcl-std/consts/std-turns-HALF_TURN)
|
* [`turns::HALF_TURN`](/docs/kcl-std/consts/std-turns-HALF_TURN)
|
||||||
* [`turns::QUARTER_TURN`](/docs/kcl-std/consts/std-turns-QUARTER_TURN)
|
* [`turns::QUARTER_TURN`](/docs/kcl-std/consts/std-turns-QUARTER_TURN)
|
||||||
|
17
docs/kcl-std/modules/std-sweep.md
Normal file
17
docs/kcl-std/modules/std-sweep.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
title: "sweep"
|
||||||
|
subtitle: "Module in std"
|
||||||
|
excerpt: ""
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Functions and constants
|
||||||
|
|
||||||
|
* [`sweep::SKETCH_PLANE`](/docs/kcl-std/consts/std-sweep-SKETCH_PLANE)
|
||||||
|
* [`sweep::TRAJECTORY`](/docs/kcl-std/consts/std-sweep-TRAJECTORY)
|
||||||
|
|
@ -19,6 +19,7 @@ You might also want the [KCL language reference](/docs/kcl-lang) or the [KCL gui
|
|||||||
* [`math`](/docs/kcl-std/modules/std-math)
|
* [`math`](/docs/kcl-std/modules/std-math)
|
||||||
* [`sketch`](/docs/kcl-std/modules/std-sketch)
|
* [`sketch`](/docs/kcl-std/modules/std-sketch)
|
||||||
* [`solid`](/docs/kcl-std/modules/std-solid)
|
* [`solid`](/docs/kcl-std/modules/std-solid)
|
||||||
|
* [`sweep::sweep`](/docs/kcl-std/modules/std-sweep)
|
||||||
* [`transform`](/docs/kcl-std/modules/std-transform)
|
* [`transform`](/docs/kcl-std/modules/std-transform)
|
||||||
* [`turns::turns`](/docs/kcl-std/modules/std-turns)
|
* [`turns::turns`](/docs/kcl-std/modules/std-turns)
|
||||||
* [`types`](/docs/kcl-std/modules/std-types)
|
* [`types`](/docs/kcl-std/modules/std-types)
|
||||||
|
@ -96,6 +96,7 @@ pub(crate) fn read_std(mod_name: &str) -> Option<&'static str> {
|
|||||||
"solid" => Some(include_str!("../std/solid.kcl")),
|
"solid" => Some(include_str!("../std/solid.kcl")),
|
||||||
"units" => Some(include_str!("../std/units.kcl")),
|
"units" => Some(include_str!("../std/units.kcl")),
|
||||||
"array" => Some(include_str!("../std/array.kcl")),
|
"array" => Some(include_str!("../std/array.kcl")),
|
||||||
|
"sweep" => Some(include_str!("../std/sweep.kcl")),
|
||||||
"transform" => Some(include_str!("../std/transform.kcl")),
|
"transform" => Some(include_str!("../std/transform.kcl")),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ export import * from "std::sketch"
|
|||||||
export import * from "std::solid"
|
export import * from "std::solid"
|
||||||
export import * from "std::transform"
|
export import * from "std::transform"
|
||||||
export import "std::turns"
|
export import "std::turns"
|
||||||
|
export import "std::sweep"
|
||||||
|
|
||||||
/// An abstract 3d plane aligned with the X and Y axes. Its normal is the positive Z axis.
|
/// An abstract 3d plane aligned with the X and Y axes. Its normal is the positive Z axis.
|
||||||
export XY = {
|
export XY = {
|
||||||
@ -83,7 +84,7 @@ export END = 'end'
|
|||||||
/// // Create a spring by sweeping around the helix path.
|
/// // Create a spring by sweeping around the helix path.
|
||||||
/// springSketch = startSketchOn(YZ)
|
/// springSketch = startSketchOn(YZ)
|
||||||
/// |> circle( center = [0, 0], radius = 0.5)
|
/// |> circle( center = [0, 0], radius = 0.5)
|
||||||
/// |> sweep(path = helixPath, relativeTo = "sketchPlane")
|
/// |> sweep(path = helixPath, relativeTo = sweep::SKETCH_PLANE)
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
@ -104,7 +105,7 @@ export END = 'end'
|
|||||||
/// // Create a spring by sweeping around the helix path.
|
/// // Create a spring by sweeping around the helix path.
|
||||||
/// springSketch = startSketchOn(XY)
|
/// springSketch = startSketchOn(XY)
|
||||||
/// |> circle( center = [0, 0], radius = 0.5 )
|
/// |> circle( center = [0, 0], radius = 0.5 )
|
||||||
/// |> sweep(path = helixPath, relativeTo = "sketchPlane")
|
/// |> sweep(path = helixPath, relativeTo = sweep::SKETCH_PLANE)
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
@ -124,7 +125,7 @@ export END = 'end'
|
|||||||
/// // Create a spring by sweeping around the helix path.
|
/// // Create a spring by sweeping around the helix path.
|
||||||
/// springSketch = startSketchOn(XY)
|
/// springSketch = startSketchOn(XY)
|
||||||
/// |> circle( center = [0, 0], radius = 1 )
|
/// |> circle( center = [0, 0], radius = 1 )
|
||||||
/// |> sweep(path = helixPath, relativeTo = "sketchPlane")
|
/// |> sweep(path = helixPath, relativeTo = sweep::SKETCH_PLANE)
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
@ -413,7 +414,7 @@ export fn offsetPlane(
|
|||||||
/// // Create a spring by sweeping around the helix path.
|
/// // Create a spring by sweeping around the helix path.
|
||||||
/// sweepedSpring = clone(springSketch)
|
/// sweepedSpring = clone(springSketch)
|
||||||
/// |> translate(x=100)
|
/// |> translate(x=100)
|
||||||
/// |> sweep(path = helixPath, relativeTo = "sketchPlane")
|
/// |> sweep(path = helixPath, relativeTo = sweep::SKETCH_PLANE)
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```kcl
|
/// ```kcl
|
||||||
|
5
rust/kcl-lib/std/sweep.kcl
Normal file
5
rust/kcl-lib/std/sweep.kcl
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
/// Local/relative to the trajectory curve
|
||||||
|
export TRAJECTORY = 'trajectoryCurve'
|
||||||
|
|
||||||
|
/// Local/relative to a position centered within the plane being sketched on
|
||||||
|
export SKETCH_PLANE = 'sketchPlane'
|
Reference in New Issue
Block a user