pointmesh¶
0-D container (PointMesh) – the ladder’s bottom rung.
Deliberately thin: a point cloud is not something this toolkit meshes, only something
the rungs above index into. There are no factories, no shape model and no lift /
lower here; what it carries is the coordinates and the tags on them, which
LineMesh reads as its own point tags.
- class nekmeshpy.pointmesh.PointMesh[source]¶
Bases:
objectThe ladder’s bottom rung: an
(N,3)point array and the tags on those points.A point has no interior, no orientation and no connectivity – its “incidence” is the identity, so element
iis pointi. That leaves only the two fields every rung has: the coordinates, and anTagsnaming whichever of them are named.It exists so the rule that holds between every other pair of rungs – a mesh’s side tags are its rung-below’s element tags – holds at the bottom too, rather than the line rung carrying a table of its own shape. Almost nothing constructs one directly:
LineMeshpromotes a bare(N,3)array into an untagged one, which is what a factory building fresh geometry wants. Reach for it when you need the tags to survive – a transform rebuilding a mesh around moved coordinates, or a point group named before there is a line to hang it on. There are deliberately no factories and no shape model here: a point cloud is not something this toolkit meshes, only something the rungs above index into.
- nekmeshpy.pointmesh.mirror(mesh, normal, point=array([0., 0., 0.]))[source]¶
The points reflected through the plane with
normalthroughpoint.A point has no orientation to re-wind, so unlike the rungs above this is only the coordinate map – the same exception
linemesh.morph.mirrordocuments for the line rung, one rung further down.
- nekmeshpy.pointmesh.retag_element(mesh, tags)[source]¶
The same mesh with its
element_tagschanged, by whattagsis: a mapping renames the existing names (a tag the map does not name is left alone, the map applies simultaneously, a key naming nothing raises, a rename toNO_TAGuntags); a string names every element; aTagsor per-element sequence replaces the table. Geometry and the side tags are untouched.
- nekmeshpy.pointmesh.rotate(mesh, angle, axis=array([0., 0., 1.]), center=array([0., 0., 0.]))[source]¶
The points rotated by
angleradians about the line throughcenteralongaxis(right-handed,axisneed not be normalized).
- nekmeshpy.pointmesh.scale(mesh, factor, center=array([0., 0., 0.]))[source]¶
The points scaled about
centerbyfactor– a scalar (uniform) or a(3,)per-axis vector. Every factor must be positive.
- nekmeshpy.pointmesh.transform(mesh, matrix, offset=array([0., 0., 0.]))[source]¶
The points mapped through the affine
p @ matrix.T + offset.
- nekmeshpy.pointmesh.transform_fn(mesh, fn)[source]¶
The points mapped through an arbitrary
fn–transformfor a warp that is not affine.fnis called once with the whole(N, 3)point array and must return(N, 3). Tags ride through verbatim.A point has no orientation and no signed measure, so – like
mirror()at this rung – this is only the coordinate map: anfnthat folds space is not caught here, thoughquadmesh.morph.transform_fnand the hex rung above do warn once there is a Jacobian to check.
- nekmeshpy.pointmesh.translate(mesh, vector)[source]¶
The points shifted rigidly by
vector(3,). Bit-exact: the offset is added without a matmul, so translating by0returns the identical coordinates.
pointmesh.pointmesh¶
0-D mesh container: the (N,3) point array the whole ladder is built on.
- class nekmeshpy.pointmesh.pointmesh.PointMesh[source]¶
Bases:
objectThe ladder’s bottom rung: an
(N,3)point array and the tags on those points.A point has no interior, no orientation and no connectivity – its “incidence” is the identity, so element
iis pointi. That leaves only the two fields every rung has: the coordinates, and anTagsnaming whichever of them are named.It exists so the rule that holds between every other pair of rungs – a mesh’s side tags are its rung-below’s element tags – holds at the bottom too, rather than the line rung carrying a table of its own shape. Almost nothing constructs one directly:
LineMeshpromotes a bare(N,3)array into an untagged one, which is what a factory building fresh geometry wants. Reach for it when you need the tags to survive – a transform rebuilding a mesh around moved coordinates, or a point group named before there is a line to hang it on. There are deliberately no factories and no shape model here: a point cloud is not something this toolkit meshes, only something the rungs above index into.
Operations¶
Fixed-arity, rung-preserving PointMesh operations (delta 0).
A point has no interior and no connectivity to re-wind, so this is the affine family
alone – linemesh.morph and the rungs above build
their own transform / translate / … on top of these for the shared points,
then map their private interior nodes through the same affine pair.
- nekmeshpy.pointmesh.morph.mirror(mesh, normal, point=array([0., 0., 0.]))[source]¶
The points reflected through the plane with
normalthroughpoint.A point has no orientation to re-wind, so unlike the rungs above this is only the coordinate map – the same exception
linemesh.morph.mirrordocuments for the line rung, one rung further down.
- nekmeshpy.pointmesh.morph.rotate(mesh, angle, axis=array([0., 0., 1.]), center=array([0., 0., 0.]))[source]¶
The points rotated by
angleradians about the line throughcenteralongaxis(right-handed,axisneed not be normalized).
- nekmeshpy.pointmesh.morph.scale(mesh, factor, center=array([0., 0., 0.]))[source]¶
The points scaled about
centerbyfactor– a scalar (uniform) or a(3,)per-axis vector. Every factor must be positive.
- nekmeshpy.pointmesh.morph.transform(mesh, matrix, offset=array([0., 0., 0.]))[source]¶
The points mapped through the affine
p @ matrix.T + offset.
- nekmeshpy.pointmesh.morph.transform_fn(mesh, fn)[source]¶
The points mapped through an arbitrary
fn–transformfor a warp that is not affine.fnis called once with the whole(N, 3)point array and must return(N, 3). Tags ride through verbatim.A point has no orientation and no signed measure, so – like
mirror()at this rung – this is only the coordinate map: anfnthat folds space is not caught here, thoughquadmesh.morph.transform_fnand the hex rung above do warn once there is a Jacobian to check.
- nekmeshpy.pointmesh.morph.translate(mesh, vector)[source]¶
The points shifted rigidly by
vector(3,). Bit-exact: the offset is added without a matmul, so translating by0returns the identical coordinates.
Vocabulary-only PointMesh operations: rename the tags, touch nothing else.
- nekmeshpy.pointmesh.tag.retag_element(mesh, tags)[source]¶
The same mesh with its
element_tagschanged, by whattagsis: a mapping renames the existing names (a tag the map does not name is left alone, the map applies simultaneously, a key naming nothing raises, a rename toNO_TAGuntags); a string names every element; aTagsor per-element sequence replaces the table. Geometry and the side tags are untouched.