Luce packages
LuceLuce BaseLuciaOS

dymokomi/luced-3d

Source of release 0.11.8

0.11.8 / src / tool_tube.luc

## Tube (Alias's): a round tube along a curve, an edge or an isoparm, its
## radius constant or varying along it (blend_ops.luc).
## A node keeps its picks as words (curves by name, edges by their face and
## where they were clicked); an Edit CAD step takes what is picked, in the
## order picked, and waits for more (edit_cad_build.luc).
from tool_record import Tool, ToolEntry, Pick
from edit_types import edge_level, curve_level
import pick_kinds
import blend_ops
import edit_cad_build
import cad_cook

pub func entry() -> ToolEntry:
    return ToolEntry(blend_ops.tube_verb, blend_ops.tube_verb, "tube", "Surfaces", [cad_cook.context], [cad_cook.edit_kind], made)

func made() -> Tool:
    return entry().tool("Modify", "Surface Blends", "A round tube along a curve, its radius constant or varying", picks(), blend_ops.rows(blend_ops.tube_verb), edit_cad_build.cook,
                        numbers = blend_ops.starting(blend_ops.tube_verb), waits = waits)

func picks() -> list[Pick]:
    return [Pick("Curve", [edge_level, curve_level], kind = pick_kinds.words, slot = blend_ops.first_text, step = blend_ops.first_text, most = 1, doc = "The curve the tube runs along: a curve, an edge, or a double-click for an isoparm.")]

func waits(values: list[float], texts: list[str], wired: bool) -> str:
    return blend_ops.waits_for(blend_ops.tube_verb, texts)