gcode
Domain: engineering — Manufacturing & Industrial Systems

Summary: Create machining toolpaths for the staged workpiece in PowerMill and deliver the required NC output.

Task prompt:
You are a CAM (Computer-Aided Manufacturing) engineer using Autodesk PowerMill.

## Your Task
Design toolpaths to machine workpiece **125162_319** using the provided blank PowerMill project.

## Input Files
- **PowerMill project** (blank, with pre-configured tools, zero toolpaths):
  `125162_319\input\125162-319-NCFM-T`
- **Ideal workpiece geometry** (.prt format): `125162_319\input\125162_319.prt`
- **Reference image**: `125162_319\input\125162_319.jpg`

## What You Must Do
1. Copy the PowerMill project from `125162_319\input\125162-319-NCFM-T` to `125162_319\output\125162-319-NCFM-T`
   (work on the copy so the original stays intact)
2. Open PowerMill from `125162_319\software\PowerMill 2025.lnk` and load the copied project at:
   `125162_319\output\125162-319-NCFM-T`
3. Study the ideal workpiece geometry (.prt file) to understand the target shape.
   The copied PowerMill project already contains the machine, stock, tool library,
   and workpiece setup; the `.prt` file is an external geometry reference.
4. Design toolpaths that will machine the workpiece from raw stock:
   - Use roughing toolpaths to remove bulk material
   - Use finishing toolpaths for surfaces requiring higher precision
   - Use the pre-configured tools already in the project (do NOT create new tools)
5. **Critical**: Ensure each toolpath has NO collisions and NO gouging
6. Run a stock model simulation to confirm the final result
7. **Save** the PowerMill project (Ctrl+S)

## Color Coding on the Workpiece
The .prt file has faces colored by precision requirement:
- Tight tolerance faces (e.g., VDI12/15): require finer finish toolpaths
- Loose tolerance faces (e.g., spray/texture faces): standard finish is acceptable

## Evaluation
Your toolpaths will be automatically evaluated by:
1. Gate check: PowerMill exports per-toolpath collision / gouge status; any collision
   or gouge reported in that export yields score 0
2. Geometric accuracy: your saved project is simulated to `output/agent_sim.stl`, then
   compared against a hidden expert `reference/reference_sim.stl`
3. STL scoring:
   - 10,000 surface points are sampled from the agent STL
   - final score = 0.70 * fraction within 0.3 mm of the reference surface
     + 0.30 * fraction within 2.0 mm

## Important
- Work ONLY within the project at `125162_319\output\125162-319-NCFM-T`
- Do NOT move or rename the project folder
- SAVE your project when finished

Required actions:
Open the staged blank PowerMill project for the selected workpiece.
Review the staged `.prt` geometry and `.jpg` visual reference.
Design roughing and finishing toolpaths using the preconfigured tool library.
Ensure the toolpaths have no collisions and no gouges.
Run a stock-model simulation in PowerMill.
Save the modified project inside `output/`.

Software: Python

Input files:
name: Blank PowerMill project
format: directory
description: cloned from the expert PM project with all toolpaths and stock models removed
name: Ideal workpiece geometry
format: `.prt`
description: agent-visible target geometry; colored faces communicate tolerance intent
name: Workpiece preview
format: `.jpg`
description: visual reference image