cq_warehouse
cq_warehouse copied to clipboard
Screws with threads don't seem to work
This three-liner should work, according to the docs …
import cadquery as cq
import cq_warehouse.fastener as f
ss=f.SetScrew("M6-1",10,"iso4026", simple=False)
… but it doesn't:
File "/tmp/tt.py", line 3, in <module>
ss=f.SetScrew("M6-1",10,"iso4026", simple=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/CQ-Editor/lib/python3.11/site-packages/cq_warehouse/fastener.py", line 1502, in __init__
cq_object = self.custom_make()
^^^^^^^^^^^^^^^^^^
File "/opt/CQ-Editor/lib/python3.11/site-packages/cq_warehouse/fastener.py", line 2064, in custom_make
return self.make_setscrew()
^^^^^^^^^^^^^^^^^^^^
File "/opt/CQ-Editor/lib/python3.11/site-packages/cq_warehouse/fastener.py", line 2096, in make_setscrew
ret = core.union(thread.translate((0, 0, -thread.length)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/CQ-Editor/lib/python3.11/site-packages/cadquery/occ_impl/shapes.py", line 935, in translate
return self._apply_transform(T)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/CQ-Editor/lib/python3.11/site-packages/cadquery/occ_impl/shapes.py", line 895, in _apply_transform
return self.__class__(BRepBuilderAPI_Transform(self.wrapped, Tr, True).Shape())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: IsoThread.__init__() missing 2 required positional arguments: 'pitch' and 'length'
Tested on main branch, cadquery 2.4.0