hertzforge.drawing.viz.sensors¶
sensors
¶
Sensor bodies drawn at their nodes: one triangle mesh for every sensor a
channel table places (core.sensors.place), so a model with hundreds of
sensors is one mesh rather than hundreds.
Each body is built about its own origin from its catalog size, turned into its frame and moved to its node, which is therefore the body's center. A triax's X, Y and Z faces carry their letters in black, as the sensors do; a uniaxial accelerometer or a force transducer carries a black arrow on each side along its sensing axis, pointing the positive way. The body is gray, the connector and the cable darker.
Bodies are true size where the geometry's units are defined. Where they are
not, a millimeter cannot be placed, and the bodies are drawn at a size
proportional to the model's instead. size multiplies either, about the
node, so the node stays at the center.
Every point of a body names the node it moves with (follow), so an
animation carries the bodies with their nodes: the shell gives each point
its node's motion.
Functions:
| Name | Description |
|---|---|
body |
A sensor's body in its own frame, in millimeters, centered on the |
millimeter |
A millimeter in the geometry's coordinates, and the note when it is |
sensor_bodies |
One mesh of every sensor's body at its node, in the geometry's |
rows_of |
|
Functions:¶
body
¶
A sensor's body in its own frame, in millimeters, centered on the
origin: (points, triangles, parts), where a triangle's part is 'body',
'connector' (the plug and a force transducer's studs), 'cable', or a
mark on the body: 'mark:X', 'mark:Y' and 'mark:Z' for a triax's letters,
'mark:shaft' and 'mark:head' for the arrow of a uniaxial accelerometer
or a force transducer, left out when marks is False.
millimeter
¶
A millimeter in the geometry's coordinates, and the note when it is only proportional to the model's size.
sensor_bodies
¶
sensor_bodies(sensors: list, geometry: Any, index: Callable[[int], int | None], size: float = 1.0) -> tuple[dict[str, ndarray] | None, list[str]]
One mesh of every sensor's body at its node, in the geometry's coordinates, and the notes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sensors
|
list of Sensor
|
From |
required |
geometry
|
Geometry
|
The geometry they are placed on. |
required |
index
|
callable
|
A node id's row among the view's nodes, or None when the view does
not draw it (its sensor's points are then |
required |
size
|
float
|
A multiple of true size (or of the proportional size, when the geometry's units are not defined), about each node. |
1.0
|
Returns:
| Name | Type | Description |
|---|---|---|
bodies |
dict or None
|
|
notes |
list of str
|
|
rows_of
¶
index for sensor_bodies over a view's drawn node ids.