Git Product home page Git Product logo

helical's Introduction

Helical

Helical is a library for SwiftSCAD that simplifies the creation of threaded components and related parts. It supports widely-used metric threads, bolts, and nuts, as well as the ability to customize these components to fit specific requirements.

Bolts demo
Nuts and washers demo

Installation

Integrate Helical into your project with the Swift Package Manager by adding it as a dependency in your Package.swift file:

let package = Package(
    name: "My3DGadget",
    platforms: [.macOS(.v14)], // Needed on macOS
    dependencies: [
        .package(url: "https://github.com/tomasf/SwiftSCAD.git", branch: "main"),
        .package(url: "https://github.com/tomasf/Helical.git", branch: "main")
    ],
    targets: [
        .executableTarget(name: "My3DGadget", dependencies: [
            "SwiftSCAD",
            "Helical"
        ])
    ]
)

Then, import Helical where it's needed:

import Helical

Usage

Standard Components

Helical simplifies the process of creating threaded shapes, making it easier to incorporate threaded holes into your models. It also provides a selection of standard bolts, nuts, and corresponding holes. Creating a typical M8x30 hex head bolt is simple:

Bolt.hexHead(.m8, length: 30, shankLength: 8)

This generates a standard DIN 931 bolt, exactly as anticipated.

Customizing Components

Beyond the standard offerings, Helical allows for modifications to fit unique requirements:

Bolt.hexHead(.isoMetric(.m8, pitch: 0.75), headWidth: 15, headHeight: 6.5, length: 30)

Or fully customize parts to your specific needs:

let thread = ScrewThread(
    handedness: .left,
    starts: 2,
    pitch: 1.5,
    majorDiameter: 6.2,
    minorDiameter: 5.3,
    form: .trapezoidal(angle: 90°, crestWidth: 0.25)
)
let customBolt = Bolt(
    thread: thread,
    length: 15,
    shankLength: 3,
    shankDiameter: 5,
    headShape: .countersunk(angle: 80°, topDiameter: 10, boltDiameter: 5),
    socket: .slotted(length: 10, width: 1, depth: 1.4)
)

Holes

Creating a matching countersunk clearance hole for a bolt is straightforward:

Box([20, 20, 10], center: .xy)
    .subtracting {
        customBolt.clearanceHole(recessedHead: true)
    }

As is making a threaded hole for a particular thread:

Box([20, 20, 10], center: .xy)
    .subtracting {
        ThreadedHole(thread: thread, depth: 10, unthreadedDepth: 2)
    }

Contributing

We welcome contributions. Feel free to open issues for feedback or suggestions and submit pull requests for improvements to the codebase.

helical's People

Contributors

tomasf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.