points2_from_array2

compas_occ.conversions.points2_from_array2(array)

Construct a list of lists of points from two-dimensional point array.

Parameters:
arrayTColgp_Array2OfPnt
Returns:
list[list[Point]]

Examples

>>> from itertools import product
>>> from OCC.Core.TColgp import TColgp_Array2OfPnt
>>> from OCC.Core.gp import gp_Pnt
>>> array2 = TColgp_Array2OfPnt(1, 2, 1, 3)
>>> array2.SetValue(1, 1, gp_Pnt(0, 0, 0))
>>> array2.SetValue(1, 2, gp_Pnt(1, 0, 0))
>>> array2.SetValue(1, 3, gp_Pnt(2, 0, 0))
>>> array2.SetValue(2, 1, gp_Pnt(0, 1, 0))
>>> array2.SetValue(2, 2, gp_Pnt(1, 1, 0))
>>> array2.SetValue(2, 3, gp_Pnt(2, 1, 0))
>>> points2 = points2_from_array2(array2)
>>> for i, j in product(range(len(points2)), range(len(points2[0]))):
...     print(points2[i][j])
Point(x=0.0, y=0.0, z=0.0)
Point(x=0.0, y=1.0, z=0.0)
Point(x=1.0, y=0.0, z=0.0)
Point(x=1.0, y=1.0, z=0.0)
Point(x=2.0, y=0.0, z=0.0)
Point(x=2.0, y=1.0, z=0.0)