Updates the coordinates of an existing point in the program’s point list.
This function sets the point at the given index to a new position provided by either a tuple/list or separate coordinate arguments.
If the new position contains any non-finite values, the point's position is marked as NaN; otherwise, it is updated with the new coordinates.
planetcnc.points_set(idx, coord) planetcnc.points_set(idx, x, y, z) planetcnc.points_set(idx, x, y, z, a, b, c, u, v, w)
#! /usr/bin/env python import planetcnc # Example 1: Update a point 3 using a tuple for coordinates. updated_index = planetcnc.points_set(3, (1.0, 2.0, 3.0)) if updated_index is not None: print(f"Point at index {updated_index} updated with new coordinates.") # Example 2: Update a point 5 using separate x, y, z coordinates. updated_index = planetcnc.points_set(5, 4.0, 5.0, 6.0) if updated_index is not None: print(f"Point at index {updated_index} updated with new coordinates.") # Example 3: Update a point 2 using nine separate coordinate values. updated_index = planetcnc.points_set(2, 1.0, 2.0, 3.0, 0.1, 0.2, 0.3, 7.0, 8.0, 9.0) if updated_index is not None: print(f"Point at index {updated_index} updated with new coordinates.")