polyfoammesh.commercial.batch_mesh
Template-based batch meshing engine — journal system for CI/CD.
Records meshing actions into a replayable journal, then processes multiple geometry files sequentially or in parallel using the same template parameters.
- Features:
Journal recording (every action → timestamped JSON log)
Batch processing queue (N geometry files, same parameters)
CLI headless mode for CI/CD pipelines
Progress tracking and summary report
Functions
|
Headless CLI entry point for CI/CD integration. |
Classes
|
Configuration for a batch meshing run. |
|
A single geometry file in the batch queue. |
|
Template-based batch meshing engine. |
|
Summary report for a batch meshing run. |
- class polyfoammesh.commercial.batch_mesh.BatchEntry(geometry_path, label='', status='pending', cell_count=0, wall_time_s=0.0, error='')[source]
Bases:
objectA single geometry file in the batch queue.
- Parameters:
- class polyfoammesh.commercial.batch_mesh.BatchConfig(geometry_dir='', output_dir='', pattern='*.step', max_cell=0.05, min_cell=0.01, detail='medium', bl_enabled=False, bl_n_layers=3, parallel=False, n_cores=1)[source]
Bases:
objectConfiguration for a batch meshing run.
- Parameters:
- class polyfoammesh.commercial.batch_mesh.BatchReport(total=0, succeeded=0, failed=0, entries=<factory>, started_at='', wall_time_s=0.0)[source]
Bases:
objectSummary report for a batch meshing run.
- Parameters:
- entries: list[BatchEntry]
- class polyfoammesh.commercial.batch_mesh.BatchMesher(of_config=None)[source]
Bases:
objectTemplate-based batch meshing engine.
Usage (CLI):
python -m polyfoammesh.commercial.batch_mesh \ --geometry-dir ./models --pattern "*.step" \ --max-cell 0.05 --min-cell 0.01
Usage (API):
bm = BatchMesher() bm.add_file("model1.step") bm.add_file("model2.step") report = bm.run_all() print(f"{report.succeeded}/{report.total} succeeded")
- Parameters:
of_config (OFConfig | None)
- configure(config)[source]
- Return type:
- Parameters:
config (BatchConfig)
- add_directory(directory, pattern='*.step')[source]
Add all matching files from a directory. Returns count.