This repo offers the docker image of the regularization program to apply geometric preconditioning of a tessellation-based mesh (generated from Voronoi/Laguerre tessellations) as described in the Regularization of tessellation-based polyhedral models for robust and efficient finite element simulation of bioinspired composites paper.
- Docker Desktop (Windows/macOS) or Docker Engine (Linux) installed and running.
regularizer:latestdocker image obtained from the release package.- The
install.ps1,install.bat, orinstall.shscripts from cloning the repo.
-
Pull the published image:
docker pull docker.io/rumi381/regularizer:latest
-
Set
REG_IMAGEso wrappers use the pulled image:- PowerShell / Windows Terminal:
setx REG_IMAGE "rumi381/regularizer:latest" - Bash / zsh:
export REG_IMAGE=rumi381/regularizer:latest
- PowerShell / Windows Terminal:
Instead of typing the full path every time, you can install a global regularize command:
Step 1: Run the installation script
cd regularizer
.\install.ps1Trobleshoot: If running script is blocked in your system, run the following command before running the install.ps1
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSignedStep 2: Set up the regularize command (run the following step-by-step as Administrator)
- Step A: Create Scripts directory and regularize command
# Step A: Create Scripts directory and regularize command $ScriptsDir = "C:\Scripts" if (-not (Test-Path $ScriptsDir)) { New-Item -ItemType Directory -Path $ScriptsDir }
- Step B: Create regularize.bat wrapper
$BatchContent = '@echo off powershell.exe -ExecutionPolicy Bypass -File "C:\Users\%USERNAME%\.local\bin\reg.ps1" %*' $BatchContent | Out-File -FilePath "$ScriptsDir\regularize.bat" -Encoding ASCII
- Sep C: Add to PATH
$CurrentPath = [Environment]::GetEnvironmentVariable("PATH", "User") if ($CurrentPath -notlike "*$ScriptsDir*") { [Environment]::SetEnvironmentVariable("PATH", $CurrentPath + ";$ScriptsDir", "User") Write-Host "✓ Added $ScriptsDir to system PATH" -ForegroundColor Green } Write-Host "✅ Setup complete! Restart your terminal and use: regularize input.ovm --stats --bins 40" -ForegroundColor Green
Step 3: Test the command (restart PowerShell/Command Prompt first)
regularize -h
regularize --2d -h
regularize .\examples\UnitCube_poly1000_CLT200.ovm --stats
regularize --2d .\examples\RandomShape_poly.obj --stats --bins 40Step 1: Run the installation script
cd regularizer
chmod +x install.sh
./install.shThe script automatically creates the regularize command with help support
Note for WSL/Linux users: If you get "cannot execute: required file not found" error, run sed -i 's/\r$//' install.sh first to fix Windows line endings.
Step 2: Add to PATH and test
# Add to PATH (add this line to ~/.bashrc or ~/.zshrc)
export PATH="$HOME/.local/bin:$PATH"
# Reload shell
source ~/.bashrc # or source ~/.zshrc for zshStep 3: Restart the terminal and verify
regularize -h
regularize --2d -h
regularize .\examples\UnitCube_poly1000_CLT200.ovm --stats
regularize --2d .\examples\RandomShape_poly.obj --stats --bins 40The regularize command has two modes:
- 3D mode (default):
regularize INPUT_OVM [options] - 2D mode:
regularize --2d INPUT_OBJ [options]
-
Core/help:
-h, --help: print full 3D help- positional
INPUT_OVM: input OVM file path
-
Paths and templates:
-o, --out OUT_OVM: output OVM path (default<inputDir>/<name>_out.ovm)-c, --case CASE_DIR: OpenFOAM case dir (default<inputDir>/<name>_case)--dict PATH: collapseDict template path--mesh-quality PATH: meshQualityDict template path
-
Stats and logging:
--stats: print input OVM edge stats/histogram and exit--bins N: histogram bins for--stats(default30)--show-stats on|off: print input/output OVM edge stats during regularization (defaulton)--quiet on|off: condensed OpenFOAM logging (defaulton)--verbose: shorthand for--quiet off
-
Pass/behavior control:
--edges-only: run edge pass only (default behavior)--faces-only: run face pass only (skip initial edge pass)--faces on|off: toggle face pass (defaultoff)--faces-internal-only: run edge pass first, then face pass on internal faces only--skip-check on|off: toggle pre/post externalcheckMesh(defaulton, meaning skipped)--control-quality on|off: toggle quality feedback loop (defaulton)--maxPointErr N: max times a point may create bad faces before freezing (default5)--boundary-priority on|off: promote boundary vertices in point priority (defaultoff)
-
Collapse parameters:
-L, --minEdgeLen VAL: collapse edges shorter thanVAL(default1e-6)-A, --maxMergeAngle VAL: merge nearly inline edges up toVALdegrees (default30)--faceInitFactor VAL: initial face collapse length factor (default0.5)--faceToPointCoeff VAL: face-to-point collapse span coefficient (default0.3)--guardFraction VAL: guard fraction for sliver-face edge collapse (default0.1)--earlyPoint on|off: allow early face-to-point collapse (defaulton)--earlyPointCoeff VAL: early-collapse multiplier (default0.2)--maxIter N: max outer collapse iterations (default10)--smoothIter N: max reduction-factor smoothing sweeps (default2)--edgeReduce VAL: edge reduction factor near error regions (default0.5)--faceReduce VAL: face reduction factor near error regions (default0.5)--maxPointErr N: max times a point may create bad faces before freezing (default5)
-
Mesh-quality parameters:
--mq-maxNonOrtho VAL: max non-orthogonality (default65)--mq-maxBoundarySkew VAL: max boundary skewness (default20)--mq-maxInternalSkew VAL: max internal skewness (default4)--mq-maxConcave VAL: max concavity angle (default80)--mq-minVol VAL: minimum cell-pyramid volume (default1e-13)--mq-minTetQuality VAL: minimum tet quality (default1e-15)--mq-minArea VAL: minimum face area (default-1)--mq-minTwist VAL: minimum face twist (default0.02)--mq-minDeterminant VAL: minimum determinant (default0.001)--mq-minFaceWeight VAL: minimum face weight (default0.05)--mq-minVolRatio VAL: minimum neighbour volume ratio (default0.01)--mq-minTriangleTwist VAL: minimum triangle twist (default-1)--mq-minEdgeLength VAL: minimum edge length check (default-1)
Use --2d to operate on planar OBJ meshes with the dedicated polygonal regularizer located in tools/2dMeshRegulizer. All 2D options are forwarded verbatim to polygonalMeshRegularizer.py, so existing workflows migrate directly. The output OBJ is written beside the input (or to --out).
-
Core/help:
-h, --help: print full 2D help- positional
INPUT_OBJ: input OBJ path -o, --out OUT_OBJ: output OBJ path (default<inputDir>/<name>_out.obj)
-
Stats and logging:
--stats: print input edge stats/histogram and exit--bins N: histogram bins for stats output (default30)--show-stats on|off: print input/output edge stats during regularization (defaulton)--verbose, -v: enable verbose run logs--precision, -p N: coordinate precision (default8)
-
Regularization controls:
-L, --minEdgeLen VAL: collapse threshold (default p10 of mesh if omitted)-maxA, --maxMergeAngle VAL: maximum polygon angle (default140)-minA, --minMergeAngle VAL: minimum polygon angle (default30)--minEdgeCount N: minimum edges per regularized polygon (default4)--maxIter N: max iterations (default: number of polygonal cells)
-
Boundary-collapse controls:
-albc, --allow-boundary-collapse: enable boundary-edge collapse-L_bc, --boundary-threshold VAL: boundary collapse threshold (default0.2 * minEdgeLen)
Use this section to choose knobs in terms of the regularize CLI. OpenFOAM dictionary names are shown only as mapping notes.
-
Pass-selection knobs:
--edges-only: safest/default behavior; only short-edge and inline-edge cleanup.--faces onor--faces-only: enables face-collapse logic; use when sliver/small faces remain after edge pass.--faces-internal-only: recommended first face-pass setting when boundary fidelity is important.
-
Primary aggressiveness knobs:
-L, --minEdgeLen: main edge-collapse threshold.- Increase to remove more short edges.
- Decrease to preserve resolution/detail.
-A, --maxMergeAngle: controls merging of nearly collinear two-edge chains.- Higher value merges straighter chains more aggressively.
-
Face-pass knobs (effective only when face pass runs):
--faceInitFactor: initial face-size trigger.- Higher value marks more faces as collapse candidates.
--faceToPointCoeff: bias toward collapse-to-point for very small faces.- Higher value increases point collapses.
--earlyPoint on|offand--earlyPointCoeff: allow/scale earlier point collapse.- Turn
offto favor edge-style face collapse first.
- Turn
--guardFraction: geometric safety margin for edge-collapse validity inside face collapse.- Higher value is more conservative.
-
Quality feedback/stability knobs:
--control-quality on|off: keeponfor production meshes;offremoves recovery loop and can admit poor cells.--maxIter: outer recovery iterations when quality issues appear.--smoothIter: smoothing passes for local reduction fields.--edgeReduce,--faceReduce: local reduction multipliers near problematic regions.- Lower values clamp local collapse lengths faster.
--maxPointErr: freezes repeatedly problematic points sooner/later.- Lower value = earlier freezing (more conservative).
-
Mesh-quality limit knobs (
--mq-*):--mq-maxNonOrtho(default65): upper bound on face non-orthogonality.- Stricter CFD/FEM robustness:
45-60. - Keep near default for general-purpose regularization.
- Stricter CFD/FEM robustness:
--mq-maxBoundarySkew(default20) and--mq-maxInternalSkew(default4): skewness caps.- If boundary distortion is acceptable, boundary limit can be looser than internal.
- For strict solvers, lower internal skew first.
--mq-maxConcave(default80): max face concavity angle.- Lower value enforces more convex faces but can reduce accepted collapses.
- Keep default unless concavity-driven issues are observed.
--mq-minVol(default1e-13): minimum cell-pyramid volume.- Increase when near-zero/negative volume risk appears after aggressive collapses.
- Avoid setting too high or many valid operations will be rejected.
--mq-minTetQuality(default1e-15): minimum face-decomposition tet quality.- Raise gradually for stricter element-shape control if solver conditioning is poor.
--mq-minArea(default-1, disabled): minimum face area.- Enable with a small positive value only if tiny faces remain problematic.
--mq-minTwist(default0.02): minimum face twist quality.- Increase if twisted faces remain; decrease only if it blocks necessary simplification.
--mq-minDeterminant(default0.001): minimum normalized cell determinant.- Increase for stronger protection against folded/degenerate cells.
--mq-minFaceWeight(default0.05): lower bound on interpolation/orthogonality face weight.- Increase for stricter stencil quality; may reduce accepted collapses near complex regions.
--mq-minVolRatio(default0.01): minimum neighboring-cell volume ratio.- Raise to avoid extreme size jumps between adjacent cells.
--mq-minTriangleTwist(default-1, effectively disabled): minimum per-triangle twist.- Enable only if downstream tooling explicitly requires this constraint.
--mq-minEdgeLength(default-1, disabled): extra quality-time minimum edge-length check.- Enable if you must block creation/persistence of very short edges during quality checks.
- Practical default guidance:
- For most meshes, defaults are a solid starting point and usually sufficient for robust regularization.
- Tighten only one or two limits at a time when specific quality defects persist.
- If collapses stall early, relax the most restrictive limit instead of loosening all limits together.
-
Operational/diagnostic knobs:
--skip-check off: run externalcheckMeshbefore/after pipeline.--show-stats on|off: print input/output OVM edge histograms around run.--boundary-priority on|off: preserve boundary vertices more strongly during OVM->FOAM conversion.
-
Core aggressiveness and convergence:
-L, --minEdgeLen: target edge-collapse threshold.- If omitted, threshold defaults to input P10 edge length.
- Increase for stronger cleanup; decrease to preserve detail.
--maxIter: max iterations.- Default is effective mesh-size scaling when left at parser default.
-
Shape-quality constraints:
-minA, --minMergeAngle: minimum interior angle allowed after candidate collapse.- Higher value prevents sharp angles; may reduce accepted collapses.
-maxA, --maxMergeAngle: maximum interior angle allowed.- Lower value avoids flat/elongated polygons; may reduce accepted collapses.
--minEdgeCount: minimum polygon side count after operations.- Higher value preserves richer polygons; lower allows stronger simplification.
-
Boundary processing:
-albc, --allow-boundary-collapse: enables boundary-edge collapse branch.-L_bc, --boundary-threshold: boundary collapse cutoff.- If omitted, uses
0.2 * --minEdgeLen(or0.2 * P10when-Lomitted).
- If omitted, uses
-
Stats/output controls:
--stats: print input stats/histogram and exit.--bins: histogram bins.--show-stats on|off: for regularization runs, print input and output stats.-p, --precision: OBJ output coordinate precision.-v, --verbose: detailed iteration/collapse logging.
-
2D tuning workflow:
- Run
--statsfirst, then choose-Lnear P10 or P25. - If too few collapses occur, increase
-Lor relax angle bounds. - If shape quality degrades, lower
-L, tighten-maxA, or increase-minA/--minEdgeCount.
- Run
Interpreting logs
- "Collapsing N small edges / in line edges": edge-collapsing activity. Raise
--minEdgeLen/--maxMergeAngleif too low. - "Collapsing X faces (to point = a, to edge = b)": face-collapsing activity. Raise
--faceInitFactoror--faceToPointCoeffto increase. - "Uncollapsed edges = U / T": edges dropped after consistency checks (preventing pinched faces/cell collapse). Large U suggests over-aggressive thresholds.
- "Number of bad faces": tracked quality issues across outer iterations; should decrease to zero as thresholds are relaxed/smoothed.
Use the same commands you would run when building the image locally—only the Docker image source changed.
-
Stats on a volumetric OVM mesh
regularize path/to/input_mesh.ovm --stats --bins 40
-
Full 3D regularization with custom tolerances
regularize path/to/input_mesh.ovm --faces-internal-only -L 0.5 -A 60 --faceInitFactor 0.9 --maxIter 100 --smoothIter 100
-
2D OBJ workflow
regularize --2d path/to/input_mesh.obj --stats regularize --2d path/to/input_mesh.obj -L 0.35 -albc -L_bc 0.1
For additional parameters, run regularize -h or regularize --2d -h.
For more details, you can read the regularization paper DOI. And if you use this regularization program in academic work, please cite:
@article{rumi2026regularization,
title={Regularization of tessellation-based polyhedral models for robust and efficient finite element simulation of bioinspired composites},
author={Rumi, Md Jalal Uddin and Zeng, Xiaowei},
journal={Advances in Engineering Software},
volume={217},
pages={104165},
year={2026},
publisher={Elsevier}
}You are now ready to work with the regularizer entirely from the distributed Docker image.