A Python-based tool to design and generate custom tie patterns (specifically 7-fold ties) and export them as production-ready PDFs.
See it deployed here ties-marcopist.streamlit.app
- Customizable Dimensions: Adjust length, wide blade width, narrow blade width, and neck width.
- Fold Options: Support for 3, 5, and 7-fold tie constructions.
- Dynamic Preview: Visualize the pattern shape and cut pieces in real-time.
- PDF Export: Generate a 1:1 scale PDF with calibration squares, split across multiple pages for easy printing.
- Cut Ratios: Fine-tune where the tie is spliced into 3 pieces to fit your fabric.
This project uses uv for fast Python package management.
-
Clone the repository:
git clone <repository-url> cd tie-pattern
-
Install dependencies using
uv:uv sync
Run the Streamlit application:
uv run streamlit run src/ui.pyThis will open the application in your default web browser (usually at http://localhost:8501).
src/pattern.py: Core logic for geometry generation, folding calculations, and PDF export.src/ui.py: Streamlit user interface.pyproject.toml: Project dependencies and configuration.
The exported PDF is designed for printing on standard paper (A4/Letter).
- Scale: 1:1 (Real world size).
- Calibration: Each page includes a 10cm x 10cm red square. Always measure this square after printing to ensure your printer scaling is correct (set "Scale" to "100%" or "Do Not Scale" in print settings).
- Assembly: The pattern is split into 3 pieces (Wide Blade, Neck Piece, Narrow Blade).