Expand description
Mass properties of a part: computed from its geometry and the density the PART carries (never per occurrence), and the load-time migration of old occurrence-stored Mass/Material onto the part. MASS PROPERTIES OF A PART — computed from the part’s geometry and the density the PART carries, never typed in and never stored per occurrence.
§One source
Material and density are attributes of the PART definition: the
partAttributes record on the part’s own document (see bom.rs), edited
in the part’s Properties dialog or the BOM’s part columns. Everything that
shows a mass — the BOM row, the Info window, the BOM export, the MCP
readers — resolves it here, so they cannot disagree:
- a solid’s density is its own metadata
densitywhen one is set (a multi-material part’s per-body override), else its PART’sDensity, else the density of the part’sMaterialwhen that names a material this build knows (material_density), else none; - a part’s volume is the volume of the solids ONE placement of it
produces (every placement is the same rigid copy), from the existing
measurement cache (
object_info_json), so nothing re-executes the history per frame and a value is simply pending until the runner answers; - a part’s mass is
Σ volume × density. A part with NO geometry (a purchased or library part with nothing to measure) may carry a storedMassinstead: that is the only time a mass is typed, and it is still a part attribute.
Units: density in g/cm³ (what material tables quote), volume in mm³ (the kernel’s length unit), mass in kg.
§Old documents
A document saved before this rule may hold Mass / Material / Density
on its OCCURRENCES (the ACOMP’s bom record, or the occurrenceAttributes
key an older batch path wrote). migrate_occurrence_part_attributes
lifts them onto the part as the document opens, and says so once.
Structs§
- Mass
Report - One part’s (or one document’s) mass properties.
Enums§
- Density
Source - Where a resolved density came from.
- Mass
Status - What a mass reading is.
Constants§
- DENSITY_
KEY - The part’s density in g/cm³.
- DENSITY_
UNIT - MASS_
KEY - Computed for a part with geometry; a stored override only without.
- MASS_
UNIT - MATERIAL_
KEY - The part’s material name; resolves a density when no
Densityis set. - PART_
ONLY_ KEYS - The part attribute keys that describe the PART’s mass properties. None of them may be stored on an occurrence.
- VOLUME_
KEY - Derived — computed from geometry, never stored.
- VOLUME_
UNIT
Functions§
- format_
derived - The display text of a DERIVED part field (
Mass,Volume) with its unit;Nonefor any other field or a non-number. - format_
mass_ kg - A mass in kg as a reader wants it: kilograms from 1 kg up, grams below.
- format_
volume_ mm3 - A volume in mm³ as a reader wants it: cm³ from 1 cm³ up, mm³ below.
- material_
density - The built-in density (g/cm³) for a material NAME, or
Nonewhen the name matches nothing this build knows (then the part needs an explicitDensity). - migrate_
occurrence_ part_ attributes - Lift part-only attributes (
Mass,Material,Density) that an older document stored on its OCCURRENCES onto the PART, in place, before the document is loaded. Returns the notices to show (one per part whose occurrences disagreed or whose part already said otherwise, plus one summary of what moved). - part_
density - A part’s density from its attribute record: its
Density, else itsMaterial’s built-in density.