Skip to content

pytha.create_cam_groove

Daniel Flassig edited this page Jun 12, 2026 · 1 revision

Creates a rectangular CAM groove stencil as a new face-part and attaches CAM machining information to it.

If this stencil comes to lie on the surface of another part, the slot is logically applied to that part. The machining direction is in along the negative w_axis. Note that the CAD geometry of the other part is not instantly modified - the machining operation is only applied by the CAM postprocessor.

Note: This function requires the Workshop license. Without it, the call raises an error. Use check_license_workshop to test for availability beforehand.

pytha.create_cam_groove(length, width, depth [,origin [,options]])
Parameter Type Description
length number Length of the groove (in u direction)
width number Width of the groove (in v direction, centered around the origin)
depth number Groove depth (in the negative w/normal direction)
origin {x,y,z} Optional: start point of the groove, centered on the v axis
options {...} Optional: a table that may contain the following options:
options.u_axis {x,y,z} Local coordinate u-axis for the orientation of the plane
options.v_axis {x,y,z} Local coordinate v-axis for the orientation of the plane
options.w_axis {x,y,z} Local coordinate w-axis for the orientation of the plane-normal
options.type string "saw" or "router" for the corresponding machining process
options.tool_name string Tool name that matches the "Name" field in the PYTHA Worshop settings tool table
options.length_correction string "minimum-void", "maximum-void" or "automatic-extension", where the void refers to the resulting slot

Return value

Type Description
element_handle An element handle of the newly created part

Remarks

This function is similar to create_rectangle, but the resulting part additionally carries the CAM machining information. In addition, the groove rectangle is centered in v direction. Half of the width is in +v, half in -v. This matches the CNC experience of running a tool along the u-axis.

Version Support:

Minimum PYTHA Version: V26

See also:

pytha, Workshop Functions, element handles, Axes and directions, create_cam_drill, create_rectangle

Clone this wiki locally