Generate model railway flexible track laying templates (DXF, PDF, STP)
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file curveplate-0.1.1.tar.gz.
File metadata
- Download URL: curveplate-0.1.1.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8799021c1165ddb84ef194047d634586c39da9c40fcab991dafad753736e711
|
|
| MD5 |
4dbc67fe4827b24c312c42f3b6f83bdc
|
|
| BLAKE2b-256 |
9bf9241fb174cf9b399bd138b2ee1e36308ccca5aad934ed18eb584746da3537
|
Provenance
The following attestation bundles were made for curveplate-0.1.1.tar.gz:
Publisher:
publish.yml on gsdali/curveplate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
curveplate-0.1.1.tar.gz -
Subject digest:
e8799021c1165ddb84ef194047d634586c39da9c40fcab991dafad753736e711 - Sigstore transparency entry: 779796169
- Sigstore integration time:
-
Permalink:
gsdali/curveplate@ad6c3726c45ce240765a53c52cebd7278dd7f312 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/gsdali
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ad6c3726c45ce240765a53c52cebd7278dd7f312 -
Trigger Event:
release
-
Statement type:
File details
Details for the file curveplate-0.1.1-py3-none-any.whl.
File metadata
- Download URL: curveplate-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5570271bbb56987594c32a7afb16fc4078786a6043c79f3095fa6b224802a94e
|
|
| MD5 |
b6e31fcb97539aac06989c824c160898
|
|
| BLAKE2b-256 |
2f2573441faed6c53be9bee4a1544b0748314db1e1f0a4cbfcf40674d1914d12
|
Provenance
The following attestation bundles were made for curveplate-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on gsdali/curveplate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
curveplate-0.1.1-py3-none-any.whl -
Subject digest:
5570271bbb56987594c32a7afb16fc4078786a6043c79f3095fa6b224802a94e - Sigstore transparency entry: 779796201
- Sigstore integration time:
-
Permalink:
gsdali/curveplate@ad6c3726c45ce240765a53c52cebd7278dd7f312 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/gsdali
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ad6c3726c45ce240765a53c52cebd7278dd7f312 -
Trigger Event:
release
-
Statement type: