Luce packages
LuceLuce BaseLuciaOS

dymokomi/luced-3d

Source of release 0.11.6

0.11.6 / src / tool_profile.luc

## Profile (Alias's): profiles placed along a rail, oriented Parallel,
## Radial or by the Surface normal, Linear, Local, Global or Limited
## between them (build_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 build_ops
import edit_cad_build
import cad_cook

pub func entry() -> ToolEntry:
    return ToolEntry(build_ops.profile_verb, build_ops.profile_verb, "profile-sweep", "Surfaces", [cad_cook.context], [cad_cook.edit_kind], made)

func made() -> Tool:
    return entry().tool("Modify", "Surface Build", "Profiles placed along a rail, oriented Parallel, Radial or by the surface normal", picks(), build_ops.rows(build_ops.profile_verb), edit_cad_build.cook,
                        numbers = build_ops.starting(build_ops.profile_verb), waits = waits)

func picks() -> list[Pick]:
    return [Pick("Profiles", [curve_level, edge_level], kind = pick_kinds.words, slot = build_ops.curves_text, step = build_ops.curves_text, doc = "The profiles placed along the rail."),
            Pick("Rail", [curve_level, edge_level], kind = pick_kinds.words, slot = build_ops.rails_text, step = build_ops.rails_text, doc = "The rail the profiles are placed on.")]

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