pointsseq¶
Sequences of Points
.
- class nutils.pointsseq.PointsSequence(ndims)¶
Bases:
Singleton
Abstract base class for a sequence of
Points
.- Parameters:
ndims (
int
) – The dimension of the point coordinates.
Notes
Subclasses must implement
__len__()
andget()
.- static from_iter(value, ndims)¶
Create a
PointsSequence
from an iterator.- Parameters:
- Returns:
sequence
- Return type:
- static uniform(value, length)¶
Create a uniform
PointsSequence
.- Parameters:
- Returns:
sequence
- Return type:
- static empty(ndims)¶
Create an empty
PointsSequence
.- Parameters:
ndims (
int
) –- Returns:
sequence
- Return type:
- npoints¶
The total number of points in this sequence.
- __bool__(self)¶
Return
bool(self)
.
- abstract __len__(self)¶
Return
len(self)
.
- __iter__(self)¶
Implement
iter(self)
.
- __getitem__(index: int) Points ¶
- __getitem__(index: Union[slice, ndarray]) PointsSequence
Return
self[index]
.
- __add__(self, other)¶
Return
self+other
.
- __mul__(other: int) Points ¶
- __mul__(other: PointsSequence) PointsSequence
Return
self*other
.
- abstract get(self, index)¶
Return the points at
index
.
- take(self, indices)¶
Return a selection of this sequence.
- Parameters:
indices (
numpy.ndarray
, ndim: 1, dtype: int) – The indices of points of this sequence to select.- Returns:
points – The sequence of selected points.
- Return type:
- compress(self, mask)¶
Return a selection of this sequence.
- Parameters:
mask (
numpy.ndarray
, ndim: 1, dtype: bool) – A boolean mask of points of this sequence to select.- Returns:
sequence – The sequence of selected points.
- Return type:
- repeat(self, count)¶
Return this sequence repeated
count
times.- Parameters:
count (
int
) –- Returns:
sequence – This sequence repeated
count
times.- Return type:
- product(self, other)¶
Return the product of this sequence with another sequence.
- Parameters:
other (
PointsSequence
) –- Returns:
sequence – This product sequence.
- Return type:
- chain(self, other)¶
Return the chained sequence of this sequence with
other
.- Parameters:
other (
PointsSequence
) –- Returns:
sequence – The chained sequence.
- Return type:
- tri¶
Triangulation of interior.
A two-dimensional integer array with
ndims+1
columns, of which every row defines a simplex by mapping vertices into the list of points.
- hull¶
Triangulation of the exterior hull.
A two-dimensional integer array with
ndims
columns, of which every row defines a simplex by mapping vertices into the list of points. Note that the hull often does contain internal element boundaries as the triangulations originating from separate elements are disconnected.