Luce packages
LuceLuce BaseLuciaOS

dymokomi/luced-3d

Source of release 0.11.9

0.11.9 / src / sketch_kinds.luc

## A sketch's entity and constraint kinds as luce-cad numbers them
## (CadSketch.kind and constraint_kind; sketch/entities.lucb's EntityKind
## and ConstraintKind), named once for the editor and its tests.

## ConstraintKind's order (luce-cad sketch/entities.lucb).
pub let coincident = 0
pub let on_curve = 1
pub let horizontal = 2
pub let vertical = 3
pub let parallel = 4
pub let perpendicular = 5
pub let tangent = 6
pub let equal = 7
pub let fix = 8
pub let midpoint = 9
pub let concentric = 10
pub let collinear = 11
pub let symmetric = 12
pub let distance = 13
pub let line_distance = 14
pub let horizontal_distance = 15
pub let vertical_distance = 16
pub let angle = 17
pub let radius = 18
pub let diameter = 19
pub let curvature = 20
pub let smooth = 21
## Fusion's Offset kept as one relation over a chain: one value.
pub let offset = 22
## An arc's sweep, an angle dimension on the arc (a typed Sweep's).
pub let sweep = 23
## Fusion's Polygon: a regular polygon about its one construction circle.
pub let polygon = 24

## Entity kinds.
pub let point_kind = 0
pub let line_kind = 1
pub let circle_kind = 2
pub let arc_kind = 3
pub let spline_kind = 4
pub let ellipse_kind = 5
pub let conic_kind = 6
pub let text_kind = 7

## Whether constraint kind `kind` is a dimension (shows a value; an
## Offset relation's distance and an arc's sweep are).
pub func is_dimension(kind: int) -> bool:
    return (kind >= distance and kind <= diameter) or kind == offset or kind == sweep

## Whether a point can be held on a curve of kind `kind` (lines, circles,
## arcs and ellipses; not yet splines or conics).
pub func holds_points(kind: int) -> bool:
    return kind in [line_kind, circle_kind, arc_kind, ellipse_kind]