Luce packages
LuceLuce BaseLuciaOS

dymokomi/luced-3d

Source of release 0.11.8

0.11.8 / src / tool_blend_surface.luc

## Blend Surface (Alias's Freeform Blend; a Profile Blend through picked
## profiles): a surface between two sides of edges, curves or isoparms, G0
## to G3 at each (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.blend_verb, blend_ops.blend_verb, "blend-surface", "Surfaces", [cad_cook.context], [cad_cook.edit_kind], made)

func made() -> Tool:
    return entry().tool("Modify", "Surface Blends", "A surface between two sides of edges or curves, G0 to G3 at each", picks(), blend_ops.rows(blend_ops.blend_verb), edit_cad_build.cook,
                        numbers = blend_ops.starting(blend_ops.blend_verb), waits = waits)

func picks() -> list[Pick]:
    return [Pick("First side", [edge_level, curve_level], kind = pick_kinds.words, slot = blend_ops.first_text, step = blend_ops.first_text, doc = "Side 1: edges, curves or isoparms, a chain in order."),
            Pick("Second side", [edge_level, curve_level], kind = pick_kinds.words, slot = blend_ops.second_text, step = blend_ops.second_text, doc = "Side 2, likewise."),
            Pick("Profiles", [edge_level, curve_level], kind = pick_kinds.words, slot = blend_ops.profiles_text, step = blend_ops.profiles_text, asked = true, needed = optional, doc = "Alias's Profile Blend: curves across the blend it passes through (none: a Freeform Blend).")]

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.blend_verb, texts)