[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H9PAPRQNR3TECV06JHS0DZ":3,"skill-same:01M6H9PAPRQNR3TECV06JHS0DZ":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":31,"linkOnly":32,"markdownContent":33,"markdownBody":34,"frontMatter":35,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":14,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":43,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M6H9PAPRQNR3TECV06JHS0DZ","cad-cam",null,"CAD\u002FCAM fundamentals including geometric modeling, manufacturing automation, toolpath generation, CNC programming, and 3D printing","NeuralBlitz\u002FMito","NeuralBlitz","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F79354388?v=4","01M6H8T2TFH477HRS0KTSTKR2E","David Riggs","01M6H8T2YQQDXPYM092P670Z21",0,"MIT","https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fengineering\u002Fcad-cam\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30],"cad","cam","cad cam","automation","engineering","3D","programming","opencode","3d printing","generation","modeling","manufacturing","2026-11-10 10:12:30",false,"---\nname: cad-cam\ndescription: CAD\u002FCAM fundamentals including geometric modeling, manufacturing automation, toolpath generation, CNC programming, and 3D printing\nlicense: MIT\ncompatibility: opencode\nmetadata:\n  audience: engineers\n  category: engineering\n---\n\n## What I do\n- Create 3D geometric models using CAD software\n- Generate CNC toolpaths for manufacturing\n- Program CNC machines using G-code and CAM software\n- Design for additive manufacturing (3D printing)\n- Perform toolpath simulation and verification\n- Optimize machining parameters for efficiency\n- Convert CAD models to manufacturing formats\n- Verify tool collision and machine limits\n\n## When to use me\nWhen creating 3D models, generating CNC toolpaths, programming CNC machines, or designing parts for additive manufacturing.\n\n## Core Concepts\n- Solid modeling (CSG, B-rep)\n- Surface modeling and NURBS\n- Feature-based modeling\n- Toolpath strategies (contour, pocketing, drilling)\n- CNC programming (G-code, M-code)\n- Feed and speed calculations\n- Tool geometry and compensation\n- Additive manufacturing processes (FDM, SLA, SLS)\n- Build orientation and support generation\n- Post-processing for different machine controllers\n\n## Code Examples\n\n### G-Code Generation\n```python\nfrom dataclasses import dataclass\nfrom typing import List, Tuple\nimport math\n\n@dataclass\nclass GCodeCommand:\n    code: str\n    x: float = None\n    y: float = None\n    z: float = None\n    f: float = None\n    s: float = None\n\ndef rapid_move(x: float, y: float, z: float) -> str:\n    \"\"\"Generate G0 rapid move command.\"\"\"\n    return f\"G0 X{x:.4f} Y{y:.4f} Z{z:.4f}\"\n\ndef linear_move(x: float, y: float, z: float, f: float) -> str:\n    \"\"\"Generate G1 linear move command.\"\"\"\n    return f\"G1 X{x:.4f} Y{y:.4f} Z{z:.4f} F{f:.1f}\"\n\ndef circular_move(\n    i: float, j: float, x: float, y: float,\n    direction: str = \"clockwise\",\n    f: float = 100\n) -> str:\n    \"\"\"Generate G2\u002FG3 circular move.\"\"\"\n    g_code = \"G2\" if direction == \"clockwise\" else \"G3\"\n    return f\"{g_code} X{x:.4f} Y{y:.4f} I{i:.4f} J{j:.4f} F{f:.1f}\"\n\ndef drill_cycle(\n    x: float, y: float,\n    z_start: float,\n    z_depth: float,\n    z_retract: float,\n    f_plunge: float,\n    f_rapid: float\n) -> List[str]:\n    \"\"\"Generate G81 drilling cycle.\"\"\"\n    return [\n        rapid_move(x, y, z_start),\n        f\"G81 R{z_retract} Z{z_depth} F{f_plunge}\",\n        f\"G80\",\n        rapid_move(x, y, z_retract)\n    ]\n\ndef canned_cycle(\n    cycle: str,\n    x: float, y: float,\n    r: float, z: float,\n    q: float = None,\n    f: float = 100\n) -> str:\n    \"\"\"Generate canned cycle command.\"\"\"\n    if q:\n        return f\"{cycle} R{r} Z{z} Q{q} F{f}\"\n    return f\"{cycle} R{r} Z{z} F{f}\"\n\n# Example: Simple part program\ngcode = [\n    \"G90 G21 G40\",  # Absolute, mm, cancel compensation\n    \"G54\",  # Work coordinate system 1\n    \"M6 T1\",  # Tool change to tool 1\n    \"M3 S3000\",  # Spindle on clockwise 3000 RPM\n    rapid_move(0, 0, 5),\n    linear_move(10, 0, -2, 100),\n    linear_move(10, 10, -2, 100),\n    linear_move(0, 10, -2, 100),\n    linear_move(0, 0, -2, 100),\n    \"M5\",  # Spindle off\n    \"M30\"  # Program end\n]\nfor line in gcode[:5]:\n    print(line)\n```\n\n### Toolpath Generation\n```python\nfrom typing import List, Tuple\nimport numpy as np\n\ndef offset_polygon(\n    vertices: List[Tuple[float, float]],\n    offset: float,\n    corner_style: str = \"round\"\n) -> List[Tuple[float, float]]:\n    \"\"\"Generate offset contour for tool radius compensation.\"\"\"\n    offset_vertices = []\n    n = len(vertices)\n    \n    for i in range(n):\n        p1 = vertices[i]\n        p2 = vertices[(i + 1) % n]\n        p0 = vertices[(i - 1) % n]\n        \n        v1 = np.array(p2) - np.array(p1)\n        v0 = np.array(p1) - np.array(p0)\n        \n        angle1 = math.atan2(v1[1], v1[0])\n        angle0 = math.atan2(v0[1], v0[0])\n        \n        if corner_style == \"round\":\n            radius = offset\n            center = np.array(p1) + np.array([\n                radius * math.cos((angle0 + angle1) \u002F 2),\n                radius * math.sin((angle0 + angle1) \u002F 2)\n            ])\n            # Generate arc points\n            for t in np.linspace(0, 1, 9):\n                angle = angle0 + (angle1 - angle0) * t\n                offset_vertices.append((\n                    center[0] + radius * math.cos(angle + math.pi\u002F2),\n                    center[1] + radius * math.sin(angle + math.pi\u002F2)\n                ))\n        else:\n            # Miter join\n            bisector = (angle0 + angle1) \u002F 2\n            offset_vertices.append((\n                p1[0] + offset * math.cos(bisector + math.pi\u002F2),\n                p1[1] + offset * math.sin(bisector + math.pi\u002F2)\n            ))\n    \n    return offset_vertices\n\ndef raster_toolpath(\n    bbox: Tuple[float, float, float, float],\n    stepover: float,\n    direction: str = \"x\"\n) -> List[Tuple[float, float]]:\n    \"\"\"Generate raster (zigzag) toolpath.\"\"\"\n    xmin, xmax, ymin, ymax = bbox\n    path = []\n    \n    if direction == \"x\":\n        for y in np.arange(ymin, ymax, stepover):\n            if (y - ymin) \u002F stepover % 2 == 0:\n                path.extend([(xmin, y), (xmax, y)])\n            else:\n                path.extend([(xmax, y), (xmin, y)])\n    else:\n        for x in np.arange(xmin, xmax, stepover):\n            if (x - xmin) \u002F stepover % 2 == 0:\n                path.extend([(x, ymin), (x, ymax)])\n            else:\n                path.extend([(x, ymax), (x, ymin)])\n    \n    return path\n\ndef spiral_toolpath(\n    center: Tuple[float, float],\n    start_radius: float,\n    end_radius: float,\n    angle_per_step: float = 0.1,\n    z_feed: float = 0.01\n) -> List[Tuple[float, float, float]]:\n    \"\"\"Generate spiral toolpath for drilling\u002Fmilling.\"\"\"\n    path = []\n    r = start_radius\n    theta = 0\n    \n    while r \u003C= end_radius:\n        x = center[0] + r * math.cos(theta)\n        y = center[1] + r * math.sin(theta)\n        z = -r \u002F end_radius * 5  # Example z-depth\n        path.append((x, y, z))\n        r += 0.05\n        theta += angle_per_step\n    \n    return path\n\ndef trochoidal_milling(\n    center: Tuple[float, float],\n    radius: float,\n    slot_width: float,\n    stepdown: float,\n    total_depth: float\n) -> List[Tuple[float, float, float]]:\n    \"\"\"Generate trochoidal milling toolpath.\"\"\"\n    path = []\n    current_depth = 0\n    \n    while current_depth \u003C total_depth:\n        current_depth += stepdown\n        if current_depth > total_depth:\n            current_depth = total_depth\n        \n        angle = 0\n        while angle \u003C 2 * math.pi:\n            x = center[0] + (radius + slot_width\u002F2 * math.cos(angle)) * math.cos(angle\u002F2)\n            y = center[1] + (radius + slot_width\u002F2 * math.cos(angle)) * math.sin(angle\u002F2)\n            z = -current_depth\n            path.append((x, y, z))\n            angle += 0.2\n    \n    return path\n\n# Example: Raster toolpath\nbbox = (0, 100, 0, 50)\npath = raster_toolpath(bbox, 10, \"x\")\nprint(f\"Generated {len(path)} path points\")\n```\n\n### Feeds and Speeds\n```python\n@dataclass\nclass ToolParameters:\n    diameter: float  # mm\n    num_flutes: int\n    material: str\n    hardness: float  # HRC\n\n@dataclass\nclass MaterialProperties:\n    name: str\n    hardness: float  # HB or HRC\n    tensile_strength: float  # MPa\n    machinability_rating: float\n\ndef calculate_spindle_speed(\n    cutting_speed: float,\n    tool_diameter: float\n) -> float:\n    \"\"\"Calculate spindle RPM.\"\"\"\n    return (1000 * cutting_speed) \u002F (math.pi * tool_diameter)\n\ndef calculate_feed_rate(\n    spindle_speed: float,\n    feed_per_tooth: float,\n    num_flutes: int\n) -> float:\n    \"\"\"Calculate feed rate mm\u002Fmin.\"\"\"\n    return spindle_speed * feed_per_tooth * num_flutes\n\ndef calculate_material_removal_rate(\n    width: float,\n    depth: float,\n    feed_rate: float\n) -> float:\n    \"\"\"Calculate MRR mm³\u002Fmin.\"\"\"\n    return width * depth * feed_rate\n\ndef calculate_power_requirement(\n    mrr: float,\n    specific_energy: float\n) -> float:\n    \"\"\"Calculate cutting power kW.\"\"\"\n    return mrr * specific_energy \u002F 60000\n\ndef estimate_feeds_speeds(\n    material: str,\n    tool_diameter: float,\n    num_flutes: int,\n    operation: str\n) -> dict:\n    \"\"\"Estimate feeds and speeds based on material and operation.\"\"\"\n    material_data = {\n        \"aluminum\": {\"vc\": 200, \"fz\": 0.08, \"se\": 600},\n        \"steel\": {\"vc\": 100, \"fz\": 0.04, \"se\": 1500},\n        \"stainless\": {\"vc\": 70, \"fz\": 0.03, \"se\": 1800},\n        \"titanium\": {\"vc\": 50, \"fz\": 0.02, \"se\": 2500}\n    }\n    \n    modifiers = {\n        \"roughing\": {\"vc_mult\": 1.2, \"fz_mult\": 1.2},\n        \"finishing\": {\"vc_mult\": 1.5, \"fz_mult\": 0.5},\n        \"slotting\": {\"vc_mult\": 0.6, \"fz_mult\": 0.8}\n    }\n    \n    m = material_data.get(material, material_data[\"steel\"])\n    op_mod = modifiers.get(operation, {\"vc_mult\": 1.0, \"fz_mult\": 1.0})\n    \n    vc = m[\"vc\"] * op_mod[\"vc_mult\"]\n    fz = m[\"fz\"] * op_mod[\"fz_mult\"]\n    \n    n = calculate_spindle_speed(vc)\n    vf, tool_diameter = calculate_feed_rate(n, fz, num_flutes)\n    \n    return {\n        \"spindle_speed_rpm\": n,\n        \"feed_rate_mm_min\": vf,\n        \"chip_load_mm_tooth\": fz\n    }\n\n# Example: Feeds and speeds\nsettings = estimate_feeds_speeds(\"aluminum\", 10, 4, \"roughing\")\nprint(f\"Spindle speed: {settings['spindle_speed_rpm']:.0f} RPM\")\nprint(f\"Feed rate: {settings['feed_rate_mm_min']:.1f} mm\u002Fmin\")\n```\n\n### Additive Manufacturing\n```python\n@dataclass\nclass AMBuildSettings:\n    layer_height: float  # mm\n    infill_percentage: float\n    infill_pattern: str\n    build_temperature: float  # C\n    bed_temperature: float  # C\n    print_speed: float  # mm\u002Fs\n    support_type: str\n\ndef estimate_build_time(\n    num_layers: int,\n    layer_area: float,\n    print_speed: float,\n    travel_speed: float = 150,\n    layer_change_time: float = 5\n) -> float:\n    \"\"\"Estimate total build time in hours.\"\"\"\n    print_time = (num_layers * layer_area) \u002F print_speed \u002F 60\n    travel_factor = 0.3\n    layer_time = num_layers * layer_change_time \u002F 60\n    return (print_time * (1 + travel_factor) + layer_time) \u002F 60\n\ndef calculate_material_usage(\n    volume_mm3: float,\n    infill_percentage: float = 20,\n    support_percentage: float = 10\n) -> float:\n    \"\"\"Calculate required material in grams.\"\"\"\n    density = 1.24  # PLA g\u002Fcm³\n    volume_cm3 = volume_mm3 \u002F 1000\n    total_volume = volume_cm3 * (1 + infill_percentage\u002F100) * (1 + support_percentage\u002F100)\n    return total_volume * density\n\ndef optimize_build_orientation(\n    surface_area: float,\n    build_volume: Tuple[float, float, float],\n    min_surface_roughness: bool = True,\n    max_strength: bool = False\n) -> Tuple[float, float, float]:\n    \"\"\"Optimize part orientation for 3D printing.\"\"\"\n    x, y, z = build_volume\n    \n    if min_surface_roughness:\n        return (x, y, 0.1)  # Largest flat surface down\n    elif max_strength:\n        return (0.1, y, z)  # Layer lines perpendicular to load\n    return (x, y, z)\n\ndef generate_support_structure(\n    overhang_angle_threshold: float = 45,\n    support_density: float = 0.2\n) -> List[dict]:\n    \"\"\"Generate support structure parameters.\"\"\"\n    return [{\n        \"angle_threshold\": overhang_angle_threshold,\n        \"density\": support_density,\n        \"style\": \"tree\" if support_density \u003C 0.15 else \"grid\"\n    }]\n\n# Example: Build estimation\nbuild = AMBuildSettings(\n    layer_height=0.2,\n    infill_percentage=20,\n    infill_pattern=\"grid\",\n    print_speed=60\n)\ntime = estimate_build_time(100, 50*50, 60)\nmaterial = calculate_material_usage(100*100*100, 20, 10)\nprint(f\"Estimated build time: {time:.1f} hours\")\nprint(f\"Material required: {material:.1f} g\")\n```\n\n### CAM Post-Processing\n```python\n@dataclass\nclass PostProcessorConfig:\n    machine_type: str\n    control_system: str\n    output_format: str\n    arc_output: str\n    tool_change_mcode: str\n    coolant_mcodes: Tuple[str, str]\n\ndef generate_post_processor(\n    config: PostProcessorConfig\n) -> dict:\n    \"\"\"Generate post-processor configuration.\"\"\"\n    return {\n        \"header\": [\n            f\"O1234 ({config.machine_type} program)\",\n            \"G90 G21 G40\",\n            f\"G54 (Work coordinate: {config.control_system})\"\n        ],\n        \"tool_change\": f\"M6 T#{{TOOL_NUMBER}} ({config.tool_change_mcode})\",\n        \"coolant_on\": config.coolant_mcodes[0],\n        \"coolant_off\": config.coolant_mcodes[1],\n        \"arc_format\": config.arc_output,\n        \"footer\": [\"M5\", \"M30\"]\n    }\n\ndef interpolate_gcode(\n    input_points: List[Tuple[float, float, float]],\n    tolerance: float = 0.01\n) -> List[Tuple[float, float, float]]:\n    \"\"\"Interpolate toolpath with tolerance.\"\"\"\n    output = [input_points[0]]\n    \n    for i in range(1, len(input_points)):\n        p1 = input_points[i-1]\n        p2 = input_points[i]\n        dist = math.sqrt(\n            (p2[0]-p1[0])**2 + \n            (p2[1]-p1[1])**2 + \n            (p2[2]-p1[2])**2\n        )\n        num_points = max(2, int(dist \u002F tolerance))\n        \n        for j in range(1, num_points):\n            t = j \u002F num_points\n            output.append((\n                p1[0] + (p2[0]-p1[0]) * t,\n                p1[1] + (p2[1]-p1[1]) * t,\n                p1[2] + (p2[2]-p1[2]) * t\n            ))\n    \n    return output\n\ndef verify_toolpath(\n    toolpath: List[Tuple[float, float, float]],\n    machine_limits: dict\n) -> List[str]:\n    \"\"\"Verify toolpath against machine limits.\"\"\"\n    warnings = []\n    \n    for i, (x, y, z) in enumerate(toolpath):\n        if x \u003C machine_limits[\"x_min\"] or x > machine_limits[\"x_max\"]:\n            warnings.append(f\"Point {i}: X={x:.3f} out of range\")\n        if y \u003C machine_limits[\"y_min\"] or y > machine_limits[\"y_max\"]:\n            warnings.append(f\"Point {i}: Y={y:.3f} out of range\")\n        if z \u003C machine_limits[\"z_min\"] or z > machine_limits[\"z_max\"]:\n            warnings.append(f\"Point {i}: Z={z:.3f} out of range\")\n    \n    return warnings\n\n# Example: Post-processor\nconfig = PostProcessorConfig(\n    machine_type=\"Haas VF-2\",\n    control_system=\"Fanuc\",\n    output_format=\"XYZ\",\n    arc_output=\"IJ\",\n    tool_change_mcode=\"M6\",\n    coolant_on=\"M8\",\n    coolant_off=\"M9\"\n)\npost = generate_post_processor(config)\nprint(\"Header:\", post[\"header\"][1])\nprint(\"Footer:\", post[\"footer\"][1])\n```\n\n## Best Practices\n- Always verify toolpaths before cutting using simulation\n- Use proper work coordinate systems and origin points\n- Consider tool deflection and vibration in feed\u002Fspeed calculations\n- Use appropriate stock allowances for finish passes\n- Verify machine limits and tool lengths before running programs\n- Optimize toolpaths for reduced cycle time\n- Use proper fixturing to minimize vibration\n- Consider tolerances and shrink factors in CAD models\n- Document CAM settings and post-processor configuration\n- Test programs with air cuts before production runs\n","## What I do\n- Create 3D geometric models using CAD software\n- Generate CNC toolpaths for manufacturing\n- Program CNC machines using G-code and CAM software\n- Design for additive manufacturing (3D printing)\n- Perform toolpath simulation and verification\n- Optimize machining parameters for efficiency\n- Convert CAD models to manufacturing formats\n- Verify tool collision and machine limits\n\n## When to use me\nWhen creating 3D models, generating CNC toolpaths, programming CNC machines, or designing parts for additive manufacturing.\n\n## Core Concepts\n- Solid modeling (CSG, B-rep)\n- Surface modeling and NURBS\n- Feature-based modeling\n- Toolpath strategies (contour, pocketing, drilling)\n- CNC programming (G-code, M-code)\n- Feed and speed calculations\n- Tool geometry and compensation\n- Additive manufacturing processes (FDM, SLA, SLS)\n- Build orientation and support generation\n- Post-processing for different machine controllers\n\n## Code Examples\n\n### G-Code Generation\n```python\nfrom dataclasses import dataclass\nfrom typing import List, Tuple\nimport math\n\n@dataclass\nclass GCodeCommand:\n    code: str\n    x: float = None\n    y: float = None\n    z: float = None\n    f: float = None\n    s: float = None\n\ndef rapid_move(x: float, y: float, z: float) -> str:\n    \"\"\"Generate G0 rapid move command.\"\"\"\n    return f\"G0 X{x:.4f} Y{y:.4f} Z{z:.4f}\"\n\ndef linear_move(x: float, y: float, z: float, f: float) -> str:\n    \"\"\"Generate G1 linear move command.\"\"\"\n    return f\"G1 X{x:.4f} Y{y:.4f} Z{z:.4f} F{f:.1f}\"\n\ndef circular_move(\n    i: float, j: float, x: float, y: float,\n    direction: str = \"clockwise\",\n    f: float = 100\n) -> str:\n    \"\"\"Generate G2\u002FG3 circular move.\"\"\"\n    g_code = \"G2\" if direction == \"clockwise\" else \"G3\"\n    return f\"{g_code} X{x:.4f} Y{y:.4f} I{i:.4f} J{j:.4f} F{f:.1f}\"\n\ndef drill_cycle(\n    x: float, y: float,\n    z_start: float,\n    z_depth: float,\n    z_retract: float,\n    f_plunge: float,\n    f_rapid: float\n) -> List[str]:\n    \"\"\"Generate G81 drilling cycle.\"\"\"\n    return [\n        rapid_move(x, y, z_start),\n        f\"G81 R{z_retract} Z{z_depth} F{f_plunge}\",\n        f\"G80\",\n        rapid_move(x, y, z_retract)\n    ]\n\ndef canned_cycle(\n    cycle: str,\n    x: float, y: float,\n    r: float, z: float,\n    q: float = None,\n    f: float = 100\n) -> str:\n    \"\"\"Generate canned cycle command.\"\"\"\n    if q:\n        return f\"{cycle} R{r} Z{z} Q{q} F{f}\"\n    return f\"{cycle} R{r} Z{z} F{f}\"\n\n# Example: Simple part program\ngcode = [\n    \"G90 G21 G40\",  # Absolute, mm, cancel compensation\n    \"G54\",  # Work coordinate system 1\n    \"M6 T1\",  # Tool change to tool 1\n    \"M3 S3000\",  # Spindle on clockwise 3000 RPM\n    rapid_move(0, 0, 5),\n    linear_move(10, 0, -2, 100),\n    linear_move(10, 10, -2, 100),\n    linear_move(0, 10, -2, 100),\n    linear_move(0, 0, -2, 100),\n    \"M5\",  # Spindle off\n    \"M30\"  # Program end\n]\nfor line in gcode[:5]:\n    print(line)\n```\n\n### Toolpath Generation\n```python\nfrom typing import List, Tuple\nimport numpy as np\n\ndef offset_polygon(\n    vertices: List[Tuple[float, float]],\n    offset: float,\n    corner_style: str = \"round\"\n) -> List[Tuple[float, float]]:\n    \"\"\"Generate offset contour for tool radius compensation.\"\"\"\n    offset_vertices = []\n    n = len(vertices)\n    \n    for i in range(n):\n        p1 = vertices[i]\n        p2 = vertices[(i + 1) % n]\n        p0 = vertices[(i - 1) % n]\n        \n        v1 = np.array(p2) - np.array(p1)\n        v0 = np.array(p1) - np.array(p0)\n        \n        angle1 = math.atan2(v1[1], v1[0])\n        angle0 = math.atan2(v0[1], v0[0])\n        \n        if corner_style == \"round\":\n            radius = offset\n            center = np.array(p1) + np.array([\n                radius * math.cos((angle0 + angle1) \u002F 2),\n                radius * math.sin((angle0 + angle1) \u002F 2)\n            ])\n            # Generate arc points\n            for t in np.linspace(0, 1, 9):\n                angle = angle0 + (angle1 - angle0) * t\n                offset_vertices.append((\n                    center[0] + radius * math.cos(angle + math.pi\u002F2),\n                    center[1] + radius * math.sin(angle + math.pi\u002F2)\n                ))\n        else:\n            # Miter join\n            bisector = (angle0 + angle1) \u002F 2\n            offset_vertices.append((\n                p1[0] + offset * math.cos(bisector + math.pi\u002F2),\n                p1[1] + offset * math.sin(bisector + math.pi\u002F2)\n            ))\n    \n    return offset_vertices\n\ndef raster_toolpath(\n    bbox: Tuple[float, float, float, float],\n    stepover: float,\n    direction: str = \"x\"\n) -> List[Tuple[float, float]]:\n    \"\"\"Generate raster (zigzag) toolpath.\"\"\"\n    xmin, xmax, ymin, ymax = bbox\n    path = []\n    \n    if direction == \"x\":\n        for y in np.arange(ymin, ymax, stepover):\n            if (y - ymin) \u002F stepover % 2 == 0:\n                path.extend([(xmin, y), (xmax, y)])\n            else:\n                path.extend([(xmax, y), (xmin, y)])\n    else:\n        for x in np.arange(xmin, xmax, stepover):\n            if (x - xmin) \u002F stepover % 2 == 0:\n                path.extend([(x, ymin), (x, ymax)])\n            else:\n                path.extend([(x, ymax), (x, ymin)])\n    \n    return path\n\ndef spiral_toolpath(\n    center: Tuple[float, float],\n    start_radius: float,\n    end_radius: float,\n    angle_per_step: float = 0.1,\n    z_feed: float = 0.01\n) -> List[Tuple[float, float, float]]:\n    \"\"\"Generate spiral toolpath for drilling\u002Fmilling.\"\"\"\n    path = []\n    r = start_radius\n    theta = 0\n    \n    while r \u003C= end_radius:\n        x = center[0] + r * math.cos(theta)\n        y = center[1] + r * math.sin(theta)\n        z = -r \u002F end_radius * 5  # Example z-depth\n        path.append((x, y, z))\n        r += 0.05\n        theta += angle_per_step\n    \n    return path\n\ndef trochoidal_milling(\n    center: Tuple[float, float],\n    radius: float,\n    slot_width: float,\n    stepdown: float,\n    total_depth: float\n) -> List[Tuple[float, float, float]]:\n    \"\"\"Generate trochoidal milling toolpath.\"\"\"\n    path = []\n    current_depth = 0\n    \n    while current_depth \u003C total_depth:\n        current_depth += stepdown\n        if current_depth > total_depth:\n            current_depth = total_depth\n        \n        angle = 0\n        while angle \u003C 2 * math.pi:\n            x = center[0] + (radius + slot_width\u002F2 * math.cos(angle)) * math.cos(angle\u002F2)\n            y = center[1] + (radius + slot_width\u002F2 * math.cos(angle)) * math.sin(angle\u002F2)\n            z = -current_depth\n            path.append((x, y, z))\n            angle += 0.2\n    \n    return path\n\n# Example: Raster toolpath\nbbox = (0, 100, 0, 50)\npath = raster_toolpath(bbox, 10, \"x\")\nprint(f\"Generated {len(path)} path points\")\n```\n\n### Feeds and Speeds\n```python\n@dataclass\nclass ToolParameters:\n    diameter: float  # mm\n    num_flutes: int\n    material: str\n    hardness: float  # HRC\n\n@dataclass\nclass MaterialProperties:\n    name: str\n    hardness: float  # HB or HRC\n    tensile_strength: float  # MPa\n    machinability_rating: float\n\ndef calculate_spindle_speed(\n    cutting_speed: float,\n    tool_diameter: float\n) -> float:\n    \"\"\"Calculate spindle RPM.\"\"\"\n    return (1000 * cutting_speed) \u002F (math.pi * tool_diameter)\n\ndef calculate_feed_rate(\n    spindle_speed: float,\n    feed_per_tooth: float,\n    num_flutes: int\n) -> float:\n    \"\"\"Calculate feed rate mm\u002Fmin.\"\"\"\n    return spindle_speed * feed_per_tooth * num_flutes\n\ndef calculate_material_removal_rate(\n    width: float,\n    depth: float,\n    feed_rate: float\n) -> float:\n    \"\"\"Calculate MRR mm³\u002Fmin.\"\"\"\n    return width * depth * feed_rate\n\ndef calculate_power_requirement(\n    mrr: float,\n    specific_energy: float\n) -> float:\n    \"\"\"Calculate cutting power kW.\"\"\"\n    return mrr * specific_energy \u002F 60000\n\ndef estimate_feeds_speeds(\n    material: str,\n    tool_diameter: float,\n    num_flutes: int,\n    operation: str\n) -> dict:\n    \"\"\"Estimate feeds and speeds based on material and operation.\"\"\"\n    material_data = {\n        \"aluminum\": {\"vc\": 200, \"fz\": 0.08, \"se\": 600},\n        \"steel\": {\"vc\": 100, \"fz\": 0.04, \"se\": 1500},\n        \"stainless\": {\"vc\": 70, \"fz\": 0.03, \"se\": 1800},\n        \"titanium\": {\"vc\": 50, \"fz\": 0.02, \"se\": 2500}\n    }\n    \n    modifiers = {\n        \"roughing\": {\"vc_mult\": 1.2, \"fz_mult\": 1.2},\n        \"finishing\": {\"vc_mult\": 1.5, \"fz_mult\": 0.5},\n        \"slotting\": {\"vc_mult\": 0.6, \"fz_mult\": 0.8}\n    }\n    \n    m = material_data.get(material, material_data[\"steel\"])\n    op_mod = modifiers.get(operation, {\"vc_mult\": 1.0, \"fz_mult\": 1.0})\n    \n    vc = m[\"vc\"] * op_mod[\"vc_mult\"]\n    fz = m[\"fz\"] * op_mod[\"fz_mult\"]\n    \n    n = calculate_spindle_speed(vc)\n    vf, tool_diameter = calculate_feed_rate(n, fz, num_flutes)\n    \n    return {\n        \"spindle_speed_rpm\": n,\n        \"feed_rate_mm_min\": vf,\n        \"chip_load_mm_tooth\": fz\n    }\n\n# Example: Feeds and speeds\nsettings = estimate_feeds_speeds(\"aluminum\", 10, 4, \"roughing\")\nprint(f\"Spindle speed: {settings['spindle_speed_rpm']:.0f} RPM\")\nprint(f\"Feed rate: {settings['feed_rate_mm_min']:.1f} mm\u002Fmin\")\n```\n\n### Additive Manufacturing\n```python\n@dataclass\nclass AMBuildSettings:\n    layer_height: float  # mm\n    infill_percentage: float\n    infill_pattern: str\n    build_temperature: float  # C\n    bed_temperature: float  # C\n    print_speed: float  # mm\u002Fs\n    support_type: str\n\ndef estimate_build_time(\n    num_layers: int,\n    layer_area: float,\n    print_speed: float,\n    travel_speed: float = 150,\n    layer_change_time: float = 5\n) -> float:\n    \"\"\"Estimate total build time in hours.\"\"\"\n    print_time = (num_layers * layer_area) \u002F print_speed \u002F 60\n    travel_factor = 0.3\n    layer_time = num_layers * layer_change_time \u002F 60\n    return (print_time * (1 + travel_factor) + layer_time) \u002F 60\n\ndef calculate_material_usage(\n    volume_mm3: float,\n    infill_percentage: float = 20,\n    support_percentage: float = 10\n) -> float:\n    \"\"\"Calculate required material in grams.\"\"\"\n    density = 1.24  # PLA g\u002Fcm³\n    volume_cm3 = volume_mm3 \u002F 1000\n    total_volume = volume_cm3 * (1 + infill_percentage\u002F100) * (1 + support_percentage\u002F100)\n    return total_volume * density\n\ndef optimize_build_orientation(\n    surface_area: float,\n    build_volume: Tuple[float, float, float],\n    min_surface_roughness: bool = True,\n    max_strength: bool = False\n) -> Tuple[float, float, float]:\n    \"\"\"Optimize part orientation for 3D printing.\"\"\"\n    x, y, z = build_volume\n    \n    if min_surface_roughness:\n        return (x, y, 0.1)  # Largest flat surface down\n    elif max_strength:\n        return (0.1, y, z)  # Layer lines perpendicular to load\n    return (x, y, z)\n\ndef generate_support_structure(\n    overhang_angle_threshold: float = 45,\n    support_density: float = 0.2\n) -> List[dict]:\n    \"\"\"Generate support structure parameters.\"\"\"\n    return [{\n        \"angle_threshold\": overhang_angle_threshold,\n        \"density\": support_density,\n        \"style\": \"tree\" if support_density \u003C 0.15 else \"grid\"\n    }]\n\n# Example: Build estimation\nbuild = AMBuildSettings(\n    layer_height=0.2,\n    infill_percentage=20,\n    infill_pattern=\"grid\",\n    print_speed=60\n)\ntime = estimate_build_time(100, 50*50, 60)\nmaterial = calculate_material_usage(100*100*100, 20, 10)\nprint(f\"Estimated build time: {time:.1f} hours\")\nprint(f\"Material required: {material:.1f} g\")\n```\n\n### CAM Post-Processing\n```python\n@dataclass\nclass PostProcessorConfig:\n    machine_type: str\n    control_system: str\n    output_format: str\n    arc_output: str\n    tool_change_mcode: str\n    coolant_mcodes: Tuple[str, str]\n\ndef generate_post_processor(\n    config: PostProcessorConfig\n) -> dict:\n    \"\"\"Generate post-processor configuration.\"\"\"\n    return {\n        \"header\": [\n            f\"O1234 ({config.machine_type} program)\",\n            \"G90 G21 G40\",\n            f\"G54 (Work coordinate: {config.control_system})\"\n        ],\n        \"tool_change\": f\"M6 T#{{TOOL_NUMBER}} ({config.tool_change_mcode})\",\n        \"coolant_on\": config.coolant_mcodes[0],\n        \"coolant_off\": config.coolant_mcodes[1],\n        \"arc_format\": config.arc_output,\n        \"footer\": [\"M5\", \"M30\"]\n    }\n\ndef interpolate_gcode(\n    input_points: List[Tuple[float, float, float]],\n    tolerance: float = 0.01\n) -> List[Tuple[float, float, float]]:\n    \"\"\"Interpolate toolpath with tolerance.\"\"\"\n    output = [input_points[0]]\n    \n    for i in range(1, len(input_points)):\n        p1 = input_points[i-1]\n        p2 = input_points[i]\n        dist = math.sqrt(\n            (p2[0]-p1[0])**2 + \n            (p2[1]-p1[1])**2 + \n            (p2[2]-p1[2])**2\n        )\n        num_points = max(2, int(dist \u002F tolerance))\n        \n        for j in range(1, num_points):\n            t = j \u002F num_points\n            output.append((\n                p1[0] + (p2[0]-p1[0]) * t,\n                p1[1] + (p2[1]-p1[1]) * t,\n                p1[2] + (p2[2]-p1[2]) * t\n            ))\n    \n    return output\n\ndef verify_toolpath(\n    toolpath: List[Tuple[float, float, float]],\n    machine_limits: dict\n) -> List[str]:\n    \"\"\"Verify toolpath against machine limits.\"\"\"\n    warnings = []\n    \n    for i, (x, y, z) in enumerate(toolpath):\n        if x \u003C machine_limits[\"x_min\"] or x > machine_limits[\"x_max\"]:\n            warnings.append(f\"Point {i}: X={x:.3f} out of range\")\n        if y \u003C machine_limits[\"y_min\"] or y > machine_limits[\"y_max\"]:\n            warnings.append(f\"Point {i}: Y={y:.3f} out of range\")\n        if z \u003C machine_limits[\"z_min\"] or z > machine_limits[\"z_max\"]:\n            warnings.append(f\"Point {i}: Z={z:.3f} out of range\")\n    \n    return warnings\n\n# Example: Post-processor\nconfig = PostProcessorConfig(\n    machine_type=\"Haas VF-2\",\n    control_system=\"Fanuc\",\n    output_format=\"XYZ\",\n    arc_output=\"IJ\",\n    tool_change_mcode=\"M6\",\n    coolant_on=\"M8\",\n    coolant_off=\"M9\"\n)\npost = generate_post_processor(config)\nprint(\"Header:\", post[\"header\"][1])\nprint(\"Footer:\", post[\"footer\"][1])\n```\n\n## Best Practices\n- Always verify toolpaths before cutting using simulation\n- Use proper work coordinate systems and origin points\n- Consider tool deflection and vibration in feed\u002Fspeed calculations\n- Use appropriate stock allowances for finish passes\n- Verify machine limits and tool lengths before running programs\n- Optimize toolpaths for reduced cycle time\n- Use proper fixturing to minimize vibration\n- Consider tolerances and shrink factors in CAD models\n- Document CAM settings and post-processor configuration\n- Test programs with air cuts before production runs\n",{"name":5,"license":15,"metadata":36,"description":7,"compatibility":26},{"audience":37,"category":23},"engineers","main","2ea764e153842704d24a2e9aa4170441a7f03081",".opencode\u002Fskills\u002Fengineering\u002Fcad-cam","https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito","https:\u002F\u002Fgithub.com\u002FNeuralBlitz","nuralnexus.org","Independent Multidisciplinary Researcher, Creative Producer, and AI Systems Architect\r\nAn independent creator and research-driven systems designer.","2026-11-12 03:13:05",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add NeuralBlitz\u002FMito --skill cad-cam",{"tool":52,"command":53},"bunx","bunx skills add NeuralBlitz\u002FMito --skill cad-cam",{"tool":55,"command":56},"pnpm","pnpm dlx skills add NeuralBlitz\u002FMito --skill cad-cam","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fengineering\u002Fcad-cam\u002FSKILL.md",true,[],[61,76,89,102,110,125],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":31},"01M6HAZSAQK1S27CEZYAYJTQDX","wireless-communications","Wireless systems, mobile networks, and 5G\u002F6G","https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fwireless-communications\u002FSKILL.md",[],[68,69,70,71,23,72,73,74,26,75],"communications","wireless communications","wireless","systems","networks","5G","students","mobile",{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":31},"01M6HAZFX6E8NK3WZWDX5YCKYY","websockets","WebSocket implementation and best practices","https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fwebassembly\u002Fwebsockets\u002FSKILL.md",[],[78,83,84,85,26,86,87,88],"websocket implementation","time","implementation","real-time","websocket","best practices",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":31},"01M6HAZ6DAXBQ7QHXXM1EM7715","vulnerability-auditing","Vulnerability assessment and auditing","https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fvulnerability-auditing\u002FSKILL.md",[],[96,97,98,99,26,100,101],"vulnerability","vulnerability auditing","security","vulnerability assessment","cybersecurity","assessment",{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":31},"01M6HAZ3FKF3CS9Z3J96RVE2ZE","vulnerability-assessment","Finding and assessing security vulnerabilities","https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fvue\u002Fvulnerability-assessment\u002FSKILL.md",[],[99,96,101,98,109,26],"vulnerabilities",{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":31},"01M6HAYSHM6HKRKEHFP0SGZQX7","vlsi-design","Very-Large-Scale Integration circuit design and semiconductor engineering","https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fvlsi-design\u002FSKILL.md",[],[117,118,119,120,121,23,122,26,123,74,124],"vlsi design","VLSI","design","hardware","integration","computer","scale","circuit",{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":31},"01M6HAYPQ30FFE2JXD7WQJ8R6C","unsupervised","Unsupervised learning concepts","https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fvisualization\u002Funsupervised\u002FSKILL.md",[],[127,132,26,133,134,135,136,137],"learning","intelligence","unsupervised learning","machine","concepts","machine-learning"]