Skip to main content

cq-queryabolt

A quick way to create nutcatches, screw holes and countersinks in CadQuery, according to fastener standards.

Nutcatches, screw holes and countersinks.

Requirements and installation

poetry add cq-queryabolt

Usage

To create a simple box with a bolt hole and a nutcatch:

import queryabolt
import cadquery as cq

class Workplane(queryabolt.WorkplaneMixin, cq.Workplane):
    pass

box = Workplane().box(25, 10, 10)

# A nutcatch on the bottom:
result = box.faces("<Z").workplane().tag("center").nutcatchParallel("M3")

# And a bolt hole through:
result = result.faces(">Z").workplane().boltHole("M3")

show_object(result, name="simple")

Or check out the example showcasing all the features, or using a cadquery.Assembly.

API

queryabolt.WorkplaneMixin

boltHole(bolt: string, depth: Optional[float] = None)

Make a bolt hole (cadquery.Workplane.hole for named fasteners)

Args:

  • bolt (str): name of the bolt (e.g. "M3")
  • depth (float >= 0 or None to cut through the entire part): how deep to make the hole

cboreBoltHole(bolt: str, depth: Optional[float] = None, headDiameterClearance: Optional[float] = 0.1)

Make a counterbored hole (cadquery.Workplane.cboreHole for named fasteners)

Args:

  • bolt (str): name of the bolt (e.g. "M3")
  • depth (float >= 0 or None to cut through the entire part): how deep to make the hole
  • headClearance (float >= 0, optional): additional bolt head clearance. Defaults to 0.1.

cskBoltHole(bolt: string, depth: Optional[float] = None)

Make a countersunk hole (cadquery.Workplane.cskHole for named fasteners)

Args:

  • bolt (str): name of the bolt (e.g. "M3")
  • depth (float > 0 or None to cut through the entire part): how deep to make the hole

nutcatchParallel(options: string, kind: Optional[string] = "hexagon", heightClearance: Optional[float] = 0)

Make a parallel (surface) nutcatch

Args:

  • options (str): name of the nut (e.g. "M3")
  • kind (str, optional): kind of the nut (e.g. "hexagon"). Defaults to "hexagon".
  • heightClearance (float, optional): height clearance for the nut. Defaults to 0.

nutcatchSidecut(options: string, kind: Optional[string] = "hexagon", heightClearance: Optional[float] = 0, depth: Optional[float] = None)

Make a side-cut nutcatch

Args:

  • options (str): name of the nut (e.g. "M3")
  • kind (str, optional): kind of the nut (e.g. "hexagon"). Defaults to "hexagon".
  • heightClearance (float >= 0, optional): additional height clearance for the nut. Defaults to 0.
  • depth (float > 0 or None to cut through the entire part): how deep to make the sidecut. Defaults to None.

Acknowledgements

Prior work

The following turned out too verbose for the simpler end of the spectrum of my projects:

Similar library for OpenSCAD, by yours truly:

Download files

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

Source Distribution

cq_queryabolt-0.1.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cq_queryabolt-0.1.2-py2.py3-none-any.whl (5.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file cq_queryabolt-0.1.2.tar.gz.

File metadata

  • Download URL: cq_queryabolt-0.1.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.11.4-amd64

File hashes

Hashes for cq_queryabolt-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5b9b60caeb941cbc37c511b74a191d852c0ee55ab8bf8dcb02c03cdc44576f7a
MD5 f881673d53def0cfdf2c542fedae874c
BLAKE2b-256 bb094662074ef1c370077d39a0c4439e8569d3fcf8d22e39f0a3b6a112a59f55

See more details on using hashes here.

File details

Details for the file cq_queryabolt-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: cq_queryabolt-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.11.4-amd64

File hashes

Hashes for cq_queryabolt-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0bbcb92cabbefd1b144601afe363f5e0d6fe1ccb6a6a44df89913dfdca992b00
MD5 2ca3a5b4e220c2963a36943f56926576
BLAKE2b-256 ba659e460ee9181c18f04c5c4351efbf09d540f30e9dd4621a5de3e79fe68966

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

0.0.2

2 files

0.0.1.post1

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page