dymokomi/luced-3d
Source of release 0.11.6
0.11.6 / src / tool_delete_face.luc
## Delete (Fusion 360's): faces deleted and healed, the faces around
## extended to close the gap; a whole body picked goes (edit_cad_faces.luc).
## The Delete Face node keeps its faces by name; in Edit CAD it is the
## Delete step on what is picked.
from tool_record import Tool, ToolEntry, Pick, Invocation
from geometry_data import GeometryData
from parameter_rows import Parameter
from edit_types import object_level, face_level, patch_level
import pick_kinds
import cad_cook
pub func entry() -> ToolEntry:
return ToolEntry("Delete Face", "Delete", "trash", "Modify", [cad_cook.context], [cad_cook.edit_kind], made, verb = "Delete")
func made() -> Tool:
let none_shown: list[Parameter] = []
return entry().tool("Modify", "Faces", "Delete faces and heal the body over them; a whole body picked goes", picks(), none_shown, cook, numbers = [0.0], waits = waits)
func picks() -> list[Pick]:
return [Pick("Faces", [object_level, face_level, patch_level], kind = pick_kinds.faces, slot = 0, doc = "The faces deleted; the body heals over them.")]
func waits(values: list[float], texts: list[str], wired: bool) -> str:
return "Pick the faces to delete" if texts[0].trim() == "" else ""
func cook(call: Invocation, data: GeometryData, tag: str) -> GeometryData!:
if not call.node:
return cad_cook.face_step(call, data, tag)
let waiting = waits(call.numbers, call.texts, false)
if waiting != "":
return data.passed(waiting)
let mesh = cad_cook.node_mesh(data, call.verb)
return cad_cook.node_face_step(call, "Delete", data, mesh, cad_cook.picked(call, mesh, 0, false), ["", ""], 8, tag)