A quick way to create nutcatches, screw holes and countersinks in CadQuery, according to fastener standards
Project description
cq-queryabolt
A quick way to create nutcatches, screw holes and countersinks in CadQuery, according to fastener standards.
.
Requirements and installation
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
orNone
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
orNone
to cut through the entire part): how deep to make the holeheadClearance
(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
orNone
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
orNone
to cut through the entire part): how deep to make the sidecut. Defaults toNone
.
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:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cq_queryabolt-0.0.1.post1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f4fb9f693ea4392d54af3880dcf846f5bff7e1243643e5c12861bf77ee3b764 |
|
MD5 | 43db47fefad3e23b9bc0f33c10337c3a |
|
BLAKE2b-256 | 3672c9599a9a4b02382a35e22c0936102210e786c3df017cd154293456ad495f |
Hashes for cq_queryabolt-0.0.1.post1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c09ac1c42b7dd8c6fdd03e7125341eee096010ed76da528a1c308c8d024f8d7f |
|
MD5 | 6353de58f942b9e2ce3b7ba644044295 |
|
BLAKE2b-256 | 3dc86c1a80d081ecda482703042105d76c851d8854225c6cb2fa710942afe6e5 |