Nut
Screw
Washer
In addition to the new fasteners, the following three new Workplane hole building methods are provided to simplify creation of appropriate holes into your parts for the above fasteners:
These three methods can optionally place fasteners into an Assembly in the correct positions. To illustrate, here is the pillow block from the CadQuery documentation reworked with fasteners:
import cadquery as cq
from cq_warehouse.fastener import SocketHeadCapScrew
height = 60.0
width = 80.0
thickness = 10.0
diameter = 22.0
padding = 12.0
# make the screw
screw = SocketHeadCapScrew(fastener_type="iso4762", size="M2-0.4", length=16, simple=False)
# make the assembly
pillow_block = cq.Assembly(None, name="pillow_block")
# make the base
base = (
cq.Workplane("XY")
.box(height, width, thickness)
.faces(">Z")
.workplane()
.hole(diameter)
.faces(">Z")
.workplane()
.rect(height - padding, width - padding, forConstruction=True)
.vertices()
.clearanceHole(fastener=screw, baseAssembly=pillow_block)
.edges("|Z")
.fillet(2.0)
)
pillow_block.add(base)
# Render the assembly
show_object(pillow_block)
This results in the following:
where not only was the pillow block created but an assembly with all of the fasteners in the correct positions was also created. As can be seen from the fastener disk picture, this works for Nuts and Washers as well.
The data that drives the fastener creation is stored in easy to edit .csv files so adding new types and sizes within a class of fastener is easy to do. New fastener classes are derived from the base class and only require some copy/pasting of existing code, 2D workplanes of the fastener (mostly side and top views) and a new .csv file.
If you find any issues please let me know or open an issue on github directly. If your favourite fastener isn't listed above, gather up the data and we'll expand.
Cheers,
Roger
--
cadquery home: https://github.com/CadQuery/cadquery
post issues at https://github.com/CadQuery/cadquery/issues
run it at home at : https://github.com/CadQuery/CQ-editor
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/0b43639c-8f9f-4fc7-848e-1bf1e0ced56en%40googlegroups.com.