State

/v3/nc/state/delta
/v3/nc/state/delta/save

/v3/nc/state/key
/v3/nc/state/loop
/v3/nc/state/loop/{loopstate}

/v3/nc/state/product/{eid}
/v3/nc/state/ws/{command}

Defined in state.js and MTstate.js

Get Modified Geometry

GET /v3/nc/state/delta

Getting the delta endpoint will return a delta state object describing the current scene for the most recent material removal.

Get Complete Scene Geometry

GET /v3/nc/state/key

A GET on the key endpoint will return a key state object describing the current scene for the most recent material removal.

Get Current Loop State

GET /v3/nc/state/loop

GET on the loop endpoint will return an object that describes the current status of the simulation loop. The object has a state field with a string value of "play" or "pause", a speed value for the playback speed, and the current spindle/feed values.

The value for the playback speed ranges from zero to infinity, with a baseline value of 100.

{
   "state": 	string,
   "speed":	double,
   "spindle":	double,
   "feed":	double
}
GET /v3/nc/state/loop
==> {"state":"play","speed":100,"spindle":-9947,"feed":1989.43}

Change Current Loop State

GET /v3/nc/state/loop/start
GET /v3/nc/state/loop/stop
GET /v3/nc/state/loop/{speed}

GET on the loop endpoint with an state argument will change the speed or running state of the simulation loop and return a status object as above with just the "state" and "speed" fields.

The acceptable values for state are the strings "start" and "stop", or a numeric speed value for the playback speed. If the simulation has changed from stopped to started, a nc:state event is sent to all clients with a string argument of "play". If the simulation has changed from stopped to started, a nc:state event is sent to all clients with a string argument of "pause".

The speed value ranges from zero to infinity, with a baseline value of 100. If the speed is changed, an nc:speed event is sent to all clients with a numeric argument indicating the new speed.

Get Geometry Reference for Product

GET /v3/nc/state/product/{eid}

GET on the state product endpoint with a numeric ID argument will return an key state object representing the product that is associated with the given eid.

GET /v3/nc/state/product/8052
==> {
   "project": "fishhead_dallas_sandvik-with-asis-11-22",
   "geom": [
   	   {"id":"6f2db813-ca58-480e-a92b-8e1d350d40e9",
 	    "shape": "6f2db813-ca58-480e-a92b-8e1d350d40e9.json",
 	    "xform":[0,-1,0,0,1,0,0,0,0,0,1,0,-47.1694,138.085,-50,1],
 	    "bbox": [-147.169,-166.915,-50,60.8691,138.085,5.99996e-10],
 	    "usage": ""}
 	    ]
}

Change Current Workingstep

GET /v3/nc/state/ws/next
GET /v3/nc/state/ws/prev
GET /v3/nc/state/ws/{id}

GET on the ws endpoint with an argument will change the current workingstep of the simulation loop. The acceptable argument values are the strings "next" and "prev", or a numeric ID for the workingstep to focus on.