KCL: Helper functions to get a plane's X and Y axis
This commit is contained in:
38
rust/kcl-lib/std/planes.kcl
Normal file
38
rust/kcl-lib/std/planes.kcl
Normal file
@ -0,0 +1,38 @@
|
||||
/// Find X axis of a plane.
|
||||
///```kcl
|
||||
/// mySolid = startSketchOn(XZ)
|
||||
/// |> polygon(numSides = 3, radius = 1, center = [3, 2])
|
||||
/// |> extrude(length = 5)
|
||||
///
|
||||
/// target = planeOf(mySolid, face = END)
|
||||
///
|
||||
/// xTarget = planes::xAxis(target)
|
||||
/// assert(xTarget[0], isEqualTo = 1)
|
||||
/// assert(xTarget[1], isEqualTo = 0)
|
||||
/// assert(xTarget[2], isEqualTo = 0)
|
||||
/// ```
|
||||
@(impl = std_rust)
|
||||
export fn xAxis(
|
||||
/// The solid whose face is being queried.
|
||||
@plane: Plane,
|
||||
): Point3d {}
|
||||
|
||||
/// Find Y axis of a plane.
|
||||
///```kcl
|
||||
/// mySolid = startSketchOn(XZ)
|
||||
/// |> polygon(numSides = 3, radius = 1, center = [3, 2])
|
||||
/// |> extrude(length = 5)
|
||||
///
|
||||
/// target = planeOf(mySolid, face = END)
|
||||
///
|
||||
/// yTarget = planes::yAxis(target)
|
||||
/// assert(yTarget[0], isEqualTo = 0)
|
||||
/// assert(yTarget[1], isEqualTo = 0)
|
||||
/// assert(yTarget[2], isEqualTo = 1)
|
||||
/// ```
|
||||
@(impl = std_rust)
|
||||
export fn yAxis(
|
||||
/// The solid whose face is being queried.
|
||||
@plane: Plane,
|
||||
): Point3d {}
|
||||
|
@ -23,6 +23,7 @@ export import * from "std::transform"
|
||||
export import "std::turns"
|
||||
export import "std::sweep"
|
||||
export import "std::appearance"
|
||||
export import "std::planes"
|
||||
|
||||
/// An abstract 3d plane aligned with the X and Y axes. Its normal is the positive Z axis.
|
||||
export XY = {
|
||||
|
Reference in New Issue
Block a user