Luce packages
LuceLuce BaseLuciaOS

dymokomi/luced-3d

Source of release 0.11.7

0.11.7 / src / cad_tools.luc

## The CAD tools (docs/research/POLY-MODELING.md Stage 1): each declared
## once in its tool_<name>.luc (its node in a CAD network, its step of Edit
## CAD, its picks, rows, handles and cook), listed here, one line each.
## Luce has no reflection, so a new tool is its file and its line here;
## tool_registry.luc reads this list with the mesh tools, and nothing else
## names a CAD tool.
from tool_record import Tool, ToolEntry
import tool_sketch
import tool_sketch_plane
import tool_extrude
import tool_revolve
import tool_solid_box
import tool_solid_cylinder
import tool_solid_cone
import tool_solid_sphere
import tool_solid_torus
import tool_check
import tool_offset_face
import tool_shell
import tool_split_face
import tool_replace_face
import tool_delete_face
import tool_remove_faces
import tool_move
import tool_combine
import tool_split_body
import tool_remove
import tool_mirror_body
import tool_pattern
import tool_scale_body
import tool_fillet
import tool_chamfer
import tool_reblend
import tool_project
import tool_intersect
import tool_trim
import tool_untrim
import tool_trim_convert
import tool_shrink
import tool_stitch
import tool_unstitch
import tool_extend
import tool_square
import tool_skin
import tool_rail
import tool_profile
import tool_set_planar
import tool_sheet_extrude
import tool_sheet_revolve
import tool_align
import tool_symmetry_align
import tool_blend_surface
import tool_surface_fillet
import tool_tube
import tool_fill_surface
import tool_bridge_fillet
import tool_corner
import tool_curve
import tool_cv_curve
import tool_ep_curve
import tool_curve_on_surface
import tool_duplicate_curve
import tool_isoparm
import tool_blend_curve
import tool_blend_edges
import tool_attach
import tool_detach
import tool_close
import tool_stretch
import tool_reverse_curve
import tool_delete_curves
import tool_insert_knot
import tool_remove_knot
import tool_raise_degree
import tool_rebuild
import tool_convert_to_bspline

## Every CAD tool's entry, in menu order within its family.
pub func entries() -> list[ToolEntry]:
    return [tool_sketch.entry(), tool_sketch_plane.entry(), tool_extrude.entry(), tool_revolve.entry(), tool_solid_box.entry(), tool_solid_cylinder.entry(), tool_solid_cone.entry(), tool_solid_sphere.entry(), tool_solid_torus.entry(), tool_check.entry(),
            tool_offset_face.entry(), tool_shell.entry(), tool_split_face.entry(), tool_replace_face.entry(), tool_delete_face.entry(), tool_remove_faces.entry(),
            tool_move.entry(), tool_combine.entry(), tool_split_body.entry(), tool_remove.entry(), tool_mirror_body.entry(), tool_pattern.entry(), tool_scale_body.entry(),
            tool_fillet.entry(), tool_chamfer.entry(), tool_reblend.entry(),
            tool_project.entry(), tool_intersect.entry(), tool_trim.entry(), tool_untrim.entry(), tool_trim_convert.entry(), tool_shrink.entry(), tool_stitch.entry(), tool_unstitch.entry(),
            tool_align.entry(), tool_symmetry_align.entry(),
            tool_square.entry(), tool_skin.entry(), tool_rail.entry(), tool_profile.entry(), tool_set_planar.entry(), tool_sheet_extrude.entry(), tool_sheet_revolve.entry(), tool_extend.entry(),
            tool_blend_surface.entry(), tool_surface_fillet.entry(), tool_tube.entry(), tool_fill_surface.entry(), tool_bridge_fillet.entry(), tool_corner.entry(),
            tool_curve.entry(), tool_cv_curve.entry(), tool_ep_curve.entry(), tool_curve_on_surface.entry(), tool_duplicate_curve.entry(), tool_isoparm.entry(), tool_blend_curve.entry(),
            tool_blend_edges.entry(), tool_attach.entry(), tool_detach.entry(), tool_close.entry(), tool_stretch.entry(), tool_reverse_curve.entry(), tool_delete_curves.entry(),
            tool_insert_knot.entry(), tool_remove_knot.entry(), tool_raise_degree.entry(), tool_rebuild.entry(), tool_convert_to_bspline.entry()]

## Every CAD tool, built.
pub func tools() -> list[Tool]:
    let result: list[Tool] = []
    for entry in entries():
        result.append(entry.make())
    return result

## The entry named `name` (its node kind, label or step verb), or none.
pub func entry_of(name: str) -> ToolEntry?:
    for entry in entries():
        if entry.name == name or entry.label == name or entry.verb == name:
            return entry
    return none