KCL: Helper functions to get a plane's X and Y axis

This commit is contained in:
Adam Chalmers
2025-07-01 13:56:16 -05:00
parent 7f9851ae28
commit 89d54d24d6
13 changed files with 185 additions and 0 deletions

View 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 {}

View File

@ -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 = {