Curveplate
Generate model railway flexible track laying templates as DXF, PDF, and 3D STP files.
Installation
pip install curveplate
Or install from source:
git clone https://github.com/gsdali/curveplate.git
cd curveplate
pip install -e .
Usage
Straight Template
Generate a straight track template:
curveplate -g 9 -t straight -l 100
-g 9: 9mm gauge (N scale)-t straight: Straight template-l 100: 100mm length
Curve Template
Generate a curved track template:
curveplate -g 16.5 -t curve -r 300 -a 45 --right
-g 16.5: 16.5mm gauge (OO/HO scale)-t curve: Curve template-r 300: 300mm inner radius-a 45: 45 degree arc--right: Curving to the right
Transition Template
Generate a transition (easement) curve:
curveplate -g 9 -t transition -r 200 -l 150 --left
-g 9: 9mm gauge-t transition: Transition template-r 200: End radius 200mm-l 150: Transition length 150mm--left: Curving to the left
3D STEP Export
Generate a 3D extruded template for CNC milling or 3D printing:
curveplate -g 9 -t straight -l 100 -3D 3
-3D 3: Extrude to 3mm thickness, outputs STP file
For 3D export, install with the stp optional dependency:
pip install curveplate[stp]
Command Reference
usage: curveplate [-h] [-v] [-o OUTPUT] [-p] [-d] [-s SIZE] [-b] [-3D THICKNESS]
-g GAUGE -t TYPE [-l LENGTH] [-a ARC] [-r RADIUS] [--left | --right]
Generate model railway flexible track laying templates
Output Options:
-o, --output OUTPUT Output filename (default: timestamp-based)
-p, --pdf Output PDF file
-d, --dxf Output DXF file
-s, --size SIZE Paper size: A0, A1, A2, A3, A4
-b, --border Add title block and drawing boundary
-3D, --extrude THICKNESS Extrusion thickness in mm, outputs STP file
Required Template Parameters:
-g, --gauge GAUGE Track gauge in mm (distance between rails)
-t, --type TYPE Template type: s(traight), c(urve), t(ransition)
Geometry Parameters:
-l, --length LENGTH Length in mm along inner rail
-a, --arc ARC Arc angle in degrees (for curves)
-r, --radius RADIUS Curve radius to inner rail in mm
--left Curve to the left
--right Curve to the right
Common Gauges
| Scale | Prototype Guage | Gauge (mm) |
|---|---|---|
| Z | 1435mm | 6.5 |
| N | 1435mm | 9 |
| 2mm | 1067mm | 7.1 |
| 2mm | 1435mm | 9.42 |
| 2mm | 1600mm | 10.5 |
| TT | 1435mm | 12 |
| HO/OO | 1435mm | 16.5 |
| S | 1435mm | 22.5 |
| O | 1435mm | 32 |
| G | 1435mm | 45 |
Dependencies
Core Dependencies
| Package | Version | Purpose |
|---|---|---|
| ezdxf | >=1.0.0 | DXF file generation |
| reportlab | >=4.0.0 | PDF file generation |
| geomdl | >=5.3.0 | NURBS curve calculations |
Optional Dependencies
| Package | Version | Purpose | Install |
|---|---|---|---|
| cadquery | >=2.4.0 | 3D STEP file export | pip install curveplate[stp] |
Development Dependencies
| Package | Version | Purpose |
|---|---|---|
| pytest | >=7.0.0 | Testing framework |
| ruff | >=0.1.0 | Linting |
Requirements
- Python >=3.13
Acknowledgments
This project was developed using Claude Code, powered by Claude Opus 4.5 (Anthropic).
License
MIT License - see LICENSE for details.
Metadata
Release files for curveplate 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| curveplate-0.1.1.tar.gz | 14.4 kB | With provenance | Details for curveplate-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| curveplate-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for curveplate-0.1.1-py3-none-any.whl |
Total release size: 27.6 kB
Release files / curveplate-0.1.1.tar.gz
| Download URL | curveplate-0.1.1.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e8799021c1165ddb84ef194047d634586c39da9c40fcab991dafad753736e711
|
|
BLAKE2b-256 checksum How to use checksums |
9bf9241fb174cf9b399bd138b2ee1e36308ccca5aad934ed18eb584746da3537
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 26, 2025.
Transparency logRelease files / curveplate-0.1.1-py3-none-any.whl
| Download URL | curveplate-0.1.1-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5570271bbb56987594c32a7afb16fc4078786a6043c79f3095fa6b224802a94e
|
|
BLAKE2b-256 checksum How to use checksums |
2f2573441faed6c53be9bee4a1544b0748314db1e1f0a4cbfcf40674d1914d12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 26, 2025.
Transparency logSecurity for curveplate 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for curveplate-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 26, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.