gcode_reader.emulate.statistics¶
Functions¶
|
Compute the XYZ bounding box of a G-code DataFrame. For AM-specific bounds, use |
|
Quick statistics for any G-code DataFrame. For AM-specific stats (layer count, deposition volume, etc.), use |
Module Contents¶
- gcode_reader.emulate.statistics.bounds_of_gcode_df(gcode: pandas.DataFrame, tag=None) tuple | None[source]¶
Compute the XYZ bounding box of a G-code DataFrame. For AM-specific bounds, use
AdditivePartinstead.- Parameters:
gcode (pd.DataFrame) – G-code DataFrame with absolute position columns.
tag (str, optional) – If provided, filter to rows whose
tagsstring contains this tag before computing bounds.
- Returns:
((x_min, y_min, z_min), (x_max, y_max, z_max)), orNoneif position columns are missing.- Return type:
- gcode_reader.emulate.statistics.gcode_statistics(gcode: pandas.DataFrame, flavor: dict = flavors['default'], words: Iterable = None) dict[source]¶
Quick statistics for any G-code DataFrame. For AM-specific stats (layer count, deposition volume, etc.), use
AdditivePartinstead.- Parameters:
gcode (pd.DataFrame) – Cleaned and tagged G-code DataFrame.
flavor (dict, optional) – Syntax definition for G-code. Defaults to flavors[“default”].
words (Iterable, optional) – Words (e.g.
"G1",("G", 1)) to count occurrences of. Defaults to[].
- Returns:
Statistics including line/word/command counts, positioning mode, units, bounding box, and elapsed time.
- Return type: