dymokomi/luced-3d
Source of release 0.11.8
## What one pick of a tool takes (tool_record.Pick.kind), and where it is
## kept: a mesh tool's components are a group; a CAD tool keeps what it
## picks by name (luce-cad's face names, edge references, curve names, the
## words of a curve or an edge picked along it), which hold as the model
## upstream changes.
## A group of the level's components (a mesh tool's selection).
pub let components = 0
## Faces by name, several; one face.
pub let faces = 1
pub let face = 2
## Bodies, each by the name of one of its faces; one body.
pub let bodies = 3
pub let body = 4
## Edges by reference, several; one edge.
pub let edges = 5
pub let edge = 6
## A point: a corner or an edge's end, a round edge's middle (three values).
pub let point = 7
## Curves of the model, by name.
pub let curves = 8
## Curves or edges (or temporary isoparms) as words, in the order clicked
## (build_ops.items): a builder's curves, a blend's sides.
pub let words = 9
## One curve (the Curves level) or edge: a blend's end.
pub let curve_or_edge = 10
## Align's input (an edge, a curve's end) and its master (an edge, a curve,
## a face, or a temporary isoparm).
pub let align_input = 11
pub let align_master = 12
## Revolve's axis: a sketch line or a body's edge.
pub let axis = 13
## Extrude's and Revolve's profiles: regions of the sketch clicked.
pub let profiles = 14
## Bodies as a group expression on the pick geometry (Edit CAD's Combine
## keeps its tool bodies so).
pub let body_group = 15
## Where a pick is kept (Pick.slot, Pick.step): the step's group, or no
## place (a pick only a node has, or only a step).
pub let group = -1
pub let nowhere = -2
## Whether a pick of kind `kind` takes several (Enter finishes it).
pub func many(kind: int) -> bool:
return kind in [components, faces, bodies, edges, curves, words, body_group]
## Whether kind `kind` names bodies.
pub func whole_bodies(kind: int) -> bool:
return kind in [bodies, body, body_group]
## The domain a pick of kind `kind` picks on, as Fusion's selection filter
## (tool_prompt.domain): 2 faces, 4 edges, -2 whole bodies, -1 the level's
## own.
pub func domain(kind: int) -> int:
if kind in [faces, face]:
return 2
if kind in [edges, edge, axis, point]:
return 4
if whole_bodies(kind):
return -2
return -1