polyfoammesh.core.stl_writer

Functions

estimate_stl_size(meshes)

Rough estimate of ASCII STL size in bytes for a set of meshes.

export_multisolid_stl(meshes, output_path)

export_surface_file(meshes, case_dir[, filename])

heal_mesh(mesh)

Apply trimesh repair operations to clean geometry before STL export.

validate_stl_solids(path)

Parse an ASCII STL and return {solid_name: face_count}.

write_ascii_stl(patches, filepath)

write_binary_stl(patches, filepath)

Write multi-solid STL in binary format (~5x faster, ~4x smaller).

polyfoammesh.core.stl_writer.heal_mesh(mesh)[source]

Apply trimesh repair operations to clean geometry before STL export.

Returns the mesh (mutated in-place) and logs any changes made.

Return type:

Trimesh

Parameters:

mesh (Trimesh)

polyfoammesh.core.stl_writer.write_binary_stl(patches, filepath)[source]

Write multi-solid STL in binary format (~5x faster, ~4x smaller).

Return type:

Path

Parameters:
polyfoammesh.core.stl_writer.write_ascii_stl(patches, filepath)[source]
Return type:

Path

Parameters:
polyfoammesh.core.stl_writer.export_multisolid_stl(meshes, output_path)[source]
Return type:

Path

Parameters:
polyfoammesh.core.stl_writer.export_surface_file(meshes, case_dir, filename='surface.stl')[source]
Return type:

Path

Parameters:
polyfoammesh.core.stl_writer.estimate_stl_size(meshes)[source]

Rough estimate of ASCII STL size in bytes for a set of meshes.

Return type:

int

Parameters:

meshes (list[Trimesh])