More types stuff (#5901)
* parse union and fancy array types Signed-off-by: Nick Cameron <nrc@ncameron.org> * type aliases Signed-off-by: Nick Cameron <nrc@ncameron.org> * Treat Helix and Face as primitive types Signed-off-by: Nick Cameron <nrc@ncameron.org> * code motion: factor our execution::types module Signed-off-by: Nick Cameron <nrc@ncameron.org> * Tests for type coercion and subtyping Signed-off-by: Nick Cameron <nrc@ncameron.org> * Add Point2D/3D to std Signed-off-by: Nick Cameron <nrc@ncameron.org> * Rebasing and fixes Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
@ -223,6 +223,26 @@ export type Sketch
|
||||
@(impl = std_rust)
|
||||
export type Solid
|
||||
|
||||
/// A face.
|
||||
@(impl = std_rust)
|
||||
export type Face
|
||||
|
||||
/// A helix.
|
||||
@(impl = std_rust)
|
||||
export type Helix
|
||||
|
||||
/// A point in two dimensional space.
|
||||
///
|
||||
/// `Point2d` is an alias for a two-element array of [number](/docs/kcl/types/number)s. To write a value
|
||||
/// with type `Point2d`, use an array, e.g., `[0, 0]` or `[5.0, 3.14]`.
|
||||
export type Point2d = [number; 2]
|
||||
|
||||
/// A point in three dimensional space.
|
||||
///
|
||||
/// `Point3d` is an alias for a three-element array of [number](/docs/kcl/types/number)s. To write a value
|
||||
/// with type `Point3d`, use an array, e.g., `[0, 0, 0]` or `[5.0, 3.14, 6.8]`.
|
||||
export type Point3d = [number; 3]
|
||||
|
||||
export ZERO = 0
|
||||
export QUARTER_TURN = 90deg
|
||||
export HALF_TURN = 180deg
|
||||
|
Reference in New Issue
Block a user