https://github.com/tomasf/helical
A Cadova library providing customizable threads, screws, bolts, nuts and related parts.
https://github.com/tomasf/helical
bolt cadova fasteners screw threads
Last synced: about 1 month ago
JSON representation
A Cadova library providing customizable threads, screws, bolts, nuts and related parts.
- Host: GitHub
- URL: https://github.com/tomasf/helical
- Owner: tomasf
- License: mit
- Created: 2024-02-27T18:47:44.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-03-06T16:12:50.000Z (3 months ago)
- Last Synced: 2026-03-18T20:20:42.183Z (3 months ago)
- Topics: bolt, cadova, fasteners, screw, threads
- Language: Swift
- Homepage:
- Size: 34.7 MB
- Stars: 17
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Helical
Helical is a library for [Cadova](https://github.com/tomasf/Cadova) 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](Sources/Demo/bolts.stl) · [Nuts and washers demo](Sources/Demo/nutsAndWashers.stl)
## Installation
Integrate Helical into your project with the Swift Package Manager by adding it as a dependency in your `Package.swift` file:
```swift
.package(url: "https://github.com/tomasf/Helical.git", from: "1.0.0")
```
Then, import Helical where it's needed:
```swift
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 M8x20 hex head bolt is simple:
```swift
Bolt.hexHead(.m8, length: 20, unthreadedLength: 5)
```
This generates a standard [DIN 931](https://www.fasteners.eu/standards/DIN/931/) bolt, as expected.
### Customizing Components

Beyond the standard offerings, Helical allows for modifications to fit unique requirements:
```swift
Bolt.hexHead(
.isoMetric(.m8, pitch: 0.75),
headWidth: 15,
headHeight: 6.5,
length: 20
)
```
Or fully customize parts to your specific needs:

```swift
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,
unthreadedLength: 3,
unthreadedDiameter: 5,
headShape: .countersunk(angle: 80°, topDiameter: 10, boltDiameter: 5),
socket: .slot(length: 10, width: 1, depth: 1.4)
)
```
### Holes

Creating a matching countersunk clearance hole for a bolt is straightforward:
```swift
Box(13)
.aligned(at: .centerXY)
.subtracting {
customBolt.clearanceHole(entry: .recessedHead)
}
```
As is making a threaded hole for a particular thread:

```swift
Box(13)
.aligned(at: .centerXY)
.subtracting {
ThreadedHole(thread: thread, depth: 13, leadIns: .both)
}
```
### Lead-In Chamfers
`LeadIn` and `LeadInEnds` provide a unified way to add thread-entry chamfers to screws, threaded holes, and nuts. Size can be specified relative to thread depth, pitch, or cone angle, or as explicit dimensions:
```swift
Screw(thread: .isoMetric(.m6), length: 20, leadIns: .both(.standard))
Nut(thread: .isoMetric(.m6), shape: body, leadIns: .both(.angle(120°)))
```
## Behavior

Helical uses Cadova's `tolerance` environment setting to increase the diameter of holes and decrease the diameter of bolts. Clearance holes can create overhang-safe shapes. Specify a circular overhang method (`circularOverhangMethod`) to enable this.
```swift
.withCircularOverhangMethod(.bridge)
.withTolerance(0.5)
```
## Contributing
We welcome contributions. Feel free to open issues for feedback or suggestions and submit pull requests for improvements to the codebase.