Smooth (Euler / clothoid) waveguide bends lose less light than circular bends because their curvature changes
continuously instead of jumping. Layout tools like gdsfactory can generate those bends, but they do not
check an arbitrary routed path: where is the curvature too tight, where does it jump, and how much loss does
that cost? curvecheck answers that. Give it a path centerline and it returns the curvature profile, flags
minimum-radius violations and curvature discontinuities, and estimates the relative bend loss.
| Module | What it does | State |
|---|---|---|
curvature.py |
signed curvature kappa(s) along a path centerline | done |
mincurv.py |
minimum radius of curvature and curvature-DRC (flag R < R_min) | done |
discontinuity.py |
detect curvature jumps (straight-to-arc junctions) | done |
bendloss.py |
relative bend / transition loss estimate from the curvature profile | done |
pathio.py |
centerline from points, a JSON file, or a gdsfactory Path | done |
report.py |
structured report and a curvature-profile figure | done |
cli.py |
curvecheck path.json end to end |
done |
curvecheck path.json -o review/ --r-min 10 # writes review/report.md, report.json, curvature.pngimport report, pathio
rep = report.analyze(pathio.centerline("path.json"), r_min=10)
print(report.to_markdown(rep))A circular bend and an Euler bend of the same minimum radius, side by side:
== circular 90 degree bend, minimum radius 15 um ==
- minimum radius: 15 um (max curvature 0.0668 /um)
- curvature discontinuities: 2
- estimated relative bend loss: total 1.21 (transition 0.0356, radiation 1.17)
== euler 90 degree bend, minimum radius 15 um ==
- curvature discontinuities: 0
- estimated relative bend loss: total 0.949 (transition 0, radiation 0.949)
- no curvature issues found
The bend-loss number is a documented relative proxy (it ranks paths), not a calibrated dB figure.
python examples/quickstart.py # compare a circular and an Euler bend
python run_checks.py validate <name> # one module's self-check
python run_checks.py suite # pytest tests/
numpy,matplotlib.gdsfactoryis optional, for reading a Path centerline.