points_add()

Adds a new point to the program’s point list. The function accepts one of the following input formats:

Each element of the sequence used to fill the point’s coordinates. The number of elements in the sequence determines which coordinates are set.

The point is constructed with three components (x, y, z).

The point is constructed with a full nine-dimensional coordinate.

Syntax

planetcnc.points_add((x, y, z, a, b, c, u, v, w))
planetcnc.points_add(x, y, z)
planetcnc.points_add(x, y, z, a, b, c, u, v, w)

Parameters

Parameter Type Description
(x, y, z, a, b, c, u, v, w) tuple Tuple with 1 to 9 elements.
x, y, z float Three coordinate values.
x, y, z, a, b, c, u, v, w float Nine coordinate values.

Return Value

Examples

#! /usr/bin/env python 
 
import planetcnc
 
# Example 1: Add a point using a tuple (or list) with 3 coordinates.
new_count = planetcnc.points_add((1.0, 2.0, 3.0))
print(f"New points count: {new_count}")
 
# Example 2: Add a point using three separate numeric arguments.
new_count = planetcnc.points_add(4.0, 5.0, 6.0)
print(f"New points count: {new_count}")
 
# Example 3: Add a point using nine separate numeric arguments.
new_count = planetcnc.points_add(1.0, 2.0, 3.0, 0.1, 0.2, 0.3, 7.0, 8.0, 9.0)
print(f"New points count: {new_count}")

See also

points_clear
points_count
points_add
points_get
points_set
points_delete
points_load
points_save