Skip to main content

Nuts, Bolts and Screws content library for cqparts

Project description


Base Components

Few of these are useful on their own, they’re used to build more complex parts.


  • Counter-sunk varieties
  • Cylindrical varieties
  • Externally Driven (eg: hex head)

Drive Types

  • Cruciform varieties (eg: phillips, frearson)
  • Hex (aka: alan) varieties
  • Square varieties (eg: single, double, triple square)
  • Slotted
  • Tamper Resistant varieties


Standard threads included:

  • ISO68 (standard for metric bolts)
  • Triangular (eg: for woodscrews)
  • Ball Screw

Any custom thread can be built by creating a profile as a Wire from within an object inheriting from the base Thread class. (read more here)


Threads currently bugged by issue #1.

Threads are currently simplified to a cylinder until this is fixed.

Warning when using for 3d printing, threads will not form correctly until the bug is fixed… please +1 the issue if you’d like to use properly formed threads.

Male Fastener Components

  • Bolts
  • Screws

Female Fastener Components

  • Nuts


The Fasteners utility assembly can be used to automatically apply fasteners to arbitrary materials.

For example, with the following 2 detatched blocks:

A Fastener can be applied to these two blocks to hold them together in a variety of ways, with varied parameters, such as these 2 exmples:

More detailed examples of customizing a Fastener are documented here.


BoltDepot has an exceptional website for details of their products, enough to build 3d models accurate enough for most applications.

At this time, the catalogue you get with this library contains some of the products for in the categories:

  • Bolts : boltdepot-bolts.json
  • Nuts : boltdepot-nuts.json
  • Woodscrews : boltdepot-woodscrews.json

Other Suppliers

With increased interest in this library I would like to see this list grow, but at this time, it’s just the catalogues listed above.


Machine Screw

We can create a fastener with many tuned parameters, for this example we’ll create an M3 machine screw, 4mm long, with a domed cheese head, and a 2mm hex drive:

from cqparts_fasteners.male import MaleFastenerPart

screw = MaleFastenerPart(
    head=('cheese', {
        'diameter': 4.5,
        'height': 1.5,
        'domed': True,
        'dome_ratio': 0.5,
    drive=('hex', {
        'depth': 1,
        'width': 2,
    thread=('iso68', {
        'diameter': 3,  # M3

from cqparts.display import display

Catalogue Bolt

With use of a JSONCatalogue we can search for all fasteners within that catalogue that suit certain parameters, such as length, diameter, anything used as a parameter to build the part.

For this example, we’ll explicitly define the product’s id, guarenteeing only one result is returned:

import os

from cqparts.catalogue import JSONCatalogue
import cqparts_fasteners

catalogue_filename = os.path.join(
catalogue = JSONCatalogue(catalogue_filename)
item = catalogue.get_query()
bolt = catalogue.get( == '221')

from cqparts.display import display

This should generate an accurate model for BoltDepot’s product #221.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cqparts-fasteners, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size cqparts_fasteners-0.1.0-py2-none-any.whl (206.7 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size cqparts_fasteners-0.1.0.tar.gz (177.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page