/// Functions for sketch mode 2.0 (constraints version)

@no_std
@settings(defaultLengthUnit = mm, kclVersion = 1.0, experimentalFeatures = allow)

import Point2d, Segment from "std::types"

@(impl = std_rust_constrainable, experimental = true, feature_tree = false)
export fn point(
  at: Point2d,
): Segment {}

@(impl = std_rust_constrainable, experimental = true, feature_tree = false)
export fn line(
  start: Point2d,
  end?: Point2d,
  midpoint?: Point2d,
): Segment {}

@(impl = std_constrainable, experimental = true, feature_tree = false)
export type Arc = {
  start: Point2d,
  end: Point2d,
  center: Point2d | none,
  interior: Point2d | none,
}

@(impl = std_constrainable, experimental = true, feature_tree = false)
export fn arc(
  start: Point2d,
  end: Point2d,
  center?: Point2d,
  interior?: Point2d,
): Arc {
  { start, end, center, interior }
}

/// Constrain points to be coincident.
///
/// Currently limited to two points.
@(impl = std_rust_constraint, experimental = true, feature_tree = true)
export fn coincident(@points: [Segment; 2]) {}

/// Constrain the distance between two points.
@(impl = std_rust_constraint, experimental = true, feature_tree = true)
export fn distance(@points: [Segment; 2]) {}

/// Constrain lines to have equal length.
///
/// Currently limited to two lines.
@(impl = std_rust_constraint, experimental = true, feature_tree = true)
export fn equalLength(@lines: [Segment; 2]) {}

/// Constrain lines to be parallel.
///
/// Currently limited to two lines.
@(impl = std_rust_constraint, experimental = true, feature_tree = true)
export fn parallel(@input: [Segment; 2+]) {}

/// Constrain a line to be horizontal.
@(impl = std_rust_constraint, experimental = true, feature_tree = true)
export fn horizontal(@input: Segment) {}

/// Constrain a line to be vertical.
@(impl = std_rust_constraint, experimental = true, feature_tree = true)
export fn vertical(@input: Segment) {}
