Skip to content

hertzforge.io.point_files

point_files

Points measured with a coordinate measuring arm, read as a geometry.

Two files are read. A "Feature Measured Points Table" is what an arm's software exports for probed features: a header that gives the length unit, then one block per feature with its name and its points. A point file is bare x, y, z rows, as a laser scan is exported, with nothing said about units or what any point is.

Either way each point is a node. The points of a feature are one element group of measured-point elements, named as the file names the feature, so the features show under the geometry and are renamed or deleted there, and the geometry's coordinate system moves and turns the whole scan.

Functions:

Name Description
points_geometry

A geometry whose nodes are measured points.

sniff_table

Whether a file is a feature measured points table: its first cell

load_table

Read a feature measured points table as a geometry of points in

sniff_points

Whether a file is bare points: a POINT_SUFFIXES name whose rows

load_points

Read a file of bare x, y, z rows as a geometry of nodes.

Classes

Functions:

points_geometry

points_geometry(points: ndarray, length_unit: str | None = None, features: Sequence[str] | None = None, feature_of: ndarray | None = None) -> Geometry

A geometry whose nodes are measured points.

Parameters:

Name Type Description Default
points (array_like, [N, 3])

The points, which become nodes 1 to N in this order.

required
length_unit str

The unit the points are in; the geometry is unit-less without it.

None
features sequence of str

The name of each feature the points were measured as.

None
feature_of array_like of int, [N]

The row in features each point belongs to, or -1 for none.

None

Returns:

Type Description
Geometry

The nodes, and for each feature one element group of its name holding a measured-point element at each of its points. The groups take colors in turn so neighboring features differ.

sniff_table

sniff_table(path: str | PathLike) -> bool

Whether a file is a feature measured points table: its first cell says so.

load_table

load_table(path: str | PathLike, length_unit: str | None = None) -> Geometry

Read a feature measured points table as a geometry of points in named element groups.

Parameters:

Name Type Description Default
path str or path - like

The exported table (.csv).

required
length_unit str

The unit of the coordinates, in place of the one the file's Length Units row names.

None

Returns:

Type Description
Geometry

Every point as a node, numbered from 1, feature by feature in the file's order and, inside a feature, in the order the points were measured (the file lists them by deviation). Each feature is an element group of its name. The file's deviations and its other header rows are not kept.

Raises:

Type Description
ValueError

When the file holds no points.

sniff_points

sniff_points(path: str | PathLike) -> bool

Whether a file is bare points: a POINT_SUFFIXES name whose rows are three numbers each, with no header, and whose first column does not rise from row to row. A first column that rises is a time or a frequency, and that file is delimited data.

load_points

load_points(path: str | PathLike, length_unit: str | None = None) -> Geometry

Read a file of bare x, y, z rows as a geometry of nodes.

Parameters:

Name Type Description Default
path str or path - like

The point file, its columns parted by commas, semicolons, tabs or spaces.

required
length_unit str

The unit of the coordinates, which the file cannot state. Without it the geometry imports unit-less and the unit can be defined later.

None

Returns:

Type Description
Geometry

The points as nodes, numbered from 1 in file order, with no elements.

Raises:

Type Description
ValueError

When the rows are not three numbers each.