Table of Contents

Recording a Play and Keeping the Workpiece

Two ways a mission keeps something between runs: the workpiece as a mesh the next run can pick up, and a play written to a result folder so it can be shown again. The other command kinds are on The Other Commands.

Keeping the workpiece between runs

Two of the Output category's commands take the workpiece as it stands at their own point in the list. Record Meshed Geometry stores it in the application's mesh format so a later run can pick it back up; Export Meshed Geometry (STL) writes an STL for something outside the application to read.

Record Meshed Geometry carries a path — Cache/Workpiece.wct by default, because a recorded mesh is a rebuildable by-product of a run rather than a project asset — and one of four actions:

Action What it does
No Action nothing; the entry is a placeholder
Read always loads the file into the session
Write always writes the session's geometry to the file
Read On First Or Write reads the file if it exists and no machining step has been produced since the session was last reset; otherwise writes

The condition on the fourth is what makes the command usable more than once in one mission: the first such entry reads, and every one below a program writes. It is a property of the session, so a run started without a Reset inherits the previous run's steps and every such entry in it writes — the first one included. Building a mission around that is A Mission That Resumes.

Writing builds the mesh if the run has not built it yet, at the workpiece's Initial Resolution. A Machining Resolution command above or below the record does not change the width of the stock it writes; it governs how finely the programs below it cut. A missing file is not an error: writing it is what a run does. Reset on the command's panel deletes the file it points at, so the next run records afresh.

Export Meshed Geometry (STL) takes a path — Output/MeshedGeom.stl by default, since an export is something you asked for rather than a cache — and a resolution in millimetres for the triangles it writes; 0 uses the display mesh resolution. What it triangulates is the same mesh Record Meshed Geometry writes, built the same way — at the workpiece's Initial Resolution where nothing has cut it yet — so the STL resolution decides how finely that mesh is tessellated, not how finely it was cut.

The command's panel also has an Even Mesh checkbox, off unless you tick it. The exported mesh is made of cells of different sizes — large on flat faces, small along edges and fine detail — and a large cell can sit right beside much smaller ones, so the triangles change size abruptly there. With Even Mesh ticked, the mesh is refined first wherever that happens, so that neighbouring cells differ in size by at most a factor of two and the triangles change size gradually. Tick it when what reads the file prefers that — a mesher preparing an analysis, a remesher, some CAD imports. Otherwise leave it off: the file is smaller, and identical to the one written before the option existed.

Even Mesh changes the file, not the workpiece. A play after the export runs exactly as it would without it. The file holds somewhat more triangles — 0.2 % to 8 % more on the nineteen parts measured — and describes the same surface: a cell that needs no refinement gives exactly the triangles it gives without the option. Where the command's resolution is coarser than the mesh, nothing is refined below that resolution. It does not close the model: where a cell meets smaller ones, the triangles still meet at T-junctions — a vertex of a small triangle on the edge of a larger one — only now the neighbour is at most half the size. And on some parts a few places keep a larger step in size: a cell is left as it was where the surface data stored for it and for its neighbours do not agree exactly, or where the surface passes exactly through a grid point.

The project file holds the choice only while it is ticked, as <BalanceNeighbourLevels>true</BalanceNeighbourLevels> under the command, so a project saved before the option existed loads and saves unchanged. In a Script entry the choice is the third argument — ExportMeshedGeomToStl("Output/part.stl", 0, true); — and the OBJ and PLY exports, ExportMeshedGeomToObj and ExportMeshedGeomToPly, take it the same way and keep each cell's colour.

Recording the play and reviewing it

Record Play Result writes what the programs below it play — every step, tool path position and program block — into a result folder; Review Play Result later shows that play again from the folder, without playing it.

Record Play Result's Action is Begin Recording: the programs below it are recorded until the mission ends, the player stops, or an End Recording entry completes the folder. Put it above the programs it is to cover; below every program it records nothing and says NcResult-Record--Empty on Shell. Its Result Folder, relative to the project folder, defaults to Output/results/[NcName]-[timestamp] and receives result.db and, when the workpiece was meshed, the finished stock finish.wct. The row reads Record Play Result [Begin Recording · Output/results/[NcName]-[timestamp]].

Review Play Result's Action is Open Review or Close Review. Open Review's Result Folder left empty is the newest completed result: the one a recording still open at that point completes — the review ends the recording first, as in a mission of Record Play Result, the programs, Review Play Result — else the newest completed folder under Output/results. Opening clears the run and rebuilds the strip, the steps and the charts from the file, and the finished stock shows each cut face in the colour of the step that cut it, a click on the face selecting that step as during the play (a result recorded without the stock's node map shows the stock plain, and so do the faces a geometry difference compared before the recording ended); what the file does not hold reads Not in the play result, under a Reviewing … banner. Put it last in the mission: the review stays open until the next reset — Reset, a Close Review entry, a project switch — and a program played while it is open ends the run with Player-Run--Fault.

As the recording completes, the folder also receives luggage.db: the cutting-force arrays and the cutter–workpiece engagement of every recorded step, copied from the run's step cache before the recording ends (the end waits for the copy). Under review the Sim Cutting Force Cycle and Sim Spindle Moment Cycle charts draw the selected step from it, as during the play. When the drive has no room for the copy, counting the room the result file still needs to complete, the recording skips it with NcResult-Record--LuggageSkipped on Shell and the result completes without it; such a result, and one recorded before HiNC wrote luggage.db, reads Not in the play result in those two charts. The CWE panel reads Not in the play result in every review: a result keeps no step's contact contours.

A result recorded before HiNC kept where the stress ratio sits on the cutter lacks it. Its steps read the four values that place it (Evaluating Process Machinability) as not recorded: Stress Critical Height and Stress Onset Height as NaN, which Step Properties shows as -, and Stress Critical Zone and Stress Onset Zone as 0, which it shows as None. A step with no such section reads the same, so in such a result the four say nothing about the cutter; record the play again to have them. It does not work the other way round: a result recorded by a HiNC that keeps them does not open for review in one that predates them, where opening it says NcResult-Review--OpenFailed on Shell and leaves nothing under review.

In a Script entry, Begin Recording and End Recording are BeginNcResultRecording(…) and EndNcResultRecording(), and the mission's end completes a recording a script began as it does the command's. Ending a recording writes the finished stock from the workpiece, so EndNcResultRecording() — and BeginNcResultRecording(…) while a recording is open, since it ends that one first — follows the rules of a call that reads the workpiece: after an await, the player thread, which is waiting for the script, ends the recording for it; in a SessionStepBuilt handler the call is refused with MeshedGeomCall--OnPump, so end a recording in the script's body. A refused call says why on Shell, leaves the recording open and writes nothing — a refused begin begins no new one — and the mission's end completes the recording as usual.

Result folders are never deleted on their own. Each recording adds one; a Script entry clears them: DeleteNcResult("Output/results/…") deletes one — the files the recording wrote, then the folder if nothing else is in it, and never the folder under review: close the review first — and DeleteOrphanNcResults() clears the incomplete ones under Output/results, or under the folder you give it: a folder whose recording never ended is deleted unless another application is still recording into it, and one whose completion another application held up is completed. A recording lists the incomplete folders on Shell as it begins (NcResult-Record--OrphansFound).

See Also