The Delta State and Key State objects transmit information about the identity, position, and role of all geometric elements at a particular moment in time during a material removal simulation. Each geometric element described by a Geometry Reference Object.
The delta state object is sent by the server with a nc:state
event, and can be requested by the client through the
/state/delta
endpoint.
{ 'project': string, 'workingstep': string, 'time_in_workingstep': 0, 'prev': string, 'geom': GeomRefObj[] }
Property | Unit | Description |
---|---|---|
Project | string | The name of the project this keystate applies to. |
workingstep | string | The ID of the workingstep that this state applies to. |
time_in_workingstep | N/A | Not currently used. Always zero. |
prev | string | Not currently used. Always an empty string. This field will eventually identify be the key state that this delta is based on. |
geom | GeomRefObj[] | An array of geometry reference objects that identify shape, role, and position information. |
An example of a delta update from an nc:state
websocket event pushed to the client.
{"project":"fishhead_dallas_sandvik-with-asis-10-6", "workingstep":"84315", "time_in_workingstep":0, "prev":"", "geom":[ {"id":"fffc7189-6cf8-463d-afba-cd05d9bfb80e", "shape|dynamicshape":"fffc7189-6cf8-463d-afba-cd05d9bfb80e.json", "xform":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1], "bbox":[-869.802,-961,-1565,869.802,1194.25,134.999], "usage":"machine"}, { Many more geometry references for other parts of the machine tool, as-is, to-be, cutter, and inprocess shapes. } ]}
The key state object is identical to the delta state, but does not have a "prev" property. It represents the most current full scene. The Keystate object is as follows
{ 'project': string, 'workingstep': string, 'time_in_workingstep': 0, 'geom': GeomRefObj[] }
{
'id': string,
<'shape': string>,
<'dynamicshape': string>,
'xform': double[16],
'bbox': double[6],
'usage': string
<'version': uint>,
}
Property | Type | Description |
---|---|---|
id | string | The UUID of the referenced shape. The client can request the
shape
with GET /nc/geometry/{id}
if it does not already have a cached version. |
shape | string | The ID string with a ".json" extension. The value is not important, but the "shape" and "dynamicshape" properties are mutually exclusive. A geometry reference with a "shape" property identifies CAD shape like a cutter or fixture may change position in space but will not change shape. |
dynamicshape | string | As above, a geometry reference with a "dynamicshape" property
identifies material removal volume that will change shape as well as
position over time. The client does not request this shape by ID,
instead it typically
calls GET
nc/geometry/delta/-1 to get the most recent removal shape.
|
xform | double[16] | The 4x4 transform matrix for the associated geometry.
The transform follows the GL usage shown below.
double m[16] = [ xi, xj, xk, 0.0, yi, yj, yk, 0.0, zi, zj, zk, 0.0, wx, wy, wz, 1.0 ]; |
bbox | double[6] | The bounding box of the associated geometry as the low X,Y,Z values and and the high X,Y,Z values . |
usage | string | A string keyword describing what the shape element represents.
Values are:
|
version | uint | The version of the dynamicshape geometry. Only used with dynamicshape references. |