Skip to main content

Module mass_properties

Module mass_properties 

Source
Expand description

Mass properties of assemblies: the material library, the mass settings of revisions and files, and the roll-up of mass, centre of gravity and inertia tensor over the multi-level BOM (see massprops and docs/src/research/mass-properties.md).

  • Frames: every geometry file is taken as exported in the common assembly / vehicle frame – no placements are applied. A file shows instances units of its item; a BOM line contributes quantity / instances times the file’s body (copies at the same place when that is not 1, which is flagged).
  • Sources per revision, first that applies: the measured mass (with optional CG and inertia; it covers the whole sub-tree), the sum of the BOM children, the geometry file × density (override, else the material library entry of the revision’s material), the geometry file with the entered mass (uniform density), the entered mass alone (counts in the total mass but has no position), nothing (missing).
  • Computation: the mesh integrals come from the isolated preview process and are cached per content hash (Previews::mass_geometry); this module only scales and adds them (report is pure).
  • Read rights: the structure is loaded like the BOM page (bom::load_structure); restricted lines are left out and counted.

Structs§

GeometryFile
A file of a revision that can serve as geometry, with its settings.
MassLine
MassReport
MassSettings
The stored mass settings of a revision (defaults when none are stored).
MassSettingsUpdate
New mass settings of a revision (and of its geometry file).
Material
MaterialInput
The editable fields of a material.
RevisionMass
The mass settings of a revision the actor may read, its candidate geometry files and the file that is used.

Enums§

Source
Where the numbers of a line come from.

Constants§

GEOMETRY_FORMATS
Formats whose 3D preview can serve as geometry, in the order the automatic choice prefers them (exported meshes first, then STEP, then the lightweight representations stored in native CAD files).
MAX_DENSITY
Highest density accepted (kg/m³; osmium is 22 590).
MAX_GEOMETRY_FILES
Geometry files computed for one roll-up at most (each may need a conversion in the preview process).

Functions§

choose_geometry
Chooses the geometry file of a revision (None = back to automatic), keeping every other mass setting, like the one-click choice on the page. Same rules as update_settings.
create_material
Adds a material to the library (administrators).
delete_material
Removes a material from the library (administrators). Revisions keep their material text; their mass is then reported as missing a density.
material
materials
The material library, by name (every signed-in user may read it).
parse_point
Parses x,y,z (m); empty = the origin.
report_revision_ids
The revisions a report read (for the read log).
revision_settings
rollup
The mass properties of the structure below a revision the actor may read, under the revision rule; the inertia is also given about reference (m). Geometry is computed in the preview process (cached).
to_csv
The report as CSV: one row per line, the totals first as comment-free rows with level 0 (TOTAL, INERTIA_CG, INERTIA_REF).
update_material
Changes name, density and notes of a material (administrators).
update_settings
Stores the mass settings of a revision: density override, geometry file with its unit and instance count, measured values.
validate_density
Validates a density in kg/m³.