lagrange.scripts.meshstat

Print basic information about a mesh file.

Attributes

Functions

_colored(text, color)

_dtype_to_str(dtype)

_element_to_str(element)

_facet_type(mesh)

_normalize_uv_attribute(mesh, uv_attr_id)

Ensure the UV attribute is indexed and float64. Returns (id, name).

_safe_attribute_name(name)

_usage_to_str(usage)

collect_attributes(mesh, info)

Populate info["attributes"] with the list of user-visible attributes.

collect_basic_info(mesh, info)

Populate info["basic"] with mesh shape/bbox metadata.

collect_extended_info(mesh, info)

Populate info["extended"] with topology/manifoldness checks.

collect_uv_info(mesh, info, metrics)

Populate info["uv"] with per-UV-attribute metrics (charts/flips/overlap/seams/distortion).

compute_stats(values[, percentiles])

Return summary statistics for a 1-D numpy array, ignoring non-finite values.

main([argv])

parse_args([argv])

print_attributes(mesh, info)

print_bad(message)

print_basic_info(mesh, info)

print_extra_info(mesh, info)

print_header(message)

print_property(name, value[, expected])

print_section(message)

print_uv_info(info)

run(args)

save_info(mesh_file, info)

to_jsonable(value)

Convert numpy scalars/arrays/Path objects to JSON-serializable types.

Module Contents

lagrange.scripts.meshstat._colored(text, color)
Parameters:
  • text (str)

  • color (str)

Return type:

str

lagrange.scripts.meshstat._dtype_to_str(dtype)
Return type:

str

lagrange.scripts.meshstat._element_to_str(element)
Return type:

str

lagrange.scripts.meshstat._facet_type(mesh)
Return type:

tuple[str, dict | None]

lagrange.scripts.meshstat._normalize_uv_attribute(mesh, uv_attr_id)

Ensure the UV attribute is indexed and float64. Returns (id, name).

Parameters:

uv_attr_id (int)

Return type:

tuple[int, str]

lagrange.scripts.meshstat._safe_attribute_name(name)
Parameters:

name (str)

Return type:

str

lagrange.scripts.meshstat._usage_to_str(usage)
Return type:

str

lagrange.scripts.meshstat.collect_attributes(mesh, info)

Populate info["attributes"] with the list of user-visible attributes.

Parameters:

info (dict)

Return type:

None

lagrange.scripts.meshstat.collect_basic_info(mesh, info)

Populate info["basic"] with mesh shape/bbox metadata.

Initializes mesh edges if needed so num_edges is reported correctly (SurfaceMesh.num_edges returns 0 until initialize_edges has been called).

Parameters:

info (dict)

Return type:

None

lagrange.scripts.meshstat.collect_extended_info(mesh, info)

Populate info["extended"] with topology/manifoldness checks.

Parameters:

info (dict)

Return type:

None

lagrange.scripts.meshstat.collect_uv_info(mesh, info, metrics)

Populate info["uv"] with per-UV-attribute metrics (charts/flips/overlap/seams/distortion).

Assumes mesh is already a triangle mesh.

Parameters:
  • info (dict)

  • metrics (list)

Return type:

None

lagrange.scripts.meshstat.compute_stats(values, percentiles=(1, 10, 25, 75, 90, 99))

Return summary statistics for a 1-D numpy array, ignoring non-finite values.

Parameters:

values (numpy.ndarray)

Return type:

dict

lagrange.scripts.meshstat.main(argv=None)
Parameters:

argv (list | None)

Return type:

int

lagrange.scripts.meshstat.parse_args(argv=None)
Parameters:

argv (list | None)

Return type:

argparse.Namespace

lagrange.scripts.meshstat.print_attributes(mesh, info)
Parameters:

info (dict)

Return type:

None

lagrange.scripts.meshstat.print_bad(message)
Parameters:

message (str)

Return type:

None

lagrange.scripts.meshstat.print_basic_info(mesh, info)
Parameters:

info (dict)

Return type:

None

lagrange.scripts.meshstat.print_extra_info(mesh, info)
Parameters:

info (dict)

Return type:

None

lagrange.scripts.meshstat.print_header(message)
Parameters:

message (str)

Return type:

None

lagrange.scripts.meshstat.print_property(name, value, expected=None)
Parameters:

name (str)

Return type:

None

lagrange.scripts.meshstat.print_section(message)
Parameters:

message (str)

Return type:

None

lagrange.scripts.meshstat.print_uv_info(info)
Parameters:

info (dict)

Return type:

None

lagrange.scripts.meshstat.run(args)
Parameters:

args (argparse.Namespace)

Return type:

int

lagrange.scripts.meshstat.save_info(mesh_file, info)
Parameters:
  • mesh_file (str)

  • info (dict)

Return type:

pathlib.Path

lagrange.scripts.meshstat.to_jsonable(value)

Convert numpy scalars/arrays/Path objects to JSON-serializable types.

lagrange.scripts.meshstat._DISTORTION_METRIC_NAMES = ['Dirichlet', 'InverseDirichlet', 'SymmetricDirichlet', 'AreaRatio', 'MIPS']
lagrange.scripts.meshstat.logger