cq_warehouse v0.3.0 released

257 views
Skip to first unread message

Roger Maitland

unread,
Oct 8, 2021, 3:56:49 PM10/8/21
to CadQuery
Today the 0.3.0 version of cq_warehouse was published.

With expert advice and encouragement from Dave Cowden I've rebuild and significantly expanded the fasteners sub-package. A large number of standardized fasteners are provided, as follows:
fastener_disc.png

Nut

  • DomedCapNut: din1587
  • HexNut: iso4033, iso4035, iso4032
  • HexNutWithFlange: din1665
  • UnchamferedHexagonNut: iso4036
  • SquareNut: din557

Screw

  • ButtonHeadScrew: iso7380_1
  • ButtonHeadWithCollarScrew: iso7380_2
  • CheeseHeadScrew: iso14580, iso7048, iso1207
  • CounterSunkScrew: iso2009, iso14582, iso14581, iso10642, iso7046
  • HexHeadScrew: iso4017, din931, iso4014
  • HexHeadWithFlangeScrew: din1662, din1665
  • PanHeadScrew: asme_b_18.6.3, iso1580, iso14583
  • PanHeadWithCollarScrew: din967
  • RaisedCheeseHeadScrew: iso7045
  • RaisedCounterSunkOvalHeadScrew: iso2010, iso7047, iso14584
  • SetScrew: iso4026
  • SocketHeadCapScrew: iso4762, asme_b18.3

Washer

  • PlainWasher: iso7094, iso7093, iso7089, iso7091
  • ChamferedWasher: iso7090
  • CheeseHeadWasher: iso7092

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:

  • clearanceHole,
  • tapHole, and
  • threadedHole.

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:

pillow_block.png

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

Dave Cowden

unread,
Oct 8, 2021, 5:07:08 PM10/8/21
to Roger Maitland, CadQuery
A. MAZ. ING!!!
Thanks  for all this work Roger!

What's the best way to get this some visibility for CQ users? 



--
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.

Jojain

unread,
Oct 8, 2021, 6:27:56 PM10/8/21
to CadQuery
Neat work !
I've been linking cq-warehouse to an user on the discord channel. Overall I'd say that the discord channel is more alive than the google group or anything else, if you have a bit of free time to hang out, you could share your expertise (and library ofc :) )

Adam Urbanczyk

unread,
Oct 9, 2021, 9:30:38 AM10/9/21
to CadQuery
Looks great, thanks for sharing!
Reply all
Reply to author
Forward
0 new messages