dymokomi/luced-3d
Source of release 0.11.9
0.11.9 / src / tool_attach.luc
## Attach (Alias's): two curves joined where they come nearest, Blend moving
## both ends to meet continuous, Connect bridging the gap straight.
## An Edit CAD step on the curves picked at the Curves level
## (edit_cad_curves.luc).
from tool_record import Tool, ToolEntry, Pick
from parameter_rows import Parameter, number, menu
from edit_types import curve_level
import pick_kinds
import edit_cad_curves
import cad_cook
pub func entry() -> ToolEntry:
return ToolEntry(edit_cad_curves.attach_verb, edit_cad_curves.attach_verb, "attach-curves", "Curves", [], [cad_cook.edit_kind], made, verb = edit_cad_curves.attach_verb)
func made() -> Tool:
return entry().tool("Modify", "Curves", "Join two curves end to end, by a blend or a straight connection", [Pick("Curves", [curve_level], kind = pick_kinds.curves, slot = pick_kinds.nowhere)], rows(), edit_cad_curves.cook,
numbers = [1.0, 0.5, 1.0])
func rows() -> list[Parameter]:
return [menu("Method", 0, "Connect|Blend", 1.0, "Blend moves both ends to meet at Blend Bias, continuous there; Connect keeps them and bridges a gap with a straight span."),
number("Blend bias", 1, 0.5, 0.0, 1.0, 0.05, "Blend: where the ends meet, 0 at the first curve's end, 1 at the second's start.", slider = true),
menu("Continuity", 2, "G0|G1|G2|G3", 1.0, "Blend: the continuity at the joint.")]