Skip to main content

TubeCutterDXF

Programmatically create Spiral and Brickwork style patterns for rotary laser cutting tubing.

Creating a Pattern

from tubecutterdxf import CutPattern, CutBrick, CutSpiral, CutPartline, INCH

def newCutPattern():
    # Create the pattern container.  This stores the geometry and will help produce the DXF
    pattern = CutPattern()

    # Specify some general parameters
    OD = 1
    continuous = False # Change to True when ready to send to laser cutter

    # Define the cut pattern
    # Parting line at x = 0
    cutPartline = CutPartline(OD)
    # Spiral starting at x = 0.1in with 30deg cut followed by 10deg uncut repeating 5 times at a pitch of 0.1in with each cut increasing by 5deg and uncut portion decreasing by 5deg for each repetition.
    cutSpiral = CutSpiral(OD, 0.1 * INCH, 0, 30, 10, 0.1 * INCH, 5, variableCutLength=True, cutIncrease=5, unCutIncrease=-5, continuous=continuous)
    # Brick starting where cutSpiral left off with 3 90deg cuts equally spaced circumferentially and repeated 5 times with a pitch of 0.1in and each repetition offset by 45deg from the prior.  No variation in cut length.
    cutBrick = CutBrick(OD, cutSpiral.xNext, 0, 90, 3, 45, 0.1 * INCH, 5)
    
    # Add the cuts to the pattern container
    pattern.add(cutPartline)
    pattern.add(cutSpiral)
    pattern.add(cutBrick)

    # Preview the pattern in an interactive graph
    pattern.preview()

    # List the cuts added and remove any by their cut #
    pattern.printCutTable()
    pattern.remove(1)

    # Draw and Save the pattern to a file in the 'output' folder: this saves the .dxf and a .json config file
    pattern.draw()
    pattern.save("newCutPattern")

Getting Started

Create a python virtual environment. If you don't know what this is, Google "venv", it may change your life.

Create a directory called "output" (I could do this for you in the code... but I don't want to)

> mkdir ./output

Now you're ready to go back up to Creating a Pattern!

Liability Release :)

This code has bugs, for one. For another, be warned, if you are trying to make super small cuts you will run into floating point errors and anomalies due to the nature of how computers represent numbers. This mainly affects non-continuous cut patterns due to the overflow calculation when a cut wraps beyond the circumference; most of these errors are avoided when you create a continuous cut pattern, which most rotary laser cutters prefer anyways!

Feel free to post any bugs or requests for improvements via Issues.

Metadata

Release files for tubecutterdxf 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tubecutterdxf 0.1.4
File Size Uploaded
tubecutterdxf-0.1.4.tar.gz 14.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tubecutterdxf 0.1.4
File Interpreter ABI Platform
tubecutterdxf-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 23.6 kB

Release files / tubecutterdxf-0.1.4.tar.gz

Download URL tubecutterdxf-0.1.4.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9f1cd38c2e77243a9f10c974044b787476c171650c1648809f1cf551225e5e2b
BLAKE2b-256 checksum
How to use checksums
789dca8106a215a52668b0796a572bbb7191a61c7722ea6b43763c9344ce14e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.4

Release files / tubecutterdxf-0.1.4-py3-none-any.whl

Download URL tubecutterdxf-0.1.4-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23b2a8e474781d1906efbd6371009bad43a7e4dac2d2abc58f8dfead0d548528
BLAKE2b-256 checksum
How to use checksums
1dd60b58255a643e835fa4b2cfd62d3fc43e3305c5853eceef8d0d19e5ca0186
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page