pytha.push_local_coordinates - pytha-3d-cad/pytha-lua-api GitHub Wiki

Replaces the active coordinate system with a new local coordinate frame. This is especially useful when creating many parts with a given placement (i.e. the situation of a generator).

Similar to the Environment -> Local coo system function in the PYTHA user interface.

pytha.push_local_coordinates(origin, axis) 
Parameter Type Description
origin {x,y,z} Origin of the local coordinate system
axis {...} A table that may contain the following options:
axis.u_axis {x,y,z} u-axis of the local coordinate system
axis.v_axis {x,y,z} v-axis of the local coordinate system
axis.w_axis {x,y,z} w-axis of the local coordinate system

Return Value:

Type Description
integer Token that can be passed to pop_local_coordinates to ensure that the correct coordinate system is popped

Note:

Each local coordinate system has to be deactivated explicitly by pop_local_coordinates.

Multiple local coordinate systems can be nested. origin and axis always refer to the currently active parent-coordinate system.

See also:

pytha, Axes and directions, pop_local_coordinates