Luce packages
LuceLuce BaseLuciaOS

dymokomi/luced-3d

Source of release 0.11.7

0.11.7 / src / tool_fill_surface.luc

## Fill Surface (Alias's Fill): a hole's boundaries (edges, curves or
## isoparms in any order, or one edge of a hole for all of it) filled with
## one surface, G0 to G2 at each, through guide curves and points
## (fill_ops.luc; Edit Mesh has a Fill, hence the name).
## 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.fill_verb, blend_ops.fill_verb, "fill-surface", "Surfaces", [cad_cook.context], [cad_cook.edit_kind], made)

func made() -> Tool:
    return entry().tool("Modify", "Surface Blends", "A hole's boundaries filled with one surface, G0 to G2 at each, through guides", picks(), blend_ops.rows(blend_ops.fill_verb), edit_cad_build.cook,
                        numbers = blend_ops.starting(blend_ops.fill_verb), waits = waits)

func picks() -> list[Pick]:
    return [Pick("Boundaries", [edge_level, curve_level], kind = pick_kinds.words, slot = blend_ops.first_text, step = blend_ops.first_text, stays = true, doc = "The hole's boundaries: edges, curves or isoparms in any order, or one edge of a hole for all of it."),
            Pick("Guides", [edge_level, curve_level], kind = pick_kinds.words, slot = blend_ops.second_text, step = blend_ops.second_text, asked = true, needed = optional, doc = "Curves the fill runs through, and points (a double-click on a surface); none as well.")]

func optional(values: list[float], texts: list[str], wired: bool) -> bool:
    return false

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