Skip to content

EckPhi/CustomThreads

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

41 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CustomThreads - 3D-Printed Metric Threads Generator

Generate standardized ISO metric thread profiles optimized for 3D printing in XML format.

Quick Start

Use the Web Generator

The browser generator is in web/index.html and is deployed through GitHub Pages.

cd web
python3 -m http.server 8080
  • Open http://localhost:8080
  • Generate and download 3DPrintedMetricThreads.xml
  • Use Copy Share Link to share a prefilled generator configuration via URL

Download Pre-Generated XML Files

The latest XML thread profiles are automatically generated and available as GitHub Releases:

πŸ‘‰ Download Latest Release

Simply download the 3DPrintedMetricThreads.xml file and follow the installation instructions below.

Install in Fusion 360

  1. Download 3DPrintedMetricThreads.xml from the latest release
  2. Save it to your Fusion 360 thread data directory:
    • Windows: %localappdata%\Autodesk\webdeploy\Production\<version>\Fusion\Server\Fusion\Configuration\ThreadData
    • macOS: ~/Library/Application Support/Autodesk/Webdeploy/production/<version>/Autodesk Fusion 360/Contents/Libraries/Applications/Fusion/Fusion/Server/Fusion/Configuration/ThreadData
  3. Restart Fusion 360
  4. When creating threads, select "3D-Printed Metric Threads V3" from the thread type dropdown

Note: You can automate this installation with the ThreadKeeper plugin, which reinstalls profiles automatically after each Fusion 360 update.

Project Structure

.
β”œβ”€β”€ .github/workflows/          # CI/CD pipeline
β”‚   β”œβ”€β”€ generate-xml-release.yml
β”‚   └── deploy-pages.yml
β”œβ”€β”€ src/customthreads/          # Python package (core logic)
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ models.py               # Thread model classes
β”‚   β”œβ”€β”€ generator.py            # XML generation utilities
β”‚   └── cli.py                  # Command-line interface
β”œβ”€β”€ tests/                      # Test suite
β”‚   └── test_main.py
β”œβ”€β”€ web/                        # GitHub Pages generator app
β”œβ”€β”€ pyproject.toml              # Poetry configuration
β”œβ”€β”€ README.md
└── .gitignore

Development

Installation

Install dependencies with Poetry:

poetry install

Generate XML Locally

Run the thread generator:

poetry run python -m customthreads.cli

This creates 3DPrintedMetricThreads.xml with:

  • Diameters: 8-50mm
  • Pitches: 1.0mm to 6.0mm (0.5mm steps)
  • Tolerance Classes: O.0, O.1, O.2, O.4, O.8

Customize Configuration

Edit src/customthreads/cli.py to customize parameters:

  • Pitch range (pitch_start, pitch_end, pitch_step)
  • Thread sizes (thread_sizes)
  • Tolerance offsets (tolerance_offsets)
  • Output filename (output_filename)
  • Thread metadata (thread_name, unit, thread_angle, thread_form)

Run Tests

poetry run pytest -v

All 12 tests should pass βœ“

Use as a Library

from customthreads import generate_xml

# Generate custom thread profiles
generate_xml(
		output_filename="custom_threads.xml",
		thread_name="My Custom Threads",
		unit="mm",
		thread_angle=60.0,
		thread_form=8,
		pitch_start=1.0,
		pitch_end=6.0,
		pitch_step=0.5,
		thread_sizes=list(range(8, 51)),
		tolerance_offsets=[0.0, 0.1, 0.2, 0.4, 0.8],
)

Automated Release Pipeline

How It Works

This project uses GitHub Actions to automatically generate and publish thread profiles as releases.

Workflow File: .github/workflows/generate-xml-release.yml

Trigger Events:

  • βœ… Every push to master branch
  • βœ… Manual trigger via GitHub Actions UI (workflow_dispatch)

Pipeline Steps:

  1. Set up Ubuntu environment with Python 3.11
  2. Install dependencies using Poetry
  3. Run test suite to verify code quality
  4. Generate XML thread profiles
  5. Create a GitHub Release with datetime-based version
  6. Upload XML file as release artifact

Release Versioning

  • Format: v{YYYY}.{MM}.{DD}-{HHMMSS}-r{RUN_NUMBER} (UTC time + workflow run number)
  • Examples:
    • v2026.03.29-100000-r5 = March 29, 2026 at 10:00:00 UTC, run 5
    • v2026.03.29-124530-r9 = March 29, 2026 at 12:45:30 UTC, run 9

Key Features

  • βœ… No committed XML files β€” generated automatically on every push
  • βœ… Version history β€” easy to compare profiles across releases
  • βœ… Quality assured β€” tests run before each release
  • βœ… One-click downloads β€” users get latest profiles from Releases page

Disable Auto-Release (Optional)

To switch to manual-only releases:

  1. Edit .github/workflows/generate-xml-release.yml
  2. Change the trigger to:
    on:
        workflow_dispatch:  # Manual trigger only
  3. Commit and push
  4. Releases can now be triggered manually from the Actions tab

Thread Specifications

Tolerance Classes

These offset values from nominal dimensions allow fine-tuning for different printing conditions:

Class Offset Use Case
O.0 0.0mm Tightest fit, best accuracy
O.1 +0.1mm Standard fit, most prints
O.2 +0.2mm Loose fit, easier to print
O.4 +0.4mm Very loose, coarse prints
O.8 +0.8mm Safety margin, worst-case prints

Generated Profile Range

Parameter Value
Diameters 8-50mm (all integer values)
Pitches 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0mm
Thread Type ISO Metric (60Β° flank angle)
Optimized for FDM 3D printing (0.2-0.3mm layer height)

GitHub Pages Deployment

The web app is deployed by .github/workflows/deploy-pages.yml.

  • Trigger: push to master when files under web change
  • Source artifact: web
  • Publish target: GitHub Pages environment

If Pages is not enabled yet in repository settings, enable it once and keep source as GitHub Actions.

License

See LICENSE file for details

References

About

Fusion 360 Thread Profiles for 3D-Printed Threads

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Python 44.0%
  • JavaScript 33.5%
  • HTML 11.9%
  • CSS 10.6%