跳转到主要内容

raygeo.cnc.tool

Side profiles of the three common cutting-tool categories, built as ToolModel parameter bags.

Side profiles of the three common cutting-tool categories, built as ToolModel parameter bags. CNC tool model.

Provides ToolModel (a parametric geometry parameter bag), the ToolCategory enum (type-safe tool classification for compatibility checks), the ToolMaterial enum, and the Tool composite. All types are implemented in Rust and consumed by the CNC layer's signatures.

Tool

A physical cutting tool.

Combines a parametric ToolModel (measurements), a ToolCategory (type-safe classification), a ToolMaterial, and setup parameters:

tool = Tool(
label="6mm EM",
category=ToolCategory.END_MILL,
model=ToolModel(diameter=6.0, ...),
material=ToolMaterial.CARBIDE,
stickout=15.0,
)

category

category: ToolCategory

coating

coating: Optional[str]

label

label: str

material

material: ToolMaterial

model

model: ToolModel

The tool's parametric geometry model.

stickout

stickout: float

default_stickout()

default_stickout() -> float

Default stickout = cutting edge height + 3 mm safety.

ParameterTypeDescription
Returnsfloat

diameter()

diameter() -> float

Cutting diameter (mm).

ParameterTypeDescription
Returnsfloat

ToolCategory

Type-safe classification of a tool, for operation-compatibility checks (e.g. chamfering requires Chamfer/Vbit, slotting rejects Probe).

Values:

  • BALL_NOSE
  • BULL_NOSE
  • CHAMFER
  • DOVETAIL
  • DRILL
  • END_MILL
  • PROBE
  • REAMER
  • SLITTING_SAW
  • TAP
  • THREAD_MILL
  • VBIT

ToolMaterial

Tool substrate material.

Values:

  • CARBIDE
  • CBN
  • CERAMIC
  • DIAMOND
  • HSS
  • HSSE

ToolModel

Parametric model describing a tool's geometry.

A single, hierarchy-free class: a bag of named parameters. Construct with keyword arguments for each parameter:

model = ToolModel(
diameter=6.0,
shank_diameter=6.0,
cutting_edge_height=15.0,
flute_count=3.0,
overall_length=50.0,
)

The type-safe tool classification (end-mill vs. probe vs. ...) lives on Tool as the ToolCategory enum; a ToolModel only carries measurements. New geometries are created by constructing a ToolModel with new parameters -- no raygeo change required.

corner_radius()

corner_radius() -> float

Corner radius (mm); 0.0 if unspecified.

ParameterTypeDescription
Returnsfloat

cutting_edge_height()

cutting_edge_height() -> float

Cutting-edge height (mm); 0.0 if unspecified.

ParameterTypeDescription
Returnsfloat

diameter()

diameter() -> float

Cutting diameter (mm); 0.0 if unspecified.

ParameterTypeDescription
Returnsfloat

get_parameter()

get_parameter(name: str) -> Optional[float]

Read a named parameter, or None if absent.

ParameterTypeDescription
namestr
ReturnsOptional[float]

get_parameters()

get_parameters() -> dict[str, float]

All parameters as a {name: value} dict.

ParameterTypeDescription
Returnsdict[str, float]