├── .github └── FUNDING.yml ├── .gitignore ├── .pylintrc ├── .readthedocs.yaml ├── LICENSE ├── README.md ├── docs ├── Makefile ├── _static │ └── carousel.glb ├── assets │ ├── acme_thread.png │ ├── bd_title_image.png │ ├── bearings.png │ ├── bolting_plates.png │ ├── brad_tee_nut_assembly.png │ ├── captive_nuts.png │ ├── external_thread.png │ ├── fastenerLocations.png │ ├── fastener_disc.png │ ├── flange_logo.png │ ├── gears.png │ ├── internal_iso_thread.png │ ├── internal_thread.png │ ├── openbuilds.png │ ├── openbuilds_assemblies.png │ ├── openbuilds_parts.png │ ├── openbuilds_profiles.png │ ├── pillow_block.png │ ├── pipe_and_flanges.png │ ├── pipe_logo.png │ ├── plastic_thread.png │ ├── screw_at_depth.png │ ├── thread_end_finishes.png │ └── thread_examples.png ├── bearing.rst ├── carousel.png ├── conf.py ├── environment.yaml ├── fastener.rst ├── flange.rst ├── gear.rst ├── index.rst ├── installation.rst ├── make.bat ├── openbuilds.rst ├── pipe.rst ├── requirements.txt └── thread.rst ├── examples ├── captive_nuts.py ├── flange_logo.py ├── pillow_block.py ├── pipe_and_flanges.py ├── pipe_logo.py └── threads.py ├── pyproject.toml ├── requirements.txt ├── src └── bd_warehouse │ ├── __init__.py │ ├── bearing.py │ ├── data │ ├── brad_tee_nut_parameters.csv │ ├── button_head_parameters.csv │ ├── button_head_with_collar_parameters.csv │ ├── chamfered_washer_parameters.csv │ ├── cheese_head_parameters.csv │ ├── cheese_head_washer_parameters.csv │ ├── clearance_hole_sizes.csv │ ├── countersunk_head_parameters.csv │ ├── domed_cap_nut_parameters.csv │ ├── drill_sizes.csv │ ├── heatset_nut_parameters.csv │ ├── hex_head_parameters.csv │ ├── hex_head_with_flange_parameters.csv │ ├── hex_nut_parameters.csv │ ├── hex_nut_with_flange_parameters.csv │ ├── imperial_set_screw_parameters.csv │ ├── internal_tooth_lock_washer_parameters.csv │ ├── iso10664def.csv │ ├── low_profile_parameters.csv │ ├── metric_set_screw_parameters.csv │ ├── nominal_screw_lengths.csv │ ├── pan_head_parameters.csv │ ├── pan_head_with_collar_parameters.csv │ ├── plain_washer_parameters.csv │ ├── raised_cheese_head_parameters.csv │ ├── raised_countersunk_oval_head_parameters.csv │ ├── setscrew_parameters.csv │ ├── single_row_angular_contact_ball_bearing_parameters.csv │ ├── single_row_capped_deep_groove_ball_bearing_parameters.csv │ ├── single_row_cylindrical_roller_bearing_parameters.csv │ ├── single_row_deep_groove_ball_bearing_parameters.csv │ ├── single_row_tapered_roller_bearing_parameters.csv │ ├── socket_head_cap_parameters.csv │ ├── square_nut_parameters.csv │ ├── tap_hole_sizes.csv │ └── unchamfered_hex_nut_parameters.csv │ ├── fastener.py │ ├── flange.py │ ├── gear.py │ ├── open_builds.py │ ├── pipe.csv │ ├── pipe.py │ └── thread.py └── tests ├── test_bearings.py ├── test_fasteners.py ├── test_gears.py └── test_thread.py /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: gumyr 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Packaging debris 2 | dist/ 3 | *.egg-info/ 4 | src/build123d/_version.py 5 | 6 | # Testing debris 7 | __pycache__/ 8 | 9 | # Coverage debris 10 | .coverage 11 | htmlcov/ 12 | 13 | # Docs debris 14 | docs/_build/ 15 | 16 | # User generated debris 17 | *.swp 18 | *.log 19 | *.step 20 | *.STEP 21 | *.stl 22 | *.svg 23 | 24 | #mypy cache 25 | .mypy_cache 26 | build 27 | -------------------------------------------------------------------------------- /.pylintrc: -------------------------------------------------------------------------------- 1 | [BASIC] 2 | 3 | # Good variable names which should always be accepted, separated by a comma 4 | good-names=i,j,k,x,y,z,ex,Run,_,X,Y,Z,XY,YZ,ZX,XZ,YX,ZY 5 | 6 | disable= 7 | unsubscriptable-object, # False positives 8 | use-a-generator, # all([..]) is just fine 9 | protected-access, # _variable to be hiddened from external users 10 | too-many-arguments, # CAD is complex 11 | too-few-public-methods # Objects and Operations will not have methods outside of _init 12 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | formats: 4 | - epub 5 | - pdf 6 | 7 | build: 8 | os: "ubuntu-22.04" 9 | tools: 10 | python: "3.10" 11 | apt_packages: 12 | - graphviz 13 | 14 | # Build from the docs/ directory with Sphinx 15 | sphinx: 16 | configuration: docs/conf.py 17 | 18 | # Explicitly set the version of Python and its requirements 19 | python: 20 | install: 21 | - method: pip 22 | path: . 23 | extra_requirements: 24 | - docs 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![build123d, a parametric part collection](docs/assets/bd_title_image.png) 2 | 3 | # bd_warehouse 4 | 5 | build123d, a parametric part collection 6 | 7 | If you've ever wondered about finding a better alternative to proprietary 8 | software for mechanical CAD, consider exploring 9 | [Build123d](https://build123d.readthedocs.io/en/latest/), along with related 10 | packages like [bd_warehouse](https://github.com/gumyr/bd_warehouse) and 11 | [cq_gears](https://github.com/meadiode/cq_gears). Build123d enhances the widely 12 | used Python programming language by adding powerful capabilities that enable the 13 | creation of various mechanical designs using the same techniques employed in today's technology. 14 | 15 | By incorporating **bd_warehouse** into **Build123d**, you gain access to on-demand 16 | generation of parametric parts and extensions that expand the core capabilities 17 | of Build123d. These resulting parts can be seamlessly integrated into your 18 | projects or saved as CAD files in formats such as STEP or STL. This allows for 19 | compatibility with a wide range of CAD, CAM, and analytical systems. 20 | 21 | With just a few lines of code, you can create parametric parts that are easily 22 | reviewable and version controlled using tools like [git](https://git-scm.com/) 23 | and [GitHub](https://github.com/). 24 | Documentation can be automatically generated from the source code of your 25 | designs, similar to the documentation you're currently reading. Additionally, 26 | comprehensive test suites can automatically validate parts, ensuring that no 27 | flaws are introduced during their lifecycle. 28 | 29 | The benefits of adopting a full software development pipeline are numerous and 30 | extend beyond the scope of this text. Furthermore, all these tools are 31 | open-source, free to use, and customizable, eliminating the need for licenses. 32 | Empower yourself by taking control of your CAD development tools. 33 | 34 | The documentation for **bd_warehouse** can found at [bd_warehouse](https://bd-warehouse.readthedocs.io/en/latest/index.html). 35 | 36 | There is a [***Discord***](https://discord.com/invite/Bj9AQPsCfx) server (shared with CadQuery) where you can ask for help in the build123d channel. 37 | 38 | To install **bd_warehouse** from github: 39 | ``` 40 | python3 -m pip install git+https://github.com/gumyr/bd_warehouse 41 | ``` 42 | Development install 43 | ``` 44 | git clone https://github.com/gumyr/bd_warehouse.git 45 | cd bd_warehouse 46 | python3 -m pip install -e . 47 | ``` 48 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/_static/carousel.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/_static/carousel.glb -------------------------------------------------------------------------------- /docs/assets/acme_thread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/acme_thread.png -------------------------------------------------------------------------------- /docs/assets/bd_title_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/bd_title_image.png -------------------------------------------------------------------------------- /docs/assets/bearings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/bearings.png -------------------------------------------------------------------------------- /docs/assets/bolting_plates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/bolting_plates.png -------------------------------------------------------------------------------- /docs/assets/brad_tee_nut_assembly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/brad_tee_nut_assembly.png -------------------------------------------------------------------------------- /docs/assets/captive_nuts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/captive_nuts.png -------------------------------------------------------------------------------- /docs/assets/external_thread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/external_thread.png -------------------------------------------------------------------------------- /docs/assets/fastenerLocations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/fastenerLocations.png -------------------------------------------------------------------------------- /docs/assets/fastener_disc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/fastener_disc.png -------------------------------------------------------------------------------- /docs/assets/flange_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/flange_logo.png -------------------------------------------------------------------------------- /docs/assets/gears.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/gears.png -------------------------------------------------------------------------------- /docs/assets/internal_iso_thread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/internal_iso_thread.png -------------------------------------------------------------------------------- /docs/assets/internal_thread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/internal_thread.png -------------------------------------------------------------------------------- /docs/assets/openbuilds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/openbuilds.png -------------------------------------------------------------------------------- /docs/assets/openbuilds_assemblies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/openbuilds_assemblies.png -------------------------------------------------------------------------------- /docs/assets/openbuilds_parts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/openbuilds_parts.png -------------------------------------------------------------------------------- /docs/assets/openbuilds_profiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/openbuilds_profiles.png -------------------------------------------------------------------------------- /docs/assets/pillow_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/pillow_block.png -------------------------------------------------------------------------------- /docs/assets/pipe_and_flanges.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/pipe_and_flanges.png -------------------------------------------------------------------------------- /docs/assets/pipe_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/pipe_logo.png -------------------------------------------------------------------------------- /docs/assets/plastic_thread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/plastic_thread.png -------------------------------------------------------------------------------- /docs/assets/screw_at_depth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/screw_at_depth.png -------------------------------------------------------------------------------- /docs/assets/thread_end_finishes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/thread_end_finishes.png -------------------------------------------------------------------------------- /docs/assets/thread_examples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/assets/thread_examples.png -------------------------------------------------------------------------------- /docs/bearing.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | bearing - parametric bearings 3 | ############################# 4 | Many mechanical designs will contain bearings of some kind. The 5 | bearing sub-package provides a set of classes that 6 | create many different types of parametric bearings. 7 | 8 | Bearings are created as build123d Compound/Assemblies and with accurate 9 | external dimensions but simplified internal structure to avoid 10 | excess creation time. 11 | 12 | .. image:: assets/bearings.png 13 | 14 | .. 15 | Holes for the bearings can be created with a :meth:`~extensions_doc.Workplane.pressFitHole` 16 | method which can automatically place the bearing into an Assembly and bore a hole 17 | for an axle if the part is thicker than the bearing. 18 | See :ref:`Press Fit Holes ` for details. 19 | 20 | Here is a list of the classes (and bearing types) provided: 21 | 22 | * :ref:`Bearing ` - the base bearing class 23 | * ``SingleRowDeepGrooveBallBearing``: SKT 24 | * ``SingleRowCappedDeepGrooveBallBearing``: SKT 25 | * ``SingleRowAngularContactBallBearing``: SKT 26 | * ``SingleRowCylindricalRollerBearing``: SKT 27 | 28 | .. 29 | * ``SingleRowTaperedRollerBearing``: SKT 30 | 31 | See :ref:`Extending the fastener sub-package ` (these instructions apply 32 | to bearings as well) for guidance on how to easily 33 | add new sizes or entirely new types of bearings. 34 | 35 | The following example creates a variety of different sized bearings: 36 | 37 | .. code-block:: python 38 | 39 | from build123d import * 40 | from bd_warehouse.bearing import SingleRowDeepGrooveBallBearing, SingleRowTaperedRollerBearing 41 | 42 | skate_board_bearing = SingleRowDeepGrooveBallBearing(size="M8-22-7") 43 | motocycle_head_bearing = SingleRowTaperedRollerBearing(size="M20-42-15") 44 | 45 | Both metric and imperial sized standard bearings are directly supported by the bearing sub-package 46 | although the majority of the bearings currently implemented are metric. 47 | 48 | The following sections describe each of the provided classes. 49 | 50 | .. _bearing: 51 | 52 | ******* 53 | Bearing 54 | ******* 55 | As the base class of all other bearing classes, all of the bearing classes share the same 56 | interface as follows: 57 | 58 | .. autoclass:: bearing.Bearing 59 | 60 | 61 | Bearing Selection 62 | ================= 63 | As there are many classes and types of bearings to select from, the Bearing class provides some methods 64 | that can help find the correct bearing for your application. As a reminder, to find the subclasses of 65 | the Bearing class, use ``__subclasses__()``: 66 | 67 | .. py:module:: bearing 68 | 69 | .. doctest:: 70 | 71 | >>> Bearing.__subclasses__() 72 | [, , , , ] 73 | 74 | Here is a summary of the class methods: 75 | 76 | .. automethod:: Bearing.types 77 | 78 | .. doctest:: 79 | 80 | >>> SingleRowDeepGrooveBallBearing.types() 81 | {'SKT'} 82 | 83 | .. automethod:: Bearing.sizes 84 | 85 | .. doctest:: 86 | 87 | >>> SingleRowDeepGrooveBallBearing.sizes("SKT") 88 | ['M3-10-4', 'M4-9-2.5', 'M4-11-4', 'M4-12-4', 'M4-13-5', 'M4-16-5', 'M5-11-3', 'M5-13-4', 'M5-16-5', 'M5-19-6', 'M6-13-3.5', 'M6-15-5', 'M6-19-6', 'M7-14-3.5', 'M7-17-5', 'M7-19-6', 'M7-22-7', 'M8-16-4', 'M8-19-6', 'M8-22-7', 'M8-24-8', 'M9-17-4', 'M9-20-6', 'M9-24-7', 'M9-26-8', 'M10-19-5', 'M10-22-6', 'M10-26-8', 'M10-28-8', 'M10-30-9', 'M10-35-11'] 89 | 90 | .. automethod:: Bearing.select_by_size 91 | 92 | .. doctest:: 93 | 94 | >>> Bearing.select_by_size("M8-22-7") 95 | {: ['SKT'], : ['SKT']} 96 | 97 | Derived Bearing Classes 98 | ======================= 99 | The following is a list of the current bearing classes derived from the base Bearing class. Also listed is 100 | the type for each of these derived classes where the type refers to a standard that defines the bearing 101 | parameters. All derived bearings inherit the same API as the base Bearing class. 102 | 103 | * ``SingleRowDeepGrooveBallBearing``: SKT 104 | * ``SingleRowCappedDeepGrooveBallBearing``: SKT 105 | * ``SingleRowAngularContactBallBearing``: SKT 106 | * ``SingleRowCylindricalRollerBearing``: SKT 107 | 108 | .. autoclass:: SingleRowDeepGrooveBallBearing 109 | .. autoclass:: SingleRowCappedDeepGrooveBallBearing 110 | .. autoclass:: SingleRowAngularContactBallBearing 111 | .. autoclass:: SingleRowCylindricalRollerBearing 112 | .. 113 | * ``SingleRowTaperedRollerBearing``: SKT 114 | 115 | Detailed information about any of the bearing types can be readily found on the internet from manufacture's 116 | websites or from the standard document itself. SKT provides comprehensive information about all types of 117 | rolling bearings in their document: 118 | `Rolling bearings `_. 119 | 120 | .. _press fit holes: 121 | 122 | *************** 123 | Press Fit Holes 124 | *************** 125 | When designing parts with build123d a common operation is to place holes appropriate to a 126 | specific bearing into the part. This operation is optimized with bd_warehouse by the 127 | following custom hole object: 128 | 129 | .. autoclass:: PressFitHole 130 | 131 | Note that this object can place a hole in the part sized and aligned for the bore of the bearing if 132 | an axle is intended to pass through the part. The ``fit`` parameter determines how much larger this 133 | hole is than the bearing bore. The `hole_locations` attribute of the bearing instance passed 134 | to ``PressFitHole`` will be updated with the location of the hole to easy assembly creation. -------------------------------------------------------------------------------- /docs/carousel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gumyr/bd_warehouse/928834f1884cba646c7c9f0ba423b9ae9fc27d4f/docs/carousel.png -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # For the full list of built-in configuration values, see the documentation: 4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 5 | 6 | # -- Path setup -------------------------------------------------------------- 7 | 8 | # If extensions (or modules to document with autodoc) are in another directory, 9 | # add these directories to sys.path here. If the directory is relative to the 10 | # documentation root, use os.path.abspath to make it absolute, like shown here. 11 | # 12 | import os 13 | import sys 14 | 15 | bd_warehouse_path = os.path.dirname(os.path.abspath(os.getcwd())) 16 | source_files_path = os.path.join(bd_warehouse_path, "src", "bd_warehouse") 17 | sys.path.insert(0, source_files_path) 18 | sys.path.append(os.path.abspath("sphinxext")) 19 | sys.path.insert(0, os.path.abspath(".")) 20 | sys.path.insert(0, os.path.abspath("../")) 21 | 22 | # -- Project information ----------------------------------------------------- 23 | 24 | project = "bd_warehouse" 25 | copyright = "2023, Gumyr" 26 | author = "Gumyr" 27 | 28 | 29 | # The full version, including alpha/beta/rc tags 30 | with open(os.path.join(bd_warehouse_path, "pyproject.toml")) as f: 31 | pyproject_toml = f.readlines() 32 | for line in pyproject_toml: 33 | if "version =" in line: 34 | release = line.split("=")[1].strip() 35 | 36 | # -- General configuration --------------------------------------------------- 37 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration 38 | 39 | extensions = [ 40 | "sphinx.ext.napoleon", 41 | "sphinx.ext.autodoc", 42 | # "sphinx_autodoc_typehints", 43 | "sphinx.ext.autodoc.typehints", 44 | "sphinx.ext.doctest", 45 | "sphinx.ext.graphviz", 46 | "sphinx.ext.inheritance_diagram", 47 | "sphinx.ext.viewcode", 48 | "sphinx_design", 49 | "sphinx_copybutton", 50 | "hoverxref.extension", 51 | ] 52 | 53 | # Napoleon settings 54 | napoleon_google_docstring = True 55 | napoleon_numpy_docstring = True 56 | napoleon_include_init_with_doc = False 57 | napoleon_include_private_with_doc = False 58 | napoleon_include_special_with_doc = False 59 | napoleon_use_admonition_for_examples = False 60 | napoleon_use_admonition_for_notes = False 61 | napoleon_use_admonition_for_references = False 62 | napoleon_use_ivar = True 63 | napoleon_use_param = True 64 | napoleon_use_rtype = True 65 | napoleon_use_keyword = True 66 | napoleon_custom_sections = None 67 | 68 | autodoc_typehints = ["signature"] 69 | # autodoc_typehints = ["description"] 70 | # autodoc_typehints = ["both"] 71 | 72 | autodoc_default_options = { 73 | "member-order": "alphabetical", 74 | } 75 | # Sphinx settings 76 | add_module_names = False 77 | python_use_unqualified_type_names = True 78 | 79 | # Add any paths that contain templates here, relative to this directory. 80 | templates_path = ["_templates"] 81 | 82 | # List of patterns, relative to source directory, that match files and 83 | # directories to ignore when looking for source files. 84 | # This pattern also affects html_static_path and html_extra_path. 85 | exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] 86 | 87 | root_doc = "index" 88 | 89 | 90 | # -- Options for HTML output ------------------------------------------------- 91 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output 92 | 93 | # html_theme = 'alabaster' 94 | html_theme = "sphinx_rtd_theme" 95 | 96 | # Add any paths that contain custom static files (such as style sheets) here, 97 | # relative to this directory. They are copied after the builtin static files, 98 | # so a file named "default.css" will overwrite the builtin "default.css". 99 | html_static_path = ["_static"] 100 | 101 | # -- Options for hoverxref ------------------------------------------------- 102 | hoverxref_role_types = { 103 | "hoverxref": "tooltip", 104 | "ref": "tooltip", # for hoverxref_auto_ref config 105 | "confval": "tooltip", # for custom object 106 | "mod": "tooltip", # for Python Sphinx Domain 107 | "class": "tooltip", # for Python Sphinx Domain 108 | "meth": "tooltip", # for Python Sphinx Domain 109 | "func": "tooltip", # for Python Sphinx Domain 110 | } 111 | 112 | hoverxref_roles = [ 113 | "class", 114 | "meth", 115 | ] 116 | 117 | hoverxref_domains = [ 118 | "py", 119 | ] 120 | -------------------------------------------------------------------------------- /docs/environment.yaml: -------------------------------------------------------------------------------- 1 | name: docs 2 | channels: 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - sphinx 7 | - nbsphinx 8 | - pip: 9 | - sphinx_rtd_theme 10 | - git+https://github.com/gumyr/build123d.git#egg=build123d 11 | -------------------------------------------------------------------------------- /docs/fastener.rst: -------------------------------------------------------------------------------- 1 | ######################################## 2 | fastener - parametric threaded fasteners 3 | ######################################## 4 | Many mechanical designs will contain threaded fasteners of some kind, either in a 5 | threaded hole or threaded screws or bolts holding two or more parts together. The 6 | fastener sub-package provides a set of classes that 7 | create many different types of nuts, screws and washers - as follows: 8 | 9 | .. py:module:: fastener 10 | 11 | .. raw:: html 12 | 13 | 14 | 15 | 16 | .. .. image:: assets/fastener_disc.png 17 | :alt: fastener_disc 18 | 19 | Here is a list of the classes (and fastener types) provided: 20 | 21 | * :class:`Nut` - the base nut class 22 | 23 | * :class:`DomedCapNut` : din1587 24 | * :class:`HeatSetNut` : McMaster-Carr, Hilitchi 25 | * :class:`HexNut` : iso4033, iso4035, iso4032 26 | * :class:`HexNutWithFlange` : din1665 27 | * :class:`UnchamferedHexagonNut` : iso4036 28 | * :class:`SquareNut` : din557 29 | 30 | * :class:`Screw` - the base screw class 31 | 32 | * :class:`ButtonHeadScrew` : iso7380_1 33 | * :class:`ButtonHeadWithCollarScrew` : iso7380_2 34 | * :class:`CheeseHeadScrew` : iso14580, iso7048, iso1207 35 | * :class:`CounterSunkScrew` : iso2009, iso14582, iso14581, iso10642, iso7046 36 | * :class:`HexHeadScrew` : iso4017, din931, iso4014 37 | * :class:`HexHeadWithFlangeScrew` : din1662, din1665 38 | * :class:`LowProfileScrew` : OpenBuilds 39 | * :class:`PanHeadScrew` : asme_b_18.6.3, iso1580, iso14583 40 | * :class:`PanHeadWithCollarScrew` : din967 41 | * :class:`RaisedCheeseHeadScrew` : iso7045 42 | * :class:`RaisedCounterSunkOvalHeadScrew` : iso2010, iso7047, iso14584 43 | * :class:`SetScrew` : iso4026 44 | * :class:`SocketHeadCapScrew` : iso4762, asme_b18.3 45 | 46 | * :class:`Washer` - the base washer class 47 | 48 | * :class:`PlainWasher` : iso7094, iso7093, iso7089, iso7091 49 | * :class:`ChamferedWasher` : iso7090 50 | * :class:`CheeseHeadWasher` : iso7092 51 | * :class:`InternalToothLockWasher` : din6797, asme_b18.21.1 52 | 53 | See :ref:`Extending the fastener sub-package ` for guidance on how to easily 54 | add new sizes or entirely new types of fasteners. 55 | 56 | The following example creates a variety of different sized fasteners: 57 | 58 | .. code-block:: python 59 | 60 | from build123d import * 61 | from bd_warehouse.fastener import HexNut, SocketHeadCapScrew, SetScrew 62 | 63 | nut = HexNut(size="M3-0.5", fastener_type="iso4032") 64 | setscrew = SetScrew(size="M6-1", fastener_type="iso4026",length=10 * MM) 65 | capscrew = SocketHeadCapScrew(size="#6-32", fastener_type="asme_b18.3", length=(1/2) * IN) 66 | 67 | Both metric and imperial sized standard fasteners are directly supported by the fastener sub-package 68 | although the majority of the fasteners currently implemented are metric. 69 | 70 | Many of the fastener standards provide ranges for some of the dimensions - for example a minimum and 71 | maximum head diameter. This sub-package generally uses the maximum sizes when a range is available 72 | in-order to ensure clearance between a fastener and another part won't be compromised by a physical 73 | part that is within specification but larger than the CAD model. 74 | 75 | Threaded parts are complex for CAD systems to create and significantly increase the storage requirements 76 | thus making the system slow and difficult to use. To minimize these requirements all of the fastener 77 | classes have a ``simple`` boolean parameter that when ``True`` doesn't create actual threads at all. 78 | Such simple parts have the same overall dimensions and such that they can be used to check for fitment 79 | without dramatically impacting performance. 80 | 81 | All of the fasteners default to right-handed thread but each of them provide a ``hand`` string 82 | parameter which can either be ``"right"`` or ``"left"``. 83 | 84 | The following sections describe each of the provided classes. 85 | 86 | .. _nut: 87 | 88 | *** 89 | Nut 90 | *** 91 | As the base class of all other nut and bolt classes, all of the derived nut classes share the same 92 | interface as follows: 93 | 94 | .. autoclass:: fastener.Nut 95 | :members: types, sizes, select_by_size, hole_locations, info, nut_thickness 96 | 97 | .. :exclude-members: clearance_hole_data, clearance_hole_drill_sizes, tap_hole_data, tap_hole_drill_sizes, make_head, countersink_profile, default_countersink_profile, fastener_data 98 | 99 | Nut Selection 100 | ============= 101 | As there are many classes and types of nuts to select from, the Nut class provides some methods 102 | that can help find the correct nut for your application. As a reminder, to find the subclasses of 103 | the Nut class, use :class:`__subclasses__()`: 104 | 105 | 106 | .. doctest:: 107 | 108 | >>> Nut.__subclasses__() 109 | [, ...] 110 | 111 | .. Here is a summary of the class methods: 112 | 113 | .. .. automethod:: Nut.types 114 | 115 | .. doctest:: 116 | 117 | >>> HexNut.types() 118 | {'iso4033', 'iso4032', 'iso4035'} 119 | 120 | .. .. automethod:: Nut.sizes 121 | 122 | .. doctest:: 123 | 124 | >>> HexNut.sizes("iso4033") 125 | ['M1.6-0.35', 'M1.8-0.35', 'M2-0.4', 'M2.5-0.45', 'M3-0.45', 'M3.5-0.6', 'M4-0.7', 'M5-0.8', 'M6-1', 'M8-1.25', 'M10-1.5', 'M12-1.75', 'M14-2', 'M16-2', 'M18-2.5', 'M20-2.5', 'M22-2.5', 'M24-3', 'M27-3', 'M30-3.5', 'M33-3.5', 'M36-4', 'M39-4', 'M42-4.5', 'M45-4.5', 'M48-5', 'M52-5'] 126 | 127 | .. .. automethod:: Nut.select_by_size 128 | 129 | .. doctest:: 130 | 131 | >>> Nut.select_by_size("M6-1") 132 | {: ['din1587'], : ['iso4035', 'iso4032', 'iso4033'], : ['din1665'], : ['iso4036'], : ['din557']} 133 | 134 | 135 | Derived Nut Classes 136 | =================== 137 | The following is a list of the current nut classes derived from the base Nut class. Also listed is 138 | the type for each of these derived classes where the type refers to a standard that defines the nut 139 | parameters. All derived nuts inherit the same API as the base Nut class. 140 | 141 | .. * :class:`BradTeeNut` : Hilitchi 142 | 143 | * :class:`DomedCapNut` : din1587 144 | * :class:`HeatSetNut` : McMaster-Carr, Hilitchi 145 | * :class:`HexNut` : iso4033, iso4035, iso4032 146 | * :class:`HexNutWithFlange` : din1665 147 | * :class:`UnchamferedHexagonNut` : iso4036 148 | * :class:`SquareNut` : din557 149 | 150 | Detailed information about any of the nut types can be readily found on the internet from manufacture's 151 | websites or from the standard document itself. 152 | 153 | .. 154 | The :class:`BradTeeNut` is a compound object that uses multiple :class:`CounterSunkScrew` to fix the 155 | nut to the base object. The size of these brads is stored in the :class:`nut_data` instance variable and 156 | can be used to place the brads as shown in the 157 | `brad_tee_and_heatset_nuts.py `_ 158 | example. 159 | 160 | .. 161 | .. literalinclude:: ../examples/brad_tee_and_heatset_nuts.py 162 | :language: python 163 | 164 | .. 165 | .. doctest:: 166 | 167 | .. 168 | {'BradTeeNut(Hilitchi): M8-1.25': 1, 'HeatSetNut(McMaster-Carr): M4-0.7': 3, 'CounterSunkScrew(iso10642): M4-0.7x20': 3} 169 | ['M2-0.4-Short', 'M2-0.4-Standard', 'M3-0.5-Short', 'M3-0.5-Standard', 'M4-0.7-Short', 'M4-0.7-Standard', 'M5-0.8-Short', 'M5-0.8-Standard'] 170 | 171 | .. 172 | .. image:: assets/brad_tee_nut_assembly.png 173 | 174 | Note that a :class:`HeatSetNut` can only be placed with an :class:`InsertHole` 175 | (see the :ref:`Custom Holes ` section of more information). Also note that 176 | the size of a :class:`HeatSetNut` includes a length component like "-Standard" or "-Short" but this depends 177 | on the type. Use the sizes method to see the valid values. 178 | 179 | .. doctest:: 180 | 181 | >>> HeatSetNut.sizes("McMaster-Carr") 182 | ['M2-0.4-Short', 'M2-0.4-Standard', 'M3-0.5-Short', 'M3-0.5-Standard', 'M4-0.7-Short', 'M4-0.7-Standard', 'M5-0.8-Short', 'M5-0.8-Standard'] 183 | 184 | .. _screw: 185 | 186 | ***** 187 | Screw 188 | ***** 189 | As the base class of all other screw and bolt classes, all of the derived screw classes share the same 190 | interface as follows: 191 | 192 | .. autoclass:: fastener.Screw 193 | :exclude-members: clearance_hole_data, clearance_hole_drill_sizes, tap_hole_data, tap_hole_drill_sizes, nominal_length_range, make_head, countersink_profile, default_countersink_profile, fastener_data 194 | 195 | The following method helps with hole creation: 196 | 197 | 198 | .. .. automethod:: Screw.min_hole_depth 199 | 200 | 201 | Screw Selection 202 | =============== 203 | As there are many classes and types of screws to select from, the Screw class provides some methods that 204 | can help find the correct screw for your application. As a reminder, to find the subclasses of the 205 | Screw class, use :class:`__subclasses__()`: 206 | 207 | .. doctest:: 208 | 209 | >>> Screw.__subclasses__() 210 | [, ...] 211 | 212 | .. Here is a summary of the class methods: 213 | 214 | .. .. automethod:: Screw.types 215 | 216 | .. doctest:: 217 | 218 | >>> CounterSunkScrew.types() 219 | {'iso14582', 'iso10642', 'iso14581', 'iso2009', 'iso7046'} 220 | 221 | .. .. automethod:: Screw.sizes 222 | 223 | .. doctest:: 224 | 225 | >>> CounterSunkScrew.sizes("iso7046") 226 | ['M1.6-0.35', 'M2-0.4', 'M2.5-0.45', 'M3-0.5', 'M3.5-0.6', 'M4-0.7', 'M5-0.8', 'M6-1', 'M8-1.25', 'M10-1.5'] 227 | 228 | .. .. automethod:: Screw.select_by_size 229 | 230 | * :class:`select_by_size(size:str)` : (dict{class:[type,...],} - e.g.: 231 | 232 | .. doctest:: 233 | 234 | >>> Screw.select_by_size("M6-1") 235 | {: ['iso7380_1'], : ['iso7380_2'], ...} 236 | 237 | To see if a given screw type has screws in the length you are looking for, each screw class 238 | provides a dictionary of available lengths, as follows: 239 | 240 | .. doctest:: 241 | 242 | >>> CounterSunkScrew.nominal_length_range["iso7046"] 243 | [3.0, 4.0, 5.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0, 55.0, 60.0] 244 | 245 | During instantiation of a screw any value of :class:`length` may be used; however, only a subset of 246 | the above nominal_length_range is valid for any given screw size. The valid sub-range is given 247 | with the :class:`nominal_lengths` property as follows: 248 | 249 | .. doctest:: 250 | 251 | >>> screw = CounterSunkScrew(fastener_type="iso7046",size="M6-1",length=12 * MM) 252 | >>> screw.nominal_lengths 253 | [8.0, 10.0, 12.0, 14.0, 16.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0, 55.0, 60.0] 254 | 255 | 256 | Derived Screw Classes 257 | ===================== 258 | The following is a list of the current screw classes derived from the base Screw class. Also listed 259 | is the type for each of these derived classes where the type refers to a standard that defines the 260 | screw parameters. All derived screws inherit the same API as the base Screw class. 261 | 262 | * :class:`ButtonHeadScrew` : iso7380_1 263 | * :class:`ButtonHeadWithCollarScrew` : iso7380_2 264 | * :class:`CheeseHeadScrew` : iso14580, iso7048, iso1207 265 | * :class:`CounterSunkScrew` : iso2009, iso14582, iso14581, iso10642, iso7046 266 | * :class:`HexHeadScrew` : iso4017, din931, iso4014 267 | * :class:`HexHeadWithFlangeScrew` : din1662, din1665 268 | * :class:`LowProfileScrew` : OpenBuilds 269 | * :class:`PanHeadScrew` : asme_b_18.6.3, iso1580, iso14583 270 | * :class:`PanHeadWithCollarScrew` : din967 271 | * :class:`RaisedCheeseHeadScrew` : iso7045 272 | * :class:`RaisedCounterSunkOvalHeadScrew` : iso2010, iso7047, iso14584 273 | * :class:`SetScrew` : iso4026 274 | * :class:`SocketHeadCapScrew` : iso4762, asme_b18.3 275 | 276 | Detailed information about any of the screw types can be readily found on the internet from manufacture's 277 | websites or from the standard document itself. 278 | 279 | .. _washer: 280 | 281 | ****** 282 | Washer 283 | ****** 284 | As the base class of all other washer and bolt classes, all of the derived washer classes share 285 | the same interface as follows: 286 | 287 | .. autoclass:: Washer 288 | :members: types, sizes 289 | 290 | .. :exclude-members: clearance_hole_data, clearance_hole_drill_sizes, tap_hole_data, tap_hole_drill_sizes, nominal_length_range, make_head, countersink_profile, default_countersink_profile, default_washer_profile, fastener_data 291 | 292 | Washer Selection 293 | ================ 294 | As there are many classes and types of washers to select from, the Washer class provides some methods 295 | that can help find the correct washer for your application. As a reminder, to find the subclasses of 296 | the Washer class, use :class:`__subclasses__()`: 297 | 298 | .. doctest:: 299 | 300 | >>> Washer.__subclasses__() 301 | [, , ] 302 | 303 | Here is a summary of the class methods: 304 | 305 | .. .. automethod:: Washer.types 306 | 307 | .. doctest:: 308 | 309 | >>> PlainWasher.types() 310 | {'iso7091', 'iso7089', 'iso7093', 'iso7094'} 311 | 312 | .. .. automethod:: Washer.sizes 313 | 314 | .. doctest:: 315 | 316 | >>> PlainWasher.sizes("iso7091") 317 | ['M1.6', 'M1.7', 'M2', 'M2.3', 'M2.5', 'M2.6', 'M3', 'M3.5', 'M4', 'M5', 'M6', 'M7', 'M8', 'M10', 'M12', 'M14', 'M16', 'M18', 'M20', 'M22', 'M24', 'M26', 'M27', 'M28', 'M30', 'M32', 'M33', 'M35', 'M36'] 318 | 319 | .. .. automethod:: Washer.select_by_size 320 | 321 | .. doctest:: 322 | 323 | >>> Washer.select_by_size("M6") 324 | {: ['iso7094', 'iso7093', 'iso7089', 'iso7091'], : ['iso7090'], : ['iso7092']} 325 | 326 | 327 | Derived Washer Classes 328 | ====================== 329 | The following is a list of the current washer classes derived from the base Washer class. Also listed 330 | is the type for each of these derived classes where the type refers to a standard that defines the washer 331 | parameters. All derived washers inherit the same API as the base Washer class. 332 | 333 | * :class:`PlainWasher` : iso7094, iso7093, iso7089, iso7091 334 | * :class:`ChamferedWasher` : iso7090 335 | * :class:`CheeseHeadWasher` : iso7092 336 | * :class:`InternalToothLockWasher` : din6797, asme_b18.21.1 337 | 338 | Detailed information about any of the washer types can be readily found on the internet from manufacture's 339 | websites or from the standard document itself. 340 | 341 | .. _custom holes: 342 | 343 | ************ 344 | Custom Holes 345 | ************ 346 | When designing parts with build123d a common operation is to place holes appropriate to a specific fastener 347 | into the part. This operation is optimized with bd_warehouse by the following four custom hole objects: 348 | 349 | .. autoclass:: fastener.ClearanceHole 350 | .. autoclass:: fastener.InsertHole 351 | .. autoclass:: fastener.TapHole 352 | .. autoclass:: fastener.ThreadedHole 353 | 354 | The APIs for these holes are very similar. The ``fit`` parameter is used 355 | for clearance hole dimensions and to calculate the gap around the head of a countersunk screw. 356 | The ``material`` parameter controls the size of the tap hole as they differ as a function of the 357 | material the part is made of. For clearance and tap holes, ``depth`` values of ``None`` are treated 358 | as thru holes. The threaded hole method requires that ``depth`` be specified as a consequence of 359 | how the thread is constructed. 360 | 361 | These methods use data provided by a fastener instance (either a :class:`Nut` or a :class:`Screw`) to both create 362 | the appropriate hole (possibly countersunk) in your part as well as add the location of the holes to 363 | the fastener's ``hole_locations`` attribute to ease the creation of assemblies with both the 364 | base parts and fasteners. 365 | 366 | For example, let's build the parametric bearing pillow block: 367 | 368 | .. literalinclude:: ../examples/pillow_block.py 369 | 370 | Which results in: 371 | 372 | .. image:: assets/pillow_block.png 373 | :alt: pillow_block 374 | 375 | Note the following benefits: 376 | 377 | * screw and bearing dimensions aren't required, 378 | * the screw is created during instantiation of the :class:`SocketHeadCapScrew` class 379 | without the user knowing any of its dimensions, 380 | * the :class:`ClearanceHole` object only requires the fastener thus the user need 381 | not provide hole dimensions. 382 | * the assembly contains both the part and copies of the fastener thus avoiding the 383 | overhead of many fasteners in the design. 384 | 385 | Not only were the appropriate holes for the bearing and M2-0.4 screws created but an assembly was created to 386 | store all of the parts in this project all without having to research the dimensions of the parts. 387 | 388 | Note: In this example the ``simple=False`` parameter creates accurate threads on each of the 389 | screws which significantly increases the complexity of the model. The default of simple is True 390 | which models the thread as a simple cylinder which is sufficient for most applications without 391 | the performance cost of accurate threads. 392 | 393 | The data used in the creation of these holes is available via three instance methods: 394 | 395 | .. doctest:: 396 | 397 | >>> screw = CounterSunkScrew(fastener_type="iso7046", size="M6-1", length=10) 398 | >>> screw.clearance_hole_diameters 399 | {'Close': 6.4, 'Normal': 6.6, 'Loose': 7.0} 400 | 401 | >>> screw.clearance_drill_sizes 402 | {'Close': '6.4', 'Normal': '6.6', 'Loose': '7'} 403 | >>> screw.tap_hole_diameters 404 | {'Soft': 5.0, 'Hard': 5.4} 405 | >>> screw.tap_drill_sizes 406 | {'Soft': '5', 'Hard': '5.4'} 407 | 408 | Note that with imperial sized holes (e.g. 7/16), the drill sizes could be a fractional size (e.g. 25/64) 409 | or a numbered or lettered size (e.g. U). 410 | 411 | Captive Nuts 412 | ============ 413 | 414 | The :class:`ClearanceHole` method has a ``captive_nut`` parameter that 415 | when used with a hex or square nut will create a hole that captures the nut such that it 416 | can't spin. Here is an example: 417 | 418 | .. literalinclude:: ../examples/captive_nuts.py 419 | 420 | Which results in: 421 | 422 | .. image:: assets/captive_nuts.png 423 | :alt: captive_nuts 424 | 425 | The space around the nuts is controlled by the ``fit`` parameter. 426 | 427 | .. _extending: 428 | 429 | ********************************** 430 | Extending the fastener sub-package 431 | ********************************** 432 | The fastener sub-package has been designed to be extended in the following two ways: 433 | 434 | 435 | Alternate Sizes 436 | =============== 437 | As mentioned previously, the data used to guide the creation of fastener objects is derived 438 | from :class:`.csv` files found in the same place as the source code. One can add to the set of standard 439 | sized fasteners by inserting appropriate data into the tables. There is a table for each fastener 440 | class; an example of the 'socket_head_cap_parameters.csv' is below: 441 | 442 | +------------+------------+-----------+-----+---------------+--------------+-----+--------------+ 443 | | Size | iso4762:dk | iso4762:k | ... | asme_b18.3:dk | asme_b18.3:k | | asme_b18.3:s | 444 | +============+============+===========+=====+===============+==============+=====+==============+ 445 | | M2-0.4 | 3.98 | 2 | | | | | | 446 | +------------+------------+-----------+-----+---------------+--------------+-----+--------------+ 447 | | M2.5-0.45 | 4.68 | 2.5 | | 0.096 | 0.06 | | 0.05 | 448 | +------------+------------+-----------+-----+---------------+--------------+-----+--------------+ 449 | | M3-0.5 | 5.68 | 3 | | 0.118 | 0.073 | | 1/16 | 450 | +------------+------------+-----------+-----+---------------+--------------+-----+--------------+ 451 | | ... | | | | 0.118 | 0.073 | | 1/16 | 452 | +------------+------------+-----------+-----+---------------+--------------+-----+--------------+ 453 | | #0-80 | | | | 0.14 | 0.086 | | 5/64 | 454 | +------------+------------+-----------+-----+---------------+--------------+-----+--------------+ 455 | | #1-64 | | | | | | | | 456 | +------------+------------+-----------+-----+---------------+--------------+-----+--------------+ 457 | | #1-72 | | | | | | | | 458 | +------------+------------+-----------+-----+---------------+--------------+-----+--------------+ 459 | | #2-56 | | | | | | | | 460 | +------------+------------+-----------+-----+---------------+--------------+-----+--------------+ 461 | 462 | The first row must contain a 'Size' and a set of '{fastener_type}:{parameter}' 463 | values. The parameters are taken from the ISO standards where 'k' represents the 464 | head height of a screw head, 'dk' is represents the head diameter, etc. Refer to 465 | the appropriate document for a complete description. The fastener 'Size' field 466 | has the format 'M{thread major diameter}-{thread pitch}' for metric fasteners or 467 | either '#{guage}-{TPI}' or '{fractional major diameter}-{TPI}' for imperial 468 | fasteners (TPI refers to Threads Per Inch). All the data for imperial fasteners 469 | must be entered as inch dimensions while metric data is in millimeters. 470 | 471 | There is also a 'nominal_screw_lengths.csv' file that contains a list of all the 472 | lengths supported by the standard, as follows: 473 | 474 | +------------+------+--------------------------+ 475 | | Screw_Type | Unit | Nominal_Sizes | 476 | +============+======+==========================+ 477 | | din931 | mm | 30,35,40,45,50,55,60,... | 478 | +------------+------+--------------------------+ 479 | | ... | | | 480 | +------------+------+--------------------------+ 481 | 482 | The 'short' and 'long' values from the first table (not shown) control the 483 | minimum and maximum values in the nominal length ranges for each screw. 484 | 485 | New Fastener Types 486 | ================== 487 | The base/derived class structure was designed to allow the creation of new 488 | fastener types/classes. For new fastener classes a 2D drawing of one half of the 489 | fastener profile is required. If the fastener has a non circular plan (e.g. a 490 | hex or a square) a 2D drawing of the plan is required. If the fastener contains 491 | a flange and a plan, a 2D profile of the flange is required. If these profiles 492 | or plans are present, the base class will use them to build the fastener. The 493 | Abstract Base Class technology ensures derived classes can't be created with 494 | missing components. 495 | 496 | ********* 497 | Reference 498 | ********* 499 | 500 | .. autoclass:: DomedCapNut 501 | .. autoclass:: HeatSetNut 502 | .. autoclass:: HexNut 503 | .. autoclass:: HexNutWithFlange 504 | .. autoclass:: UnchamferedHexagonNut 505 | .. autoclass:: SquareNut 506 | .. autoclass:: ButtonHeadScrew 507 | .. autoclass:: ButtonHeadWithCollarScrew 508 | .. autoclass:: CheeseHeadScrew 509 | .. autoclass:: CounterSunkScrew 510 | .. autoclass:: HexHeadScrew 511 | .. autoclass:: HexHeadWithFlangeScrew 512 | .. autoclass:: PanHeadScrew 513 | .. autoclass:: PanHeadWithCollarScrew 514 | .. autoclass:: RaisedCheeseHeadScrew 515 | .. autoclass:: RaisedCounterSunkOvalHeadScrew 516 | .. autoclass:: SetScrew 517 | .. autoclass:: SocketHeadCapScrew 518 | .. autoclass:: PlainWasher 519 | .. autoclass:: ChamferedWasher 520 | .. autoclass:: CheeseHeadWasher 521 | -------------------------------------------------------------------------------- /docs/flange.rst: -------------------------------------------------------------------------------- 1 | .. 2 | bd_warehouse/flange 3 | 4 | by: Gumyr 5 | date: June 12th 2023 6 | 7 | desc: This is the documentation for b3d_warehouse/flange. 8 | 9 | license: 10 | 11 | Copyright 2023 Gumyr 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); 14 | you may not use this file except in compliance with the License. 15 | You may obtain a copy of the License at 16 | 17 | http://www.apache.org/licenses/LICENSE-2.0 18 | 19 | Unless required by applicable law or agreed to in writing, software 20 | distributed under the License is distributed on an "AS IS" BASIS, 21 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | See the License for the specific language governing permissions and 23 | limitations under the License. 24 | 25 | ######################################## 26 | flange - standardized parametric flanges 27 | ######################################## 28 | 29 | .. highlight:: python 30 | 31 | .. image:: assets/flange_logo.png 32 | :alt: flange_logo 33 | 34 | Flanges are mechanical components used in piping systems to connect pipes, 35 | valves, and equipment. They provide a secure and leak-tight connection by 36 | bolting two flange faces together. Flanges allow for easy assembly and 37 | disassembly, enabling maintenance and modifications in the system. They are 38 | available in various materials, sizes, and pressure ratings to suit different 39 | applications. Flanges also provide flexibility by allowing different types of 40 | connections, such as welding, threaded, or flanged connections. They play a 41 | critical role in industries like oil and gas, chemical, and power generation, 42 | ensuring the safe and efficient operation of piping systems by facilitating 43 | proper alignment, support, and sealing of the connected components. 44 | 45 | .. code-block:: python 46 | 47 | from build123d import * 48 | from bd_warehouse.flange import SlipOnFlange, WeldNeckFlange 49 | 50 | flange1 = SlipOnFlange(nps="8", flange_class=150) 51 | flange2 = WeldNeckFlange(nps="12", flange_class=300, face_type="Ring") 52 | 53 | There are two required and one optional parameters used to define a flange: ``nps``, 54 | ``flange_class``, and ``face_type``. 55 | 56 | nps 57 | --- 58 | 59 | See :ref:`Pipe NPS ` for a description of the Nominal Pipe Size. 60 | 61 | flange_class 62 | ------------ 63 | 64 | Flange class refers to the pressure-temperature rating assigned to a flange 65 | based on its design and construction. It represents the maximum pressure and 66 | temperature at which the flange can safely operate without failure. Flange 67 | classes are defined by various standards, such as ASME B16.5 or API 6A, and are 68 | typically identified by a numerical value (e.g., Class 150, Class 300, etc.). 69 | Each flange class has specific requirements for materials, dimensions, and 70 | performance, ensuring that the flange can withstand the specified pressure and 71 | temperature conditions. Flange class selection is crucial for maintaining the 72 | integrity and safety of a piping system by ensuring that the flange can handle 73 | the intended service conditions. 74 | 75 | .. py:module:: flange 76 | 77 | .. autoclass:: FlangeClass 78 | 79 | face_type 80 | --------- 81 | 82 | The face of a flange refers to the surface where two flanges come into contact 83 | with each other during the connection. There are several different types 84 | of flange faces, each serving a specific purpose. These include: 85 | 86 | * Flat Face (FF): The flange faces are flat and parallel to each other. It 87 | is typically used in low-pressure applications where leakage prevention 88 | is not a significant concern. 89 | * Raised Face (RF): The flange faces have a raised portion around the 90 | perimeter. The raised face provides a compression seal when the flanges 91 | are bolted together, improving the sealing capability. 92 | * Lap Joint (LJ): The flange faces have a flat surface, and a separate lap 93 | joint stub end is used between the flanges. It allows easy alignment and 94 | rotation of the flanges during assembly. 95 | * Ring Type Joint (RTJ): The flange faces have grooves to accommodate a 96 | metallic ring gasket. It is commonly used in high-pressure and 97 | high-temperature applications, providing excellent sealing performance. 98 | * Tongue and Groove: The flange faces have a tongue-like projection on one 99 | flange and a corresponding groove on the other flange. It ensures proper 100 | alignment and prevents movement or rotation between the flanges. 101 | 102 | The selection of the flange face type depends on the specific application, 103 | pressure, temperature, and sealing requirements of the piping system. Different 104 | flange faces offer varying levels of sealing capability and ease of assembly, 105 | allowing engineers and designers to choose the most suitable option for their 106 | intended purpose. 107 | 108 | .. autoclass:: FaceType 109 | 110 | 111 | Joints 112 | ------ 113 | 114 | All flanges are created with two ``RigidJoint``: ``pipe`` and ``face``. These joints 115 | are positioned in the center of the flange and oriented such that they can be easily 116 | connected to pipes and each other. For example: 117 | 118 | .. code-block:: python 119 | 120 | inlet_flange = WeldNeckFlange(nps="12", flange_class=300, face_type="Ring") 121 | outlet_flange = SlipOnFlange(nps="12", flange_class=300) 122 | pipe = Pipe( 123 | nps="12", 124 | material="steel", 125 | identifier="40", 126 | path=Edge.make_line((0, 0, 0), (6 * FT, 0, 0)), 127 | ) 128 | 129 | pipe.joints["inlet"].connect_to(inlet_flange.joints["pipe"]) 130 | pipe.joints["outlet"].connect_to(outlet_flange.joints["pipe"]) 131 | 132 | .. image:: assets/pipe_and_flanges.png 133 | :alt: pipe_and_flanges 134 | 135 | Flange Types 136 | ------------ 137 | 138 | .. autoclass:: BlindFlange 139 | :members: 140 | 141 | .. autoclass:: LappedFlange 142 | :members: 143 | 144 | .. autoclass:: LappedFlangeStub 145 | :members: 146 | 147 | .. autoclass:: SlipOnFlange 148 | :members: 149 | 150 | .. autoclass:: SocketWeldFlange 151 | :members: 152 | 153 | .. autoclass:: WeldNeckFlange 154 | :members: 155 | 156 | Specifications 157 | -------------- 158 | 159 | The flanges created by this package are based off the following standards: 160 | 161 | * ASME B16.5 is a standard issued by the American Society of Mechanical Engineers 162 | (ASME) that provides specifications for pipe flanges and flanged fittings. It 163 | covers a wide range of flange types, sizes, materials, and pressure ratings. 164 | ASME B16.5 establishes the dimensions, tolerances, and technical requirements 165 | for flanges used in various industries, including oil and gas, chemical, and 166 | power generation. The standard ensures the compatibility, integrity, and 167 | performance of flanged connections, facilitating proper alignment, sealing, and 168 | strength of the joint. It serves as a reference for manufacturers, engineers, 169 | and designers in the selection, design, and installation of flanges, promoting 170 | safe and reliable operation of piping systems. 171 | -------------------------------------------------------------------------------- /docs/gear.rst: -------------------------------------------------------------------------------- 1 | ####################### 2 | gear - parametric gears 3 | ####################### 4 | 5 | This Python package enables the creation of a wide variety of standard ISO (metric) 6 | involute spur gears. Involute gears have the advantage of continually meshing at a 7 | specific angle, known as the pressure angle, which prevents the stuttering that can 8 | occur with non-involute gears when the teeth lose contact. 9 | 10 | .. image:: assets/gears.png 11 | 12 | Application Example 13 | =================== 14 | 15 | Imagine a telescope mount: involute gears allow the telescope to smoothly follow a star as 16 | it moves across the night sky, ensuring a steady image during long exposures. In contrast, 17 | non-involute gears might introduce vibrations that blur the image. 18 | 19 | Ensuring Proper Gear Meshing 20 | ============================ 21 | 22 | Gears must mesh properly to function effectively. Here are the guidelines to ensure proper 23 | meshing: 24 | 25 | Tooth Shape and Size Consistency: 26 | --------------------------------- 27 | Meshing gears must have the same tooth shape and size. Use a common module for metric 28 | gears or a common diametral pitch value for imperial gears. For fully custom gears, 29 | ensure that the base, pitch, and outer radii are calculated correctly. 30 | 31 | Proper Gear Separation: 32 | ----------------------- 33 | When positioning two gears to mesh, they should be separated by the sum of their 34 | pitch radii. The separation can be calculated easily: 35 | 36 | Multiply the gear module by the sum of the tooth count of both gears and divide by two. 37 | 38 | .. math:: 39 | \text{separation} = \text{module} \cdot \frac{n_0 + n_1}{2} [mm] 40 | 41 | Example Code 42 | =================== 43 | .. code-block:: python 44 | 45 | from build123d import * 46 | from bd_warehouse.gear import InvoluteToothProfile, SpurGear, SpurGearPlan 47 | 48 | gear_tooth = InvoluteToothProfile( 49 | module=2, 50 | tooth_count=12, 51 | pressure_angle=14.5, 52 | root_fillet=0.5 * MM, 53 | ) 54 | 55 | gear_profile = SpurGearPlan( 56 | module=2, 57 | tooth_count=12, 58 | pressure_angle=14.5, 59 | root_fillet=0.5 * MM, 60 | ) 61 | 62 | spur_gear = SpurGear( 63 | module=2, 64 | tooth_count=12, 65 | pressure_angle=14.5, 66 | root_fillet=0.5 * MM, 67 | thickness=5 * MM, 68 | ) 69 | 70 | 71 | .. autoclass:: gear.InvoluteToothProfile 72 | .. autoclass:: gear.SpurGearPlan 73 | .. autoclass:: gear.SpurGear 74 | 75 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. 2 | bd_warehouse readthedocs documentation 3 | 4 | by: Gumyr 5 | date: June 11th 2023 6 | 7 | desc: This is the documentation for bd_warehouse on readthedocs. 8 | 9 | license: 10 | 11 | Copyright 2023 Gumyr 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); 14 | you may not use this file except in compliance with the License. 15 | You may obtain a copy of the License at 16 | 17 | http://www.apache.org/licenses/LICENSE-2.0 18 | 19 | Unless required by applicable law or agreed to in writing, software 20 | distributed under the License is distributed on an "AS IS" BASIS, 21 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | See the License for the specific language governing permissions and 23 | limitations under the License. 24 | 25 | 26 | .. highlight:: python 27 | 28 | .. image:: assets/bd_title_image.png 29 | 30 | If you've ever wondered about finding a better alternative to proprietary 31 | software for mechanical CAD, consider exploring 32 | `Build123d `_, along with related 33 | packages like **bd_warehouse** and `cq_gears `_. 34 | Build123d enhances the widely used Python programming language by adding powerful 35 | capabilities that enable the creation of various mechanical designs using the same 36 | techniques employed in today's technology. 37 | 38 | By incorporating **bd_warehouse** into **Build123d**, you gain access to on-demand 39 | generation of parametric parts and extensions that expand the core capabilities 40 | of Build123d. These resulting parts can be seamlessly integrated into your 41 | projects or saved as CAD files in formats such as STEP or STL. This allows for 42 | compatibility with a wide range of CAD, CAM, and analytical systems. 43 | 44 | With just a few lines of code, you can create parametric parts that are easily 45 | reviewable and version controlled using tools like `git `_ 46 | and `GitHub `_. 47 | Documentation can be automatically generated from the source code of your 48 | designs, similar to the documentation you're currently reading. Additionally, 49 | comprehensive test suites can automatically validate parts, ensuring that no 50 | flaws are introduced during their lifecycle. 51 | 52 | The benefits of adopting a full software development pipeline are numerous and 53 | extend beyond the scope of this text. Furthermore, all these tools are 54 | open-source, free to use, and customizable, eliminating the need for licenses. 55 | Empower yourself by taking control of your CAD development tools. 56 | 57 | 58 | ================= 59 | Table Of Contents 60 | ================= 61 | 62 | .. toctree:: 63 | :maxdepth: 2 64 | 65 | installation.rst 66 | bearing.rst 67 | fastener.rst 68 | flange.rst 69 | gear.rst 70 | openbuilds.rst 71 | pipe.rst 72 | thread.rst 73 | 74 | .. chain.rst 75 | .. drafting.rst 76 | .. finger_jointed_boxes.rst 77 | .. sprocket.rst 78 | 79 | ================== 80 | Indices and tables 81 | ================== 82 | 83 | * :ref:`genindex` 84 | * :ref:`modindex` 85 | * :ref:`search` 86 | -------------------------------------------------------------------------------- /docs/installation.rst: -------------------------------------------------------------------------------- 1 | ############ 2 | Installation 3 | ############ 4 | Install bd_warehouse from github: 5 | ---------------------------------------------- 6 | 7 | The recommended method for most users is to install bd_warehouse with one of the following two commands. 8 | 9 | In Linux/MacOS, use the following command: 10 | 11 | .. doctest:: 12 | 13 | >>> python3 -m pip install git+https://github.com/gumyr/bd_warehouse 14 | 15 | In Windows, use the following command: 16 | 17 | .. doctest:: 18 | 19 | >>> python -m pip install git+https://github.com/gumyr/bd_warehouse 20 | 21 | If you receive errors about conflicting dependencies, you can retry the installation after having 22 | upgraded pip to the latest version with the following command: 23 | 24 | .. doctest:: 25 | 26 | >>> python3 -m pip install --upgrade pip 27 | 28 | If you use `poetry `_ to install bd_warehouse, you might need to specify 29 | the branch that is used for git-based installs ; until quite recently, poetry used to checkout the 30 | `master` branch when none was specified, and this fails on bd_warehouse that uses a `dev` branch. 31 | 32 | Pip does not suffer from this issue because it correctly fetches the repository default branch. 33 | 34 | If you are a poetry user, you can work around this issue by installing bd_warehouse in the following 35 | way: 36 | 37 | .. doctest:: 38 | 39 | >>> poetry add git+https://github.com/gumyr/bd_warehouse.git@dev 40 | 41 | Please note that always suffixing the URL with ``@dev`` is safe and will work with both older and 42 | recent versions of poetry. 43 | 44 | Development install of bd_warehouse: 45 | ---------------------------------------------- 46 | **Warning**: it is highly recommended to upgrade pip to the latest version before installing 47 | bd_warehouse, especially in development mode. This can be done with the following command: 48 | 49 | .. doctest:: 50 | 51 | >>> python3 -m pip install --upgrade pip 52 | 53 | Once pip is up-to-date, you can install bd_warehouse 54 | `in development mode `_ 55 | with the following commands: 56 | 57 | .. doctest:: 58 | 59 | >>> git clone https://github.com/gumyr/bd_warehouse.git 60 | >>> cd bd_warehouse 61 | >>> python3 -m pip install -e . 62 | 63 | Please substitute ``python3`` with ``python`` in the lines above if you are using Windows. 64 | 65 | Test your bd_warehouse installation: 66 | ---------------------------------------------- 67 | If all has gone well, you can open a command line/prompt, and type: 68 | 69 | .. doctest:: 70 | 71 | >>> python 72 | >>> from build123d import * 73 | >>> from bd_warehouse.fastener import SocketHeadCapScrew 74 | 75 | >>> screw = SocketHeadCapScrew("M6-1", 10 * MM, "iso4762") 76 | >>> screw.head_diameter 77 | 10.220000000000002 78 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=build 12 | 13 | %SPHINXBUILD% >NUL 2>NUL 14 | if errorlevel 9009 ( 15 | echo. 16 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 17 | echo.installed, then set the SPHINXBUILD environment variable to point 18 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 19 | echo.may add the Sphinx directory to PATH. 20 | echo. 21 | echo.If you don't have Sphinx installed, grab it from 22 | echo.https://www.sphinx-doc.org/ 23 | exit /b 1 24 | ) 25 | 26 | if "%1" == "" goto help 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/openbuilds.rst: -------------------------------------------------------------------------------- 1 | ######################################### 2 | open_builds - parametric OpenBuilds parts 3 | ######################################### 4 | OpenBuilds is a comprehensive online platform for makers and DIY enthusiasts focused on 5 | building custom machines. The site offers a wide range of resources including detailed 6 | build guides for CNC machines, 3D printers, laser cutters, and more. Users can share 7 | their projects, access forums for community support, and find software tools like 8 | OpenBuilds CAM and CONTROL for machine operation. Additionally, there is a part store 9 | for sourcing components and a gallery showcasing completed builds. The site encourages 10 | collaboration and innovation within the maker community. 11 | 12 | For more information, visit `OpenBuilds `_. 13 | 14 | .. image:: assets/openbuilds.png 15 | 16 | .. py:module:: open_builds 17 | 18 | .. note:: All Joints are currently experimental and subject to change 19 | 20 | *********** 21 | CAD Objects 22 | *********** 23 | 24 | The following rail profiles can be used to create custom extrusions. 25 | 26 | .. image:: assets/openbuilds_profiles.png 27 | 28 | .. autoclass:: CBeamLinearRailProfile 29 | .. autoclass:: VSlotLinearRailProfile 30 | 31 | ***** 32 | Parts 33 | ***** 34 | 35 | Parts available in the OpenBuilds part store: 36 | 37 | .. image:: assets/openbuilds_parts.png 38 | 39 | .. autoclass:: AcmeAntiBacklashNutBlock8mm 40 | .. autoclass:: AluminumSpacer 41 | .. autoclass:: CBeamEndMount 42 | .. autoclass:: CBeamLinearRail 43 | .. autoclass:: CBeamGantryPlate 44 | .. autoclass:: CBeamGantryPlateXLarge 45 | .. autoclass:: CBeamRiserPlate 46 | .. autoclass:: EccentricSpacer 47 | .. autoclass:: FlexibleCoupler 48 | .. autoclass:: LockCollar 49 | .. autoclass:: fastener.LowProfileScrew 50 | :noindex: 51 | .. autoclass:: MetricLeadScrew 52 | .. autoclass:: RouterSpindleMount 53 | .. autoclass:: ShimWasher 54 | .. autoclass:: bearing.SingleRowCappedDeepGrooveBallBearing 55 | :noindex: 56 | .. autoclass:: SpacerBlock 57 | .. autoclass:: StepperMotor 58 | .. autoclass:: VSlotLinearRail 59 | .. autoclass:: XtremeSolidVWheel 60 | 61 | ********** 62 | Assemblies 63 | ********** 64 | 65 | Part assemblies available to be combined into custom machines. 66 | 67 | .. image:: assets/openbuilds_assemblies.png 68 | 69 | .. autoclass:: AcmeAntiBacklashNutBlock8mmAssembly 70 | .. autoclass:: XLargeCBeamGantry 71 | .. autoclass:: XtremeSolidVWheelAssembly 72 | -------------------------------------------------------------------------------- /docs/pipe.rst: -------------------------------------------------------------------------------- 1 | .. 2 | bd_warehouse/pipe 3 | 4 | by: Gumyr 5 | date: June 11th 2023 6 | 7 | desc: This is the documentation for b3d_warehouse/pipe. 8 | 9 | license: 10 | 11 | Copyright 2023 Gumyr 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); 14 | you may not use this file except in compliance with the License. 15 | You may obtain a copy of the License at 16 | 17 | http://www.apache.org/licenses/LICENSE-2.0 18 | 19 | Unless required by applicable law or agreed to in writing, software 20 | distributed under the License is distributed on an "AS IS" BASIS, 21 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | See the License for the specific language governing permissions and 23 | limitations under the License. 24 | 25 | #################################### 26 | pipe - standardized parametric pipes 27 | #################################### 28 | 29 | .. highlight:: python 30 | 31 | .. image:: assets/pipe_logo.png 32 | :alt: pipe_logo 33 | 34 | Pipes are a critical component of many industrial and chemical processing facilities. 35 | The pipe sub-package provides Pipe and PipeSection classes that make the creation of 36 | industry standard sized pipes easy by providing an API that just requires selection 37 | from commonly used parameters. 38 | 39 | 40 | .. code-block:: python 41 | 42 | from build123d import * 43 | from bd_warehouse.pipe import Pipe 44 | 45 | stainless_pipe = Pipe( 46 | nps="2 1/2", 47 | material="stainless", 48 | identifier="10S", 49 | path=Edge.make_line((0, 0, 0), (5 * FT, 0, 0)), 50 | ) 51 | 52 | with BuildPart() as copper_pipes: 53 | with BuildLine(Plane.XZ): 54 | l1 = Line((0, 0), (0, 6 * FT)) 55 | l2 = Line(l1 @ 1 + (0, -3 * IN), l1 @ 1 + (1 * FT, -3 * IN)) 56 | l3 = RadiusArc(l2 @ 1, l2 @ 1 + (0, -3 * FT), 1.5 * FT) 57 | l4 = Line(l3 @ 1, l3 @ 1 + (-1 * FT, 0)) 58 | Pipe(nps="6", material="copper", identifier="K") 59 | 60 | There are three parameters that required to define a pipe: nps, material, and 61 | identifier. 62 | 63 | .. _nps: 64 | 65 | nps 66 | --- 67 | 68 | NPS stands for "Nominal Pipe Size." It is a standard designation used to 69 | indicate the approximate inside diameter (ID) of a pipe or fitting, typically 70 | for industrial and plumbing applications. NPS is expressed as a numerical value 71 | without any unit of measurement. 72 | 73 | It's important to note that NPS does not directly correspond to the actual 74 | physical dimensions of the pipe. Instead, it provides a convenient reference 75 | for pipe sizing and selection purposes. The actual outside diameter (OD) and 76 | wall thickness of a pipe can vary depending on the specific material, 77 | manufacturing standards, and application requirements. 78 | 79 | NPS values are based on a standardized system and are associated with a 80 | specific set of dimensions and tolerances provided by various standards, such 81 | as ASME B36.10 for carbon and alloy steel pipes and ASME B36.19 for stainless 82 | steel pipes. 83 | 84 | When specifying or discussing pipe sizes, NPS is commonly used to identify the 85 | general size range of a pipe, and further details such as OD and wall thickness 86 | are provided separately. It serves as a convenient way to communicate and 87 | compare pipe sizes within the industry, facilitating the selection and 88 | compatibility of pipes, fittings, and related components. 89 | 90 | .. py:module:: pipe 91 | 92 | .. autoclass:: Nps 93 | 94 | material & identifier 95 | --------------------- 96 | 97 | The dimensions of pipes vary by the pipe material as described in the following 98 | Specifications section. 99 | 100 | The following table defines the available materials and the valid identifier's 101 | for each material: 102 | 103 | +-------------+---------------------------------+----------------------------------------------------------------+ 104 | | material | description | identifier or schedule | 105 | +=============+=================================+================================================================+ 106 | | "abs" | drainage or vent pipes | "40" | 107 | +-------------+---------------------------------+----------------------------------------------------------------+ 108 | | "copper" | plumbing pipes | "K", "L", "M" | 109 | +-------------+---------------------------------+----------------------------------------------------------------+ 110 | | "iron" | iron/steel pipes | "STD", "XS", "XXS" | 111 | +-------------+---------------------------------+----------------------------------------------------------------+ 112 | | "pvc" | water pipes | "40", "80" | 113 | +-------------+---------------------------------+----------------------------------------------------------------+ 114 | | "stainless" | austenitic stainless steel pipe | "5S", "10S", "20S", "40S", "80S" | 115 | +-------------+---------------------------------+----------------------------------------------------------------+ 116 | | "steel" | steel pipes | "10", "20", "30", "40", "60", "80", "100", "120", "140", "160" | 117 | +-------------+---------------------------------+----------------------------------------------------------------+ 118 | 119 | Joints 120 | ------ 121 | 122 | All pipes are created with two ``RigidJoint``: ``inlet`` and ``outlet``. These joints 123 | are positioned in the center of the pipe and oriented such that connecting the outlet 124 | of one pipe to the inlet of another will align them appropriately. 125 | 126 | 127 | Specifications 128 | -------------- 129 | 130 | The pipes created by this package are based off the following standards: 131 | 132 | * ASTM A312 is a standard specification issued by the American Society for 133 | Testing and Materials (ASTM) that covers seamless, welded, and heavily 134 | cold-worked austenitic stainless steel pipe intended for high-temperature 135 | and general corrosive service. The standard specifies various dimensions, 136 | mechanical properties, testing requirements, and acceptable manufacturing 137 | practices for stainless steel pipes. 138 | * ASME B36 is a standard issued by the American Society of Mechanical Engineers 139 | (ASME) that provides guidelines for the dimensions, tolerances, and related 140 | requirements of steel pipes and fittings. It covers both seamless and welded 141 | pipes made from various materials, including carbon steel, stainless steel, 142 | and alloy steel. The standard specifies the nominal pipe sizes (NPS), outside 143 | diameters (OD), wall thicknesses, and length dimensions. ASME B36 aims to ensure 144 | consistency and compatibility in the design, manufacturing, and installation of 145 | steel pipes, facilitating efficient piping system construction and operation in 146 | various industries. 147 | * ASTM B88 is a standard specification issued by ASTM International for seamless 148 | copper water tube used in plumbing applications. The standard defines the requirements 149 | for copper water tube in terms of its dimensions, chemical composition, mechanical 150 | properties, and permissible variations. It covers various sizes and types of copper 151 | water tube, including both hard-drawn and annealed tempers. ASTM B88 ensures the 152 | quality and reliability of copper water tube by providing specifications for its 153 | manufacturing and performance. It serves as a reference for manufacturers, engineers, 154 | and contractors involved in plumbing systems, ensuring compatibility, durability, 155 | and safe water transportation. 156 | * ASTM F628 is a standard specification issued by ASTM International that pertains 157 | to the installation and performance requirements of plastic pipes in non-pressure 158 | applications. It specifically focuses on the installation of plastic pipes, such 159 | as PVC (Polyvinyl Chloride) and CPVC (Chlorinated Polyvinyl Chloride), for drainage, 160 | waste, and vent systems. The standard covers various aspects, including pipe sizes, 161 | materials, dimensions, joint methods, and testing procedures. ASTM F628 ensures the 162 | proper installation and performance of plastic pipes in non-pressure plumbing 163 | applications, promoting safe and efficient drainage and waste disposal systems in 164 | residential and commercial buildings. 165 | * ASTM D1785 is a standard specification issued by ASTM International for rigid 166 | polyvinyl chloride (PVC) pipes used in pressure applications, primarily in potable 167 | water systems. The standard outlines the requirements for PVC pipes in terms of 168 | their dimensions, material properties, and quality control procedures. It covers 169 | various aspects, including pipe sizes, wall thicknesses, chemical composition, 170 | hydrostatic pressure testing, and marking. ASTM D1785 ensures the durability, 171 | strength, and safety of PVC pipes by establishing guidelines for their manufacturing, 172 | performance, and testing. The standard serves as a reference for manufacturers, 173 | engineers, and regulatory bodies to ensure the reliable and efficient use of PVC 174 | pipes in pressure applications. 175 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | # TODO: delete this file as it is no longer used to build the docs 2 | # Defining the exact version will make sure things don't break 3 | sphinx==5.3.0 4 | sphinx_rtd_theme>=0.5.1 5 | docutils<0.17 6 | readthedocs-sphinx-search>=0.3.2 7 | sphinx_autodoc_typehints==1.12.0 8 | sphinx_copybutton 9 | sphinx-hoverxref 10 | sphinx_design 11 | -e git+https://github.com/gumyr/build123d.git#egg=build123d 12 | -e git+https://github.com/gumyr/bd_warehouse.git#egg=bd_warehouse 13 | -------------------------------------------------------------------------------- /docs/thread.rst: -------------------------------------------------------------------------------- 1 | 2 | ################################### 3 | thread - parametric helical threads 4 | ################################### 5 | 6 | .. image:: assets/thread_examples.png 7 | :alt: thread_examples 8 | 9 | Helical threads are very common in mechanical designs but can be tricky to 10 | create in a robust and efficient manner. This sub-package provides classes that 11 | create three common types of threads: 12 | 13 | * ISO Standard 60° threads found on most fasteners 14 | * Acme 29° threads found on imperial machine equipment 15 | * Metric Trapezoidal 30° thread found on metric machine equipment 16 | 17 | In addition, all threads support four different end finishes: 18 | 19 | * "raw" - where the thread extends beyond the desired length ready for integration into another part 20 | * "fade" - where the end of the thread spirals in - or out for internal threads 21 | * "square" - where the end of the thread is flat 22 | * "chamfer" - where the end of the thread is chamfered as commonly found on machine screws 23 | 24 | Here is what they look like (clockwise from the top: "fade", "chamfer", "square" and "raw"): 25 | 26 | .. image:: assets/thread_end_finishes.png 27 | :alt: EndFinishes 28 | 29 | When choosing between these four options, consider the performance differences 30 | between them. Here are some measurements that give a sense of the relative 31 | performance: 32 | 33 | +-----------+--------+ 34 | | Finish | Time | 35 | +===========+========+ 36 | | "raw" | 0.018s | 37 | +-----------+--------+ 38 | | "fade" | 0.087s | 39 | +-----------+--------+ 40 | | "square" | 0.370s | 41 | +-----------+--------+ 42 | | "chamfer" | 1.641s | 43 | +-----------+--------+ 44 | 45 | The "raw" and "fade" end finishes do not use any boolean operations which is why 46 | they are so fast. "square" does a cut() operation with a box while "chamfer" 47 | does an intersection() with a chamfered cylinder. 48 | 49 | The following sections describe the different thread classes. 50 | 51 | ****** 52 | Thread 53 | ****** 54 | 55 | .. autoclass:: thread.Thread 56 | 57 | ********* 58 | IsoThread 59 | ********* 60 | 61 | .. autoclass:: thread.IsoThread 62 | 63 | ********** 64 | AcmeThread 65 | ********** 66 | 67 | .. autoclass:: thread.AcmeThread 68 | 69 | *********************** 70 | MetricTrapezoidalThread 71 | *********************** 72 | 73 | .. autoclass:: thread.MetricTrapezoidalThread 74 | 75 | ***************** 76 | TrapezoidalThread 77 | ***************** 78 | The base class of the AcmeThread and MetricTrapezoidalThread classes. 79 | 80 | .. autoclass:: thread.TrapezoidalThread 81 | 82 | ******************* 83 | PlasticBottleThread 84 | ******************* 85 | 86 | .. autoclass:: thread.PlasticBottleThread 87 | -------------------------------------------------------------------------------- /examples/captive_nuts.py: -------------------------------------------------------------------------------- 1 | import cadquery as cq 2 | from cq_warehouse.fastener import HexNut, SquareNut 3 | import cq_warehouse.extensions 4 | 5 | hex_nut = HexNut(size="M6-1", fastener_type="iso4033") 6 | square_nut = SquareNut(size="M6-1", fastener_type="din557") 7 | test_assembly = cq.Assembly() 8 | block = ( 9 | cq.Workplane("XY") 10 | .box(50, 50, 10) 11 | .faces(">Z") 12 | .workplane() 13 | .pushPoints([(-12.5, 0)]) 14 | .clearanceHole( 15 | fastener=hex_nut, fit="Loose", captiveNut=True, baseAssembly=test_assembly 16 | ) 17 | .pushPoints([(+12.5, 0)]) 18 | .clearanceHole(fastener=square_nut, captiveNut=True, baseAssembly=test_assembly) 19 | ) 20 | test_assembly.add(block, color=cq.Color("tan")) 21 | 22 | if "show_object" in locals(): 23 | show_object(test_assembly, name="test_assembly") 24 | -------------------------------------------------------------------------------- /examples/flange_logo.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | Flange Logo 4 | 5 | name: flange_logo.py 6 | by: Gumyr 7 | date: JUne 13th, 2023 8 | 9 | desc: 10 | This python module creates a logo for the flanges packages as an example 11 | of using Pipes and Flanges. 12 | 13 | license: 14 | 15 | Copyright 2023 Gumyr 16 | 17 | Licensed under the Apache License, Version 2.0 (the "License"); 18 | you may not use this file except in compliance with the License. 19 | You may obtain a copy of the License at 20 | 21 | http://www.apache.org/licenses/LICENSE-2.0 22 | 23 | Unless required by applicable law or agreed to in writing, software 24 | distributed under the License is distributed on an "AS IS" BASIS, 25 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | See the License for the specific language governing permissions and 27 | limitations under the License. 28 | 29 | """ 30 | 31 | from build123d import * 32 | from bd_warehouse.pipe import Pipe, PipeSection 33 | from bd_warehouse.flange import ( 34 | SlipOnFlange, 35 | WeldNeckFlange, 36 | BlindFlange, 37 | SocketWeldFlange, 38 | LappedFlange, 39 | LappedFlangeStub, 40 | ) 41 | 42 | from ocp_vscode import show, show_object, set_port, set_defaults 43 | 44 | set_port(3939) 45 | set_defaults(reset_camera=False, ortho=True) 46 | 47 | trunk_pipe_size = "8" 48 | trunk_outlet_flange = WeldNeckFlange( 49 | nps=trunk_pipe_size, flange_class=300, face_type="Ring" 50 | ) 51 | trunk_inlet_flange = SlipOnFlange(nps=trunk_pipe_size, flange_class=300) 52 | blind_flange = BlindFlange(nps="3", flange_class=300) 53 | socket_flange = SocketWeldFlange(nps="3", flange_class=300) 54 | lapped_flange = LappedFlange(nps="5", flange_class=300) 55 | lapped_flange_stub = LappedFlangeStub( 56 | nps="5", material="steel", pipe_identifier="40", stub_length=6 * IN 57 | ) 58 | 59 | with BuildPart() as pipes: 60 | # Create trunk pipe 61 | with BuildLine(): 62 | l1 = Line((0, 0, 0), (4 * FT, 0, 0)) 63 | trunk_pipe = Pipe(nps=trunk_pipe_size, material="steel", identifier="40") 64 | trunk_pipe_outlet = Location(Plane(l1 @ 1, z_dir=(-1, 0, 0))) 65 | 66 | # Create vertical pipe intersecting trunk pipe 67 | vertical_pipe_outlet = Location(Plane((2 * FT, 0, 1 * FT), z_dir=(0, 0, 1))) 68 | with BuildSketch(vertical_pipe_outlet): 69 | pipe_section = PipeSection(nps="3", material="steel", identifier="40") 70 | vertical_pipe = extrude(until=Until.PREVIOUS) 71 | 72 | # Weld the two pipe together by creating a fillet 73 | welded_edges = ( 74 | vertical_pipe.edges() 75 | .filter_by_position(Axis.Z, 0, trunk_pipe.od / 2) 76 | .group_by(SortBy.LENGTH)[-1] 77 | ) 78 | fillet(welded_edges, 8 * MM) 79 | 80 | # Create a hole in the trunk pipe to join it to the vertical 81 | with Locations((2 * FT, 0, 0)): 82 | Cylinder( 83 | pipe_section.id / 2, 84 | 1 * FT, 85 | align=(Align.CENTER, Align.CENTER, Align.MIN), 86 | mode=Mode.SUBTRACT, 87 | ) 88 | 89 | # Create horizontal pipe intersecting trunk pipe 90 | horizontal_pipe_outlet = Location( 91 | Plane((3 * FT, -1 * FT, 0 * FT), z_dir=(0, -1, 0)) 92 | ) 93 | with BuildSketch(horizontal_pipe_outlet): 94 | pipe_section = PipeSection(nps="5", material="steel", identifier="40") 95 | horizontal_pipe = extrude(until=Until.PREVIOUS) 96 | 97 | # Weld the two pipe together by creating a fillet 98 | welded_edges = ( 99 | horizontal_pipe.edges() 100 | .filter_by_position(Axis.Y, -trunk_pipe.od / 2, 0) 101 | .group_by(SortBy.LENGTH)[-1] 102 | ) 103 | fillet(welded_edges, 8 * MM) 104 | 105 | # Create a hole in the trunk pipe to join it to the vertical 106 | with Locations((3 * FT, 0, 0)): 107 | Cylinder( 108 | pipe_section.id / 2, 109 | 1 * FT, 110 | rotation=(90, 0, 0), 111 | align=(Align.CENTER, Align.CENTER, Align.MIN), 112 | mode=Mode.SUBTRACT, 113 | ) 114 | 115 | RigidJoint("vertical", pipes.part, vertical_pipe_outlet) 116 | RigidJoint("horizontal", pipes.part, horizontal_pipe_outlet) 117 | RigidJoint("trunk-outlet", pipes.part, l1.location_at(1)) 118 | RigidJoint("trunk-inlet", pipes.part, Location(Plane(l1 @ 0, z_dir=-(l1 % 0)))) 119 | 120 | 121 | # Attach the flanges to the ends of the pipes 122 | pipes.part.joints["vertical"].connect_to(socket_flange.joints["pipe"]) 123 | pipes.part.joints["horizontal"].connect_to(lapped_flange_stub.joints["pipe"]) 124 | lapped_flange_stub.joints["lap"].connect_to(lapped_flange.joints["lap"]) 125 | socket_flange.joints["face"].connect_to(blind_flange.joints["face"]) 126 | pipes.part.joints["trunk-outlet"].connect_to(trunk_outlet_flange.joints["pipe"]) 127 | pipes.part.joints["trunk-inlet"].connect_to(trunk_inlet_flange.joints["pipe"]) 128 | 129 | show( 130 | pipes, 131 | trunk_outlet_flange, 132 | trunk_inlet_flange, 133 | blind_flange, 134 | socket_flange, 135 | lapped_flange, 136 | lapped_flange_stub, 137 | names=[ 138 | "pipes", 139 | "trunk_outlet_flange", 140 | "trunk_inlet_flange", 141 | "blind_flange", 142 | "socket_flange", 143 | "lapped_flange", 144 | "lapped_flange_stub", 145 | ], 146 | alphas=[1, 1, 1, 1, 1, 0.3, 1], 147 | render_joints=False, 148 | ) 149 | -------------------------------------------------------------------------------- /examples/pillow_block.py: -------------------------------------------------------------------------------- 1 | import copy 2 | 3 | from bd_warehouse.bearing import PressFitHole, SingleRowDeepGrooveBallBearing 4 | from bd_warehouse.fastener import ClearanceHole, SocketHeadCapScrew 5 | from build123d import * 6 | from ocp_vscode import show 7 | 8 | # Dimensions in the default unit of MM 9 | height, width, thickness, padding, fillet_radius = 30, 50, 10, 12, 2 10 | 11 | # Create the screw & bearing 12 | cap_screw = SocketHeadCapScrew(size="M2-0.4", length=16, simple=False) 13 | skate_bearing = SingleRowDeepGrooveBallBearing(size="M8-22-7") 14 | 15 | # Create the pillow block 16 | with BuildPart() as pillow_block: 17 | with BuildSketch(): 18 | RectangleRounded(width, height, fillet_radius) 19 | extrude(amount=thickness) 20 | with Locations((0, 0, thickness)): # On the top 21 | PressFitHole(bearing=skate_bearing, interference=0.025 * MM) 22 | with GridLocations(width - padding, height - padding, 2, 2): 23 | ClearanceHole(fastener=cap_screw) 24 | 25 | pillow_block.part.color = Color("teal") 26 | 27 | # Create an assembly of all the positioned parts 28 | pillow_block_assembly = Compound( 29 | children=[pillow_block.part, skate_bearing.moved(skate_bearing.hole_locations[0])] 30 | + [copy.copy(cap_screw).moved(l) for l in cap_screw.hole_locations] 31 | ) 32 | show(pillow_block_assembly) 33 | -------------------------------------------------------------------------------- /examples/pipe_and_flanges.py: -------------------------------------------------------------------------------- 1 | from build123d import * 2 | from bd_warehouse.pipe import Pipe, PipeSection 3 | from bd_warehouse.flange import SlipOnFlange, WeldNeckFlange 4 | 5 | from ocp_vscode import show 6 | 7 | inlet_flange = WeldNeckFlange(nps="12", flange_class=300, face_type="Ring") 8 | outlet_flange = SlipOnFlange(nps="12", flange_class=300) 9 | 10 | pipe = Pipe( 11 | nps="12", 12 | material="steel", 13 | identifier="40", 14 | path=Edge.make_line((0, 0, 0), (6 * FT, 0, 0)), 15 | ) 16 | 17 | pipe.joints["inlet"].connect_to(inlet_flange.joints["pipe"]) 18 | pipe.joints["outlet"].connect_to(outlet_flange.joints["pipe"]) 19 | 20 | show(pipe, inlet_flange, outlet_flange) 21 | -------------------------------------------------------------------------------- /examples/pipe_logo.py: -------------------------------------------------------------------------------- 1 | from build123d import * 2 | from bd_warehouse.pipe import Pipe 3 | from ocp_vscode import show, set_port, set_defaults, Camera 4 | 5 | set_port(3939) 6 | set_defaults(reset_camera=Camera.CENTER, ortho=True) 7 | 8 | stainless_pipe = Pipe( 9 | nps="2 1/2", 10 | material="stainless", 11 | identifier="10S", 12 | path=Edge.make_line((0, 0, 0), (5 * FT, 0, 0)), 13 | ) 14 | 15 | with BuildPart() as pipe_logo: 16 | # P 17 | with BuildLine(Plane.XZ): 18 | l1 = Line((0, 0), (0, 6 * FT)) 19 | l2 = Line(l1 @ 1 + (0, -3 * IN), l1 @ 1 + (1 * FT, -3 * IN)) 20 | l3 = RadiusArc(l2 @ 1, l2 @ 1 + (0, -3 * FT), 1.5 * FT) 21 | l4 = Line(l3 @ 1, l3 @ 1 + (-1 * FT, 0)) 22 | Pipe(nps="6", material="copper", identifier="K") 23 | 24 | # i 25 | with BuildLine(Plane.XZ): 26 | l1 = Line((3 * FT, 0), (3 * FT, 3 * FT)) 27 | l2 = Line((3 * FT, 3 * FT, -6 * IN), (3 * FT, 3 * FT, 6 * IN)) 28 | pipe_i = Pipe(nps="6", material="copper", identifier="K") 29 | with Locations(l1 @ 1): 30 | Cylinder( 31 | radius=pipe_i.id / 2, 32 | height=pipe_i.length, 33 | rotation=(90, 0, 0), 34 | mode=Mode.SUBTRACT, 35 | ) 36 | 37 | # p 38 | with BuildLine(Plane.XZ): 39 | l1 = Line((4 * FT, -2.5 * FT), (4 * FT, 3 * FT)) 40 | l2 = Line(l1 @ 1 + (0, -3 * IN), l1 @ 1 + (1 * FT, -3 * IN)) 41 | l3 = RadiusArc(l2 @ 1, l2 @ 1 + (0, -30 * IN), 15 * IN) 42 | l4 = Line(l3 @ 1, l3 @ 1 + (-1 * FT, 0)) 43 | Pipe(nps="6", material="copper", identifier="K") 44 | 45 | # e 46 | with BuildLine(Plane.XZ) as e_path: 47 | l1 = Line((7 * FT, 19 * IN), (7 * FT + 30 * IN, 19 * IN)) 48 | l2 = Spline( 49 | l1 @ 1 - (3 * IN, 0), 50 | (l1 @ 0 + l1 @ 1) / 2 + (0, 15 * IN), 51 | l1 @ 0, 52 | l1 @ 1 - (0, 15 * IN), 53 | ) 54 | Pipe(nps="6", material="copper", identifier="K") 55 | 56 | 57 | show(pipe_logo) 58 | -------------------------------------------------------------------------------- /examples/threads.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | Parametric Threads Examples 4 | 5 | name: threads.py 6 | by: Gumyr 7 | date: June 30th 2023 8 | 9 | desc: A collection of different thread types. 10 | 11 | license: 12 | 13 | Copyright 2023 Gumyr 14 | 15 | Licensed under the Apache License, Version 2.0 (the "License"); 16 | you may not use this file except in compliance with the License. 17 | You may obtain a copy of the License at 18 | 19 | http://www.apache.org/licenses/LICENSE-2.0 20 | 21 | Unless required by applicable law or agreed to in writing, software 22 | distributed under the License is distributed on an "AS IS" BASIS, 23 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 | See the License for the specific language governing permissions and 25 | limitations under the License. 26 | 27 | """ 28 | 29 | import timeit 30 | 31 | from bd_warehouse.thread import ( 32 | AcmeThread, 33 | IsoThread, 34 | MetricTrapezoidalThread, 35 | PlasticBottleThread, 36 | Thread, 37 | ) 38 | from build123d import * 39 | from ocp_vscode import show 40 | 41 | # Raw Thread internal 42 | starttime = timeit.default_timer() 43 | internal = Thread( 44 | apex_radius=5, 45 | apex_width=0.1, 46 | root_radius=6, 47 | root_width=0.8, 48 | pitch=1, 49 | length=12.001, 50 | apex_offset=0.2, 51 | end_finishes=["raw", "square"], 52 | ) 53 | elapsed_time = timeit.default_timer() - starttime 54 | print(f"Internal Thread time: {elapsed_time:.3f}s") 55 | 56 | # Raw Thread external 57 | starttime = timeit.default_timer() 58 | external = Thread( 59 | apex_radius=6, 60 | apex_width=0.1, 61 | root_radius=5, 62 | root_width=0.8, 63 | pitch=1, 64 | length=8.0, 65 | apex_offset=0.2, 66 | end_finishes=["fade", "chamfer"], 67 | ) 68 | elapsed_time = timeit.default_timer() - starttime 69 | print(f"External Thread time: {elapsed_time:.3f}s") 70 | 71 | # IsoThread internal in the form of a nut 72 | starttime = timeit.default_timer() 73 | iso_internal = IsoThread( 74 | major_diameter=6 * MM, 75 | pitch=1 * MM, 76 | length=8 * MM, 77 | external=False, 78 | end_finishes=("chamfer", "fade"), 79 | hand="right", 80 | ) 81 | with BuildPart() as iso_internal_nut: 82 | with BuildSketch(): 83 | RegularPolygon(iso_internal.major_diameter * 0.75, 6) 84 | Circle(iso_internal.major_diameter / 2, mode=Mode.SUBTRACT) 85 | extrude(amount=iso_internal.length) 86 | 87 | nut = iso_internal.fuse(iso_internal_nut.part) 88 | elapsed_time = timeit.default_timer() - starttime 89 | print(f"Nut elapsed time: {elapsed_time:.3f}s") 90 | print(f"{nut.is_valid()=}") 91 | 92 | # IsoThread external in the form of a screw 93 | starttime = timeit.default_timer() 94 | iso_external = IsoThread( 95 | major_diameter=6 * MM, 96 | pitch=1 * MM, 97 | length=4.5 * MM, 98 | external=True, 99 | end_finishes=("square", "square"), 100 | hand="right", 101 | ) 102 | external_core = Cylinder( 103 | iso_external.root_radius, 104 | iso_external.length, 105 | align=(Align.CENTER, Align.CENTER, Align.MIN), 106 | ) 107 | iso_external_screw = iso_external.fuse(external_core) 108 | elapsed_time = timeit.default_timer() - starttime 109 | print(f"Iso External Screw elapsed time: {elapsed_time:.3f}s") 110 | 111 | # Acme Screw 112 | starttime = timeit.default_timer() 113 | acme = AcmeThread(size="1/4", length=1 * IN) 114 | 115 | acme_screw = acme + Cylinder( 116 | acme.root_radius, acme.length, align=(Align.CENTER, Align.CENTER, Align.MIN) 117 | ) 118 | elapsed_time = timeit.default_timer() - starttime 119 | print(f"Acme external elapsed time: {elapsed_time:.3f}s") 120 | print(f"{acme_screw.is_valid()=}") 121 | 122 | # Metric Trapezoidal Thread 123 | starttime = timeit.default_timer() 124 | metric = MetricTrapezoidalThread(size="8x1.5", length=20 * MM) 125 | metric_screw = metric + Cylinder( 126 | metric.root_radius, metric.length, align=(Align.CENTER, Align.CENTER, Align.MIN) 127 | ) 128 | 129 | elapsed_time = timeit.default_timer() - starttime 130 | print(f"Metric external elapsed time: {elapsed_time:.3f}s") 131 | print(f"{metric_screw.is_valid()=}") 132 | 133 | # Plastic Thread 134 | starttime = timeit.default_timer() 135 | plastic_external = PlasticBottleThread("M40SP444", external=True) 136 | plastic_internal = PlasticBottleThread("M38SP444", external=False) 137 | 138 | elapsed_time = timeit.default_timer() - starttime 139 | print(f"Plastic elapsed time: {elapsed_time:.3f}s") 140 | print(f"{plastic_external.is_valid()=}") 141 | print(f"{plastic_internal.is_valid()=}") 142 | print(f"Plastic external & internal elapsed time: {elapsed_time:.3f}s") 143 | 144 | 145 | show( 146 | internal.locate(Location((-10, -10, 0))), 147 | external.locate(Location((10, -10, 0))), 148 | nut.locate(Location((-10, 10, 0))), 149 | iso_external_screw.locate(Location((10, 10, 0))), 150 | acme_screw.locate(Location((20, 0, 0))), 151 | metric_screw.locate(Location((-20, 0, 0))), 152 | plastic_internal.locate(Location((0, -40))), 153 | plastic_external.locate(Location((0, 40))), 154 | timeit=False, 155 | ) 156 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | 3 | requires = [ 4 | "setuptools>=45", 5 | "wheel", 6 | "setuptools_scm[toml]>=6.2", 7 | ] 8 | 9 | build-backend = "setuptools.build_meta" 10 | 11 | [project] 12 | name = "bd_warehouse" 13 | #version = "0.1.0" # Uncomment this for the next release? 14 | dynamic = ["version"] 15 | authors = [ 16 | {name = "Roger Maitland", email = "gumyr9@gmail.com"}, 17 | ] 18 | description = "A build123d parametric part collection" 19 | readme = "README.md" 20 | requires-python = ">=3.10" 21 | keywords = [ 22 | "3d models", 23 | "3d printing", 24 | "3d", 25 | "brep", 26 | "cad", 27 | "cadquery", 28 | "opencascade", 29 | "python", 30 | ] 31 | license = {text = "Apache-2.0"} 32 | classifiers = [ 33 | "License :: OSI Approved :: Apache Software License", 34 | "Operating System :: OS Independent", 35 | "Programming Language :: Python :: 3", 36 | ] 37 | 38 | dependencies = [ 39 | "build123d", 40 | "typing_extensions >= 4.4.0, <5", 41 | ] 42 | 43 | [project.optional-dependencies] 44 | # dependencies to build the docs 45 | docs = [ 46 | "sphinx==8.1.3", # pin for stability of docs builds 47 | "sphinx-design", 48 | "sphinx-copybutton", 49 | "sphinx-hoverxref", 50 | "sphinx-rtd-theme", 51 | "sphinx-autodoc-typehints", 52 | ] 53 | 54 | [tool.setuptools] 55 | # ... 56 | # By default, include-package-data is true in pyproject.toml, so you do 57 | # NOT have to specify this line. 58 | include-package-data = true 59 | 60 | [tool.setuptools.packages.find] 61 | namespaces = true 62 | where = ["src"] 63 | 64 | [tool.setuptools.package-data] 65 | "*" = ["*.csv"] 66 | # "bd_warehouse.data" = ["*.csv"] 67 | 68 | # exclude = ["bd_warehouse._dev"] 69 | 70 | [tool.setuptools_scm] 71 | write_to = "src/bd_warehouse/_version.py" 72 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | pytest-cov 2 | -e . 3 | -------------------------------------------------------------------------------- /src/bd_warehouse/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/brad_tee_nut_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,Hilitchi:s,Hilitchi:m,Hilitchi:dc,Hilitchi:c,Hilitchi:bcd,Hilitchi:brad_size,Hilitchi:brad_num 2 | M6-1,5.95,16.5,36.3,2.4,24,M4-0.7,3 3 | M8-1.25,5.95,16.5,36,2.00,24,M4-0.7,3 4 | M10-1.5,5.95,16.5,36.3,2.4,24,M4-0.7,3 5 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/button_head_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,iso7380_1:dk,iso7380_1:dl,iso7380_1:k,iso7380_1:rf,iso7380_1:s,iso7380_1:t,iso7380_1:short,iso7380_1:long 2 | M3-0.5,5.7,2.6,1.65,3.7,2.08,1.04,6,30 3 | M4-0.7,7.6,3.8,2.2,4.6,2.58,1.3,6,40 4 | M5-0.8,9.5,5,2.75,5.75,3.08,1.56,8,50 5 | M6-1,10.5,6,3.3,6.15,4.095,2.08,10,60 6 | M8-1.25,14,7.7,4.4,7.95,5.14,2.6,12,80 7 | M10-1.5,17.5,10,5.5,9.8,6.14,3.12,16,90 8 | M12-1.75,21,12,6.6,11.2,8.175,4.16,20,90 9 | M16-2,28,16,8.8,15.3,10.175,5.2,25,90 10 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/button_head_with_collar_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,iso7380_2:dk,iso7380_2:dl,iso7380_2:dc,iso7380_2:k,iso7380_2:rf,iso7380_2:c,iso7380_2:s,iso7380_2:t,iso7380_2:short,iso7380_2:long 2 | M3-0.5,5.2,2.6,6.9,1.65,3.7,0.7,2.08,1.04,6,30 3 | M4-0.7,7.2,3.8,9.4,2.2,4.6,0.8,2.58,1.3,6,40 4 | M5-0.8,8.8,5,11.8,2.75,5.75,1,3.08,1.56,8,50 5 | M6-1,10,6,13.6,3.3,6.15,1.2,4.095,2.08,10,60 6 | M8-1.25,13.2,7.7,17.8,4.4,7.95,1.5,5.14,2.6,12,80 7 | M10-1.5,16.5,10,21.9,5.5,9.8,2,6.14,3.12,16,90 8 | M12-1.75,19.4,12,26,6.6,11.2,2.4,8.175,4.16,20,90 9 | M16-2,26,16,34,8.8,15.3,2.8,10.175,5.2,25,90 10 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/chamfered_washer_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,iso7090:d1,iso7090:d2,iso7090:h 2 | M5,5.3,10,1.1 3 | M6,6.4,12,1.8 4 | M7,7.4,14,1.8 5 | M8,8.4,16,1.8 6 | M10,10.5,20,2.2 7 | M12,13,24,2.7 8 | M14,15,28,2.7 9 | M16,17,30,3.3 10 | M18,19,34,3.3 11 | M20,21,37,3.3 12 | M22,23,39,3.3 13 | M24,25,44,4.3 14 | M26,27,50,4.3 15 | M27,28,50,4.3 16 | M28,29,50,4.3 17 | M30,31,56,4.3 18 | M32,33,60,5.6 19 | M33,34,60,5.6 20 | M35,36,66,5.6 21 | M36,37,66,5.6 22 | M38,39,72,6.6 23 | M39,40,72,6.6 24 | M40,41,72,6.6 25 | M42,43,78,8 26 | M45,46,85,8 27 | M48,50,92,9 28 | M50,52,92,9 29 | M52,54,98,9 30 | M55,57,105,10 31 | M56,58,105,10 32 | M58,60,110,10 33 | M60,62,110,10 34 | M64,66,115,10 35 | M68,70,120,11 36 | M72,74,125,11 37 | M76,78,135,11 38 | M80,82,140,13.2 39 | M85,87,145,13.2 40 | M90,93,160,13.2 41 | M95,98,165,13.2 42 | M100,104,175,15.2 43 | M105,109,180,15.2 44 | M110,114,185,15.2 45 | M115,119,200,15.2 46 | M120,124,210,17.2 47 | M125,129,220,17.2 48 | M130,134,220,17.2 49 | M135,139,230,17.2 50 | M140,144,240,19.2 51 | M145,149,250,19.2 52 | M150,155,250,19.2 53 | M160,165,250,19.2 54 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/cheese_head_parameters.csv: -------------------------------------------------------------------------------- 1 | ,iso1207:dk,iso1207:k,iso1207:n,iso1207:t,iso1207:short,iso1207:long,iso7048:dk,iso7048:k,iso7048:recess,iso7048:short,iso7048:long,iso14580:dk,iso14580:k,iso14580:recess,iso14580:short,iso14580:long 2 | M1.6-0.35,3,1.1,0.6,0.45,2,16,,,,,,,,,, 3 | M2-0.4,3.8,1.4,0.7,0.6,3,20,,,,,,3.8,1.55,T6,3,20 4 | M2.5-0.45,4.5,1.8,0.8,0.7,3,25,4.5,1.8,PH1,3,25,4.5,1.85,T8,3,25 5 | M3-0.5,5.5,2,1,0.85,4,30,5.5,2,PH2,4,30,5.5,2.4,T10,4,30 6 | M3.5-0.6,6,2.4,1.2,1,5,35,6,2.4,PH2,5,35,6,2.6,T15,5,35 7 | M4-0.7,7,2.6,1.51,1.1,5,40,7,2.6,PH2,5,40,7,3.1,T20,5,40 8 | M5-0.8,8.5,3.3,1.51,1.3,6,50,8.5,3.3,PH2,6,50,8.5,3.65,T25,6,50 9 | M6-1,10,3.9,1.91,1.6,8,60,10,3.9,PH3,8,60,10,4.4,T30,8,60 10 | M8-1.25,13,5,2.31,2,10,80,13,5,PH3,10,80,13,5.8,T45,10,80 11 | M10-1.5,16,6,2.81,2.4,12,80,,,,,,16,6.9,T50,12,80 12 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/cheese_head_washer_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,iso7092:d1,iso7092:d2,iso7092:h 2 | M1,1.1,2.5,0.35 3 | M1.2,1.3,3,0.35 4 | M1.4,1.5,3,0.35 5 | M1.6,1.7,3.5,0.35 6 | M1.8,2,4,0.35 7 | M2,2.2,4.5,0.35 8 | M2.5,2.7,5,0.55 9 | M3,3.2,6,0.55 10 | M3.5,3.7,7,0.55 11 | M4,4.3,8,0.55 12 | M5,5.3,9,1.1 13 | M6,6.4,11,1.8 14 | M8,8.4,15,1.8 15 | M10,10.5,18,1.8 16 | M12,13,20,2.2 17 | M14,15,24,2.7 18 | M16,17,28,2.7 19 | M18,19,30,2.7 20 | M20,21,34,3.3 21 | M24,25,39,4.3 22 | M30,31,50,4.3 23 | M36,37,58,5.6 24 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/clearance_hole_sizes.csv: -------------------------------------------------------------------------------- 1 | Size,Close,Normal,Loose 2 | M1,1.1,1.2,1.3 3 | M1.2,1.3,1.4,1.5 4 | M1.4,1.5,1.6,1.8 5 | M1.6,1.7,1.8,2 6 | M1.8,2,2.1,2.2 7 | M2,2.2,2.4,2.6 8 | M2.5,2.7,2.9,3.1 9 | M3,3.2,3.4,3.6 10 | M3.5,3.7,3.9,4.2 11 | M4,4.3,4.5,4.8 12 | M5,5.3,5.5,5.8 13 | M6,6.4,6.6,7 14 | M7,7.4,7.6,8 15 | M8,8.4,9,10 16 | M9,9.45,10,11 17 | M10,10.5,11,12 18 | M12,13,14,15 19 | M14,15,16,17 20 | M15,16,17,18 21 | M16,17,18,19 22 | M17,18,19,20 23 | M18,19,20,21 24 | M20,21,22,24 25 | M22,23,24,26 26 | M24,25,26,28 27 | M25,26,27,29 28 | M27,28,30,32 29 | M28,29,31,33 30 | M30,31,33,35 31 | M32,33,35,37 32 | M33,34,36,38 33 | M36,37,39,42 34 | M39,40,42,45 35 | M42,43,45,48 36 | M45,46,48,52 37 | M48,50,52,56 38 | M52,54,56,62 39 | M56,58,62,66 40 | M60,62,66,70 41 | M64,66,70,74 42 | M68,70,74,78 43 | M72,74,78,82 44 | M76,78,82,86 45 | M80,82,86,91 46 | M85,87,91,96 47 | M90,93,96,101 48 | M95,98,101,107 49 | M100,104,107,112 50 | M105,109,112,117 51 | M110,114,117,122 52 | M115,119,122,127 53 | M120,124,127,132 54 | M125,129,132,137 55 | M130,134,137,144 56 | M140,144,147,155 57 | M150,155,158,165 58 | #0,#51,#48,3/32 59 | #1,#46,#43,#37 60 | #2,3/32,#38,#32 61 | #3,#36,#32,#30 62 | #4,#31,#30,#27 63 | #5,9/64,5/32,11/64 64 | #6,#23,#18,#13 65 | #8,#15,#9,#3 66 | #10,#5,#2,B 67 | #12,0.221,0.228,0.246 68 | 1/4,17/64,9/32,19/64 69 | 5/16,21/64,11/32,23/64 70 | 3/8,25/64,13/32,27/64 71 | 7/16,29/64,15/32,31/64 72 | 1/2,17/32,9/16,39/64 73 | 9/16,0.5781,0.5937,0.6094 74 | 5/8,21/32,11/16,47/64 75 | 3/4,25/32,13/16,29/32 76 | 7/8,29/32,15/16,1 1/32 77 | 1,1 1/32,1 3/32,1 5/32 78 | 1 1/8,1 5/32,1 7/32,1 5/16 79 | 1 1/4,1 9/32,1 11/32,1 7/16 80 | 1 3/8,1 7/16,1 1/2,1 39/64 81 | 1 1/2,1 9/16,1 5/8,1 47/64 82 | 1-3/4,1.7656,1.7812,1.7969 83 | 2,2.0156,2.0312,2.0469 84 | 2-1/4,2.2656,2.2812,2.2969 85 | 2-1/2,2.5156,2.5312,2.5469 86 | 2-3/4,2.7656,2.7812,2.7969 87 | 3,3.0156,3.0312,3.0469 88 | 3-1/4,3.2656,3.2812,3.2969 89 | 3-1/2,3.5156,3.5312,3.5469 90 | 3-3/4,3.7656,3.7812,3.7969 91 | 4,4.0156,4.0312,4.0469 92 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/countersunk_head_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,iso10642:a,iso10642:dk ,iso10642:k,iso10642:s,iso10642:t,iso10642:short,iso10642:long,iso14581:a,iso14581:dk,iso14581:k,iso14581:recess,iso14581:short,iso14581:long,iso14582:a,iso14582:dk,iso14582:k,iso14582:recess,iso14582:short,iso14582:long,iso2009:a,iso2009:b,iso2009:dk,iso2009:k,iso2009:n,iso2009:t,iso2009:short,iso2009:long,iso7046:a,iso7046:dk,iso7046:k,iso7046:recess,iso7046:short,iso7046:long 2 | M1-0.25,,,,,,,,,,,,,,,,,,,,90,0,1.9,0.6,0.31,0.3,2,5,,,,,, 3 | M1.2-0.25,,,,,,,,,,,,,,,,,,,,90,0,2.3,0.72,0.36,0.35,2,6,,,,,, 4 | M1.4-0.3,,,,,,,,,,,,,,,,,,,,90,0,2.6,0.86,0.36,0.4,2,10,,,,,, 5 | M1.5-0.35,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 6 | M1.6-0.35,,,,,,,,,,,,,,,,,,,,90,15,3,0.96,0.46,0.45,2,10,90,3,0.96,PH0,3,16 7 | M1.8-0.35,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 8 | M2-0.4,,,,,,,,90,4.4,1.2,T6,3,20,,,,,,,90,16,3.8,1.2,0.56,0.6,3,18,90,3.8,1.2,PH0,3,20 9 | M2-0.45,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 10 | M2.2-0.45,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 11 | M2.5-0.45,,,,,,,,90,5.5,1.5,T8,3,25,,,,,,,90,18,4.7,1.5,0.66,0.7,3,25,90,4.7,1.5,PH1,3,25 12 | M3-0.5,90,6,1.7,2.1,1.2,8,30,90,6.3,1.65,T10,4,30,90,6.5,2.2,T10,8,30,90,19,5.6,1.65,0.86,0.85,4,30,90,5.6,1.65,PH1,4,30 13 | M3-0.6,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 14 | M3.5-0.6,,,,,,,,90,8.2,2.35,T15,5,35,,,,,,,90,20,6.5,1.93,0.96,1,4,35,90,6.5,1.93,PH2,5,35 15 | M4-0.7,90,8,2.3,2.6,1.8,8,40,90,9.4,2.7,T20,5,40,90,9,3.01,T20,8,40,90,22,7.5,2.2,1.06,1.1,5,40,90,7.5,2.2,PH2,5,40 16 | M4-0.75,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 17 | M4.5-0.75,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 18 | M5-0.8,90,10,2.8,3.1,2.3,8,50,90,10.4,2.7,T25,6,50,90,10.8,3.5,T25,8,50,90,25,9.2,2.5,1.26,1.3,6,50,90,9.2,2.5,PH2,6,50 19 | M5-0.9,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 20 | M5-1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 21 | M5.5-0.9,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 22 | M6-0.75,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 23 | M6-1,90,12,3.3,4.12,2.5,8,60,90,12.6,3.3,T30,8,50,90,13.1,4.22,T30,8,60,90,28,11,3,1.66,1.6,8,50,90,11,3,PH3,8,60 24 | M7-0.75,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 25 | M7-1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 26 | M8-1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 27 | M8-1.25,90,16,4.4,5.14,3.5,10,80,90,17.3,4.65,T45,10,60,90,17.8,5.69,T45,10,80,90,34,14.5,4,2.06,2.1,10,55,90,14.5,4,PH4,10,60 28 | M9-1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 29 | M9-1.25,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 30 | M10-1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 31 | M10-1.25,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 32 | M10-1.5,90,20,5.5,6.14,4.4,12,100,90,20,5,T50,12,60,90,21.1,6.5,T50,12,100,90,40,18,5,2.56,2.6,12,60,90,18,5,PH4,12,60 33 | M11-1.5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 34 | M12-1.25,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 35 | M12-1.5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 36 | M12-1.75,90,24,6.5,8.175,4.6,20,100,,,,,,,,,,,,,90,46,22,6,3.06,3,20,80,,,,,, 37 | M14-1.25,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 38 | M14-1.5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 39 | M14-2,90,27,7,10.175,4.8,25,100,,,,,,,,,,,,,90,52,25,7,3.06,3.5,22,80,,,,,, 40 | M15-1.5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 41 | M16-1.5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 42 | M16-2,90,30,7.5,10.175,5.3,30,100,,,,,,,,,,,,,90,58,29,8,4.07,4,25,100,,,,,, 43 | M17-1.5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 44 | M18-1.5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 45 | M18-2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 46 | M18-2.5,90,33,8,12.212,5.5,35,100,,,,,,,,,,,,,90,64,33,9,4.07,4.5,28,100,,,,,, 47 | M19-2.5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 48 | M20-1.5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 49 | M20-2.5,90,36,8.5,12.212,5.9,35,100,,,,,,,,,,,,,90,70,36,10,5.07,5,30,100,,,,,, 50 | M22-2.5,60,36,13.1,14.212,8.8,40,100,,,,,,,,,,,,,,,,,,,,,,,,,, 51 | M24-3,60,39,14,14.212,10.3,50,110,,,,,,,,,,,,,,,,,,,,,,,,,, 52 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/domed_cap_nut_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,din1587:dk,din1587:m,din1587:s 2 | M4-0.7,6.5,3.2,7 3 | M5-0.8,7.5,4,8 4 | M6-1,9.5,5,10 5 | M8-1.25,12.5,6.5,13 6 | M10-1.5,15,8.8,16 7 | M12-1.75,17,10,18 8 | M14-2,20,11,21 9 | M16-2,23,13,24 10 | M18-2.5,26,15,27 11 | M20-2.5,28,16,30 12 | M22-2.5,33,18,34 13 | M24-3,34,19,36 14 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/drill_sizes.csv: -------------------------------------------------------------------------------- 1 | Size,Diameter 2 | A, 0.234 3 | B, 0.238 4 | C, 0.242 5 | D, 0.246 6 | E, 0.250 7 | F, 0.257 8 | G, 0.261 9 | H, 0.266 10 | I, 0.272 11 | J, 0.277 12 | K, 0.281 13 | L, 0.290 14 | M, 0.295 15 | N, 0.302 16 | O, 0.316 17 | P, 0.323 18 | Q, 0.332 19 | R, 0.339 20 | S, 0.348 21 | T, 0.358 22 | U, 0.368 23 | V, 0.377 24 | W, 0.386 25 | X, 0.397 26 | Y, 0.404 27 | Z, 0.413 28 | #1, 0.228 29 | #2, 0.221 30 | #3, 0.213 31 | #4, 0.209 32 | #5, 0.205 33 | #6, 0.204 34 | #7, 0.201 35 | #8, 0.199 36 | #9, 0.196 37 | #10, 0.193 38 | #11, 0.191 39 | #12, 0.189 40 | #13, 0.185 41 | #14, 0.182 42 | #15, 0.18 43 | #16, 0.177 44 | #17, 0.173 45 | #18, 0.17 46 | #19, 0.166 47 | #20, 0.161 48 | #21, 0.159 49 | #22, 0.157 50 | #23, 0.154 51 | #24, 0.152 52 | #25, 0.15 53 | #26, 0.147 54 | #27, 0.144 55 | #28, 0.14 56 | #29, 0.136 57 | #30, 0.1285 58 | #31, 0.12 59 | #32, 0.116 60 | #33, 0.113 61 | #34, 0.111 62 | #35, 0.11 63 | #36, 0.1065 64 | #37, 0.104 65 | #38, 0.1015 66 | #39, 0.0995 67 | #40, 0.098 68 | #41, 0.096 69 | #42, 0.0935 70 | #43, 0.089 71 | #44, 0.086 72 | #45, 0.082 73 | #46, 0.081 74 | #47, 0.0785 75 | #48, 0.076 76 | #49, 0.073 77 | #50, 0.07 78 | #51, 0.067 79 | #52, 0.0635 80 | #53, 0.0595 81 | #54, 0.055 82 | #55, 0.052 83 | #56, 0.0465 84 | #57, 0.043 85 | #58, 0.042 86 | #59, 0.041 87 | #60, 0.04 88 | #61, 0.039 89 | #62, 0.038 90 | #63, 0.037 91 | #64, 0.036 92 | #65, 0.035 93 | #66, 0.033 94 | #67, 0.032 95 | #68, 0.031 96 | #69, 0.029 97 | #70, 0.028 98 | #71, 0.026 99 | #72, 0.025 100 | #73, 0.024 101 | #74, 0.0225 102 | #75, 0.021 103 | #76, 0.02 104 | #77, 0.018 105 | #78, 0.016 106 | #79, 0.0145 107 | #80, 0.0135 108 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/heatset_nut_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,McMaster-Carr:s,McMaster-Carr:m,McMaster-Carr:dc,McMaster-Carr:knurls,McMaster-Carr:material_thickness,McMaster-Carr:drill,McMaster-Carr:part,Hilitchi:s,Hilitchi:m,Hilitchi:dc,Hilitchi:knurls,Hilitchi:material_thickness,Hilitchi:drill,Hilitchi:part 2 | M2-0.4-Short,3.6,2.5,3.1,20,3.3,#30, 94459A110,,,,,,, 3 | M2-0.4-Standard,3.6,4,3.1,20,4.7,#30, 94459A120,,,,,,, 4 | M3-0.5-Short,4.7,4.3,3.9,20,5.1,#21, 94459A130,,,,,,, 5 | M3-0.5-Standard,4.7,5.7,3.9,20,6.5,#21, 94459A140,,,,,,, 6 | M4-0.7-Short,6.3,4.7,5.5,20,5.5,#2, 94459A150,,,,,,, 7 | M4-0.7-Standard,6.3,8.2,5.5,20,8.9,#2, 94459A170,,,,,,, 8 | M5-0.8-Standard,7.1,9.5,6.3,20,10.3, F, 94459A180,,,,,,, 9 | M2-0.4-3,,,,,,,,3.5,3,2.9,20,3.8,#30,H-THM300 10 | M2-0.4-4,,,,,,,,3.5,4,2.9,20,4.8,#30,H-THM300 11 | M2-0.4-6,,,,,,,,3.5,6,2.9,20,6.8,#30,H-THM300 12 | M2-0.4-8,,,,,,,,3.5,8,2.9,20,8.8,#30,H-THM300 13 | M3-0.5-6,,,,,,,,5,6,4.3,20,6.8,#21,H-THM300 14 | M3-0.5-8,,,,,,,,5,8,4.3,20,8.8,#21,H-THM300 15 | M3-0.5-10,,,,,,,,5,10,4.3,20,10.8,#21,H-THM300 16 | M4-0.7-8,,,,,,,,6,8,5.3,20,8.8,#2,H-THM300 17 | M4-0.7-6,,,,,,,,6,6,5.3,20,6.8,#2,H-THM300 18 | M4-0.7-10,,,,,,,,6,10,5.3,20,10.8,#2,H-THM300 19 | M5-0.8-6,,,,,,,,7,6,6.3,20,6.8,F,H-THM300 20 | M5-0.8-8,,,,,,,,7,8,6.3,20,8.8,F,H-THM300 21 | M5-0.8-10,,,,,,,,7,10,6.3,20,10.8,F,H-THM300 22 | M6-1-10,,,,,,,,8,10,7.3,20,10.8,M,H-THM300 23 | M6-1-12,,,,,,,,8,12,7.3,20,12.8,M,H-THM300 24 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/hex_head_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,din931:k,din931:s,din931:short,din931:long,iso4014:k,iso4014:s,iso4014:short,iso4014:long,iso4017:k,iso4017:s,iso4017:short,iso4017:long 2 | M1.6-0.35,1.1,3.02,12,16,1.3,3.2,12,16,1.3,3.2,2,16 3 | M2-0.4,1.4,3.82,16,20,1.6,4,16,20,1.6,4,4,20 4 | M2.5-0.45,1.7,4.82,16,25,1.9,5,16,25,1.9,5,5,25 5 | M3-0.5,2,5.5,20,30,2,5.5,20,30,2.2,5.5,5,30 6 | M3.5-0.6,2.4,5.82,25,35,2.6,6,20,35,2.6,6,8,35 7 | M4-0.7,2.8,7,25,40,2.8,7,25,40,3,7,6,40 8 | M5-0.8,3.5,8,25,50,3.5,8,25,50,3.74,8,8,50 9 | M6-1,4,10,30,60,4,10,30,60,4.24,10,12,60 10 | M8-1.25,5.3,13,35,80,5.3,13,40,80,5.54,13,16,80 11 | M10-1.5,6.4,17,40,100,6.4,16,45,100,6.69,16,20,100 12 | M12-1.75,7.5,19,45,110,7.5,18,50,120,7.79,18,25,120 13 | M14-2,8.8,22,50,120,8.8,21,60,140,9.09,21,25,140 14 | M16-2,10,24,50,160,10,24,65,160,10.29,24,30,150 15 | M18-2.5,11.5,27,65,190,11.5,27,70,180,11.85,27,35,200 16 | M20-2.5,12.5,30,65,200,12.5,30,80,200,12.85,30,40,160 17 | M22-2.5,14,32,70,220,14,34,90,220,14.35,34,45,200 18 | M24-3,15,36,80,240,15,36,90,240,15.35,36,50,180 19 | M27-3,17,41,90,300,17,41,100,260,17.35,41,50,100 20 | M30-3.5,18.7,46,90,300,18.7,46,110,300,19.12,46,60,200 21 | M33-3.5,,,,,21.42,50,130,320,21.42,50,65,200 22 | M36-4,22.5,55,110,300,22.5,55,140,360,22.95,55,70,200 23 | M39-4,,,,,25.42,60,150,380,25.42,60,80,200 24 | M42-4.5,,,,,26,65,160,440,26.42,65,70,200 25 | M45-4.5,,,,,28.42,70,180,440,28.42,70,90,200 26 | M48-5,,,,,30,75,190,480,30.42,75,100,200 27 | M52-5,,,,,33.5,80,200,480,33.5,80,100,200 28 | M56-5.5,,,,,35,85,220,500,35.5,85,110,200 29 | M60-5.5,,,,,38.5,90,240,500,38.5,90,120,200 30 | M64-6,,,,,40,95,260,500,40.5,95,120,200 31 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/hex_head_with_flange_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,din1662:c,din1662:dc,din1662:k,din1662:s,din1662:short,din1662:long,din1665:c,din1665:dc,din1665:k,din1665:s,din1665:short,din1665:long 2 | M5-0.8,1,11.4,5.6,7,10,50,1,11.8,5.8,8,10,50 3 | M6-1,1.1,13.6,6.9,8,12,60,1.1,14.2,6.6,10,12,60 4 | M8-1.25,1.2,17,8.5,10,16,80,1.2,18,8.1,13,16,80 5 | M10-1.5,1.5,20.8,9.7,13,20,100,1.5,22.3,10.4,16,20,100 6 | M12-1.75,1.8,24.7,12.1,16,25,120,1.8,26.6,11.8,18,25,120 7 | M14-2,2.1,28.6,12.9,18,30,140,2.1,30.5,13.7,21,30,140 8 | M16-2,2.4,32.8,15.2,21,35,160,2.4,35,15.4,24,35,160 9 | M20-2.5,,,,,,,3,43,18.9,30,65,200 10 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/hex_nut_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,iso4032:m,iso4032:s,iso4033:m,iso4033:s,iso4035:m,iso4035:s 2 | M1.6-0.35,1.3,3.2,,,1,3.2 3 | M1.8-0.35,,,,,1.1,3.5 4 | M2-0.4,1.6,4,,,1.2,4 5 | M2.5-0.45,2,5,,,1.6,5 6 | M3-0.45,,,,,1.8,5.5 7 | M3-0.5,2.4,5.5,,,, 8 | M3.5-0.6,2.8,6,,,2,6 9 | M4-0.7,3.2,7,,,2.2,7 10 | M5-0.8,4.7,8,5.1,8,2.7,8 11 | M6-1,5.2,10,5.7,10,3.2,10 12 | M8-1.25,6.8,13,7.5,13,4,13 13 | M10-1.5,8.4,16,9.3,16,5,17 14 | M12-1.75,10.8,18,12,18,6,19 15 | M14-2,12.8,21,14.1,21,7,22 16 | M16-2,14.8,24,16.4,24,8,24 17 | M18-2.5,15.8,27,,,9,27 18 | M20-2.5,18,30,20.3,30,10,30 19 | M22-2.5,19.4,34,,,11,32 20 | M24-3,21.5,36,23.9,36,12,36 21 | M27-3,23.8,41,,,13.5,41 22 | M30-3.5,25.6,46,28.6,46,15,46 23 | M33-3.5,28.7,50,,,16.5,50 24 | M36-4,31,55,34.7,55,18,55 25 | M39-4,33.4,60,,,19.5,60 26 | M42-4.5,34,65,,,21,65 27 | M45-4.5,36,70,,,22.5,70 28 | M48-5,38,75,,,24,75 29 | M52-5,42,80,,,26,80 30 | M56-5.5,45,85,,,, 31 | M60-5.5,48,90,,,, 32 | M64-6,51,95,,,, 33 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/hex_nut_with_flange_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,din1665:c,din1665:dc,din1665:m,din1665:s 2 | M5-0.8,1,11.8,5,8 3 | M6-1,1.1,14.2,6,10 4 | M8-1.25,1.2,17.9,8,13 5 | M8-1,1.2,17.9,8,13 6 | M10-1.5,1.5,21.8,10,15 7 | M10-1.25,1.5,21.8,10,15 8 | M10-1,1.5,21.8,10,15 9 | M12-1.75,1.8,26,12,18 10 | M12-1.5,1.8,26,12,18 11 | M12-1.5,1.8,26,12,18 12 | M14-2,2.1,29.9,14,21 13 | M14-1.5,2.1,29.9,14,21 14 | M16-2,2.4,34.5,16,24 15 | M16-1.5,2.4,34.5,16,24 16 | M20-2.5,3,42.8,20,30 17 | M20-1.5,3,42.8,20,30 18 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/imperial_set_screw_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,Socket_Size,Socket_Depth 2 | #0-80,0.028,0.05 3 | #1-64,0.028,0.06 4 | #1-72,0.028,0.06 5 | #2-56,0.035,0.06 6 | #2-64,0.035,0.06 7 | #3-48,0.05,0.07 8 | #3-56,0.05,0.07 9 | #4-36,0.05,0.07 10 | #4-40,0.05,0.07 11 | #4-48,0.05,0.07 12 | #5-40,1/16,0.08 13 | #5-44,1/16,0.08 14 | #6-32,1/16,0.08 15 | #6-40,1/16,0.08 16 | #8-32,5/64,0.09 17 | #8-36,5/64,0.09 18 | #10-24,3/32,0.1 19 | #10-32,3/32,0.1 20 | 1/4-20,1/8,0.125 21 | 1/4-28,1/8,0.125 22 | 5/16-18,5/32,0.156 23 | 5/16-24,5/32,0.156 24 | 3/8-16,3/16,0.188 25 | 3/8-24,3/16,0.188 26 | 7/16-14,7/32,0.219 27 | 7/16-20,7/32,0.219 28 | 1/2-13,1/4,0.25 29 | 1/2-20,1/4,0.25 30 | 5/8-11,5/16,0.312 31 | 5/8-18,5/16,0.312 32 | 3/4-10,3/8,0.375 33 | 3/4-16,3/8,0.375 34 | 7/8-14,1/2,0.5 35 | 7/8-9,1/2,0.5 36 | 1-8,9/16,0.562 37 | 1-12,9/16,0.562 38 | 1-14,9/16,0.562 39 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/internal_tooth_lock_washer_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,din6797:d1,din6797:d2,din6797:h,din6797:n,asme_b18.21.1:d1,asme_b18.21.1:d2,asme_b18.21.1:h,asme_b18.21.1:n 2 | M2,2.2,4.5,0.3,6,,,, 3 | M2.5,2.7,5.5,0.3,6,,,, 4 | M3,3.2,6,0.4,6,,,, 5 | M3.5,3.7,7,0.4,6,,,, 6 | M4,4.3,8,0.5,8,,,, 7 | M5,5.3,10,0.6,8,,,, 8 | M6,6.4,11,0.7,8,,,, 9 | M7,7.4,12.5,0.8,8,,,, 10 | M8,8.4,15,0.8,8,,,, 11 | M10,10.5,18,0.9,9,,,, 12 | M12,13,20.5,1,10,,,, 13 | M14,15,24,1,10,,,, 14 | M16,17,26,1.2,12,,,, 15 | M18,19,30,1.4,12,,,, 16 | M20,21,33,1.4,12,,,, 17 | M22,23,36,1.5,14,,,, 18 | M24,25,38,1.5,14,,,, 19 | M27,28,44,1.6,14,,,, 20 | M30,31,48,1.6,14,,,, 21 | #2,,,,,0.089,0.2,0.013,6 22 | #3,,,,,0.109,0.232,0.013,6 23 | #4,,,,,0.115,0.27,0.015,6 24 | #5,,,,,0.136,0.28,0.017,6 25 | #6,,,,,0.141,0.295,0.019,6 26 | #8,,,,,0.168,0.34,0.021,8 27 | #10,,,,,0.195,0.381,0.021,8 28 | #12,,,,,0.221,0.41,0.024,8 29 | 1/4,,,,,0.256,0.478,0.026,8 30 | 5/16,,,,,0.32,0.607,0.031,10 31 | 3/8,,,,,0.384,0.692,0.036,10 32 | 7/16,,,,,0.448,0.789,0.036,10 33 | 1/2,,,,,0.512,0.883,0.041,12 34 | 9/16,,,,,0.576,0.985,0.041,12 35 | 5/8,,,,,0.64,1.071,0.046,12 36 | 11/16,,,,,0.725,1.166,0.046,12 37 | 3/4,,,,,0.769,1.245,0.051,12 38 | 13/16,,,,,0.861,1.315,0.051,12 39 | 7/8,,,,,0.927,1.41,0.056,12 40 | 1,,,,,1.019,1.637,0.063,12 41 | 1 1/8,,,,,1.144,1.83,0.063,16 42 | 1 1/4,,,,,1.275,1.975,0.063,16 43 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/iso10664def.csv: -------------------------------------------------------------------------------- 1 | Size,A,B,Re 2 | T6,1.75,1.27,0.134 3 | T8,2.4,1.75,0.193 4 | T10,2.8,2.05,0.231 5 | T15,3.35,2.4,0.269 6 | T20,3.95,2.85,0.307 7 | T25,4.5,3.25,0.378 8 | T30,5.6,4.05,0.454 9 | T40,6.75,4.85,0.548 10 | T45,7.93,5.64,0.576 11 | T50,8.95,6.45,0.777 12 | T55,11.35,8.05,0.769 13 | T60,13.45,9.6,1.069 14 | T70,15.7,11.2,1.196 15 | T80,17.75,12.8,1.529 16 | T90,20.2,14.4,1.534 17 | T100,22.4,16,1.724 18 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/low_profile_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,OpenBuilds:dk,OpenBuilds:k,OpenBuilds:s,OpenBuilds:t,OpenBuilds:short,OpenBuilds:long 2 | M3-0.5,5.68,1.5,2,1.0,6,12 3 | M4-0.7,7.22,1.5,2.5,1.0,4,12 4 | M5-0.8,9.0,1.5,3,1.0,6,65 -------------------------------------------------------------------------------- /src/bd_warehouse/data/metric_set_screw_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,Socket_Size,Socket_Depth 2 | M1.6-0.35,0.7,0.6 3 | M2-0.4,0.9,0.8 4 | M2.5-0.45,1.3,1.1 5 | M3-0.5,1.5,1.5 6 | M4-0.7,2,1.8 7 | M5-0.8,2.5,2.7 8 | M6-1.0,3,3 9 | M8-1.25,4,4 10 | M10-1.5,5,5 11 | M12-1.75,6,6 12 | M16-2.0,8,8 13 | M20-2.5,10,9 14 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/nominal_screw_lengths.csv: -------------------------------------------------------------------------------- 1 | Screw_Type,Unit,Nominal_Sizes 2 | din931,mm,"12,16,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,110,120,130,140,150,160,170,180,190,200,220,240,260,280,300" 3 | din967,mm,"4,5,6,8,10,12,14,16,20,25,30,35,40,45,50,55,60" 4 | din968,mm,"4.5,6.5,9.5,13,16,19,22,25,32,38,45,50" 5 | din1662,mm,"10,12,16,20,25,30,35,40,45,50,55,60,65,70,80,90,100,110,120" 6 | din1665,mm,"10,12,16,20,25,30,35,40,45,50,55,60,65,70,80,90,100,110,120,130,140,150,160,180,200" 7 | iso1207,mm,"2,3,4,5,6,8,10,12,14,16,20,25,30,35,40,45,50,55,60,65,70,75,80" 8 | iso1580,mm,"2,2.5,3,4,5,68,10,12,14,16,20,25,30,35,40,45,50,55,60,65,70,75,80" 9 | iso2009,mm,"3,4,5,6,8,10,12,14,16,18,20,22,25,28,30,35,40,45,50,55,60,70,80,90,100" 10 | iso2010,mm,"2,3,4,5,6,8,10,12,14,16,18,20,22,25,30,35,40,45,50,55,60" 11 | iso4014,mm,"12,16,20,25,30,35,40,45,50,55,60,65,70,80,90,100,110,120,130,140,150,160,180,200,220,240,260,280,300,320,340,360,380,400,420,440,460,480,500" 12 | iso4017,mm,"2,3,4,5,6,8,10,12,16,20,25,30,35,40,45,50,55,60,65,70,80,90,100,110,120,130,140,150,160,180,200" 13 | iso4026,mm,"2,2.5,3,3.5,4,5,6,8,10,12,14,16,18,20,22,25,28,30,35,40,45,50,55,60" 14 | iso4762,mm,"2.5,3,4,5,6,8,10,12,16,20,25,30,35,40,45,50,55,60,65,70,80,90,100,110,120,130,140,150,160,180,200,220,240,260,280,300" 15 | iso7045,mm,"3,4,5,6,8,10,12,14,16,20,25,30,35,40,45,50,55,60" 16 | iso7046,mm,"3,4,5,6,8,10,12,14,16,20,25,30,35,40,45,50,55,60" 17 | iso7047,mm,"3,4,5,6,8,10,12,14,16,20,25,30,35,40,45,50,55,60" 18 | iso7048,mm,"2,3,4,5,6,8,10,12,16,20,25,30,35,40,45,50,60,70,80" 19 | iso7380_1,mm,"6,8,10,12,16,20,25,30,35,40,45,50,55,60,65,70,80,90" 20 | iso7380_2,mm,"6,8,10,12,16,20,25,30,35,40,45,50,55,60,65,70,80,90" 21 | iso10642,mm,"8,10,12,16,20,25,30,35,40,50,60,70,80,90,100" 22 | iso14579,mm,"3,4,5,6,8,10,12,16,20,25,30,35,40,45,50,55,60,65,70,80" 23 | iso14580,mm,"3,4,5,6,8,10,12,14,16,20,25,30,35,40,45,50,55,60,65,70,75,80" 24 | iso14581,mm,"3,4,5,6,8,10,12,14,16,20,25,30,35,40,45,50,55,60" 25 | iso14582,mm,"8,10,12,14,16,20,25,30,35,40,45,50,55,60,65,70,80,90,100" 26 | iso14583,mm,"3,4,5,6,8,10,12,14,16,20,25,30,35,40,45,50,55,60" 27 | iso14584,mm,"3,4,5,6,8,10,12,14,16,20,25,30,35,40,45,50,55,60" 28 | asme_b_18.6.3,in,"0.75,0.88,1.00,1.25,1.50,1.75,2.00,2.25,2.50,2.75,3.00,3.25,3.50,3.75,4.00,4.25,4.50,4.75,5.00,5.25,5.50,5.75,6.00,6.25,6.25,6.50,6.75,7.00,7.25,7.50,7.75,8.00,8.50,9.00,9.50,10.00,11.00,12.00,13.00,14.00,15.00,16.00,17.00,18.00,19.00,20.00" 29 | asme_b18.3,in,"0.75,0.88,1.00,1.25,1.50,1.75,2.00,2.25,2.50,2.75,3.00,3.25,3.50,3.75,4.00,4.25,4.50,4.75,5.00,5.25,5.50,5.75,6.00,6.25,6.25,6.50,6.75,7.00,7.25,7.50,7.75,8.00,8.50,9.00,9.50,10.00,11.00,12.00,13.00,14.00,15.00,16.00,17.00,18.00,19.00,20.00" 30 | OpenBuilds,mm,"4,6,8,10,12,15,20,25,27,30,35,40,45,50,55,60,65" 31 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/pan_head_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,iso14583:dk,iso14583:k,iso14583:recess,iso14583:short,iso14583:long,iso1580:dk,iso1580:k,iso1580:n,iso1580:t,iso1580:short,iso1580:long,asme_b_18.6.3:dk,asme_b_18.6.3:k,asme_b_18.6.3:recess,asme_b_18.6.3:short,asme_b_18.6.3:long 2 | M1.6-0.35,,,,,,3.2,1,0.6,0.35,2,16,,,,, 3 | M2-0.4,4,1.6,T6,3,20,4,1.3,0.7,0.5,2.5,20,,,,, 4 | M2.5-0.45,5,2.1,T8,3,25,5,1.5,0.8,0.6,3,25,,,,, 5 | M3-0.5,5.6,2.4,T10,4,30,5.6,1.8,1,0.7,4,30,,,,, 6 | M3.5-0.6,7,2.6,T15,5,35,7,2.1,1.2,0.8,5,35,,,,, 7 | M4-0.7,8,3.1,T20,5,40,8,2.4,1.51,1,5,40,,,,, 8 | M5-0.8,9.5,3.7,T25,6,50,9.5,3,1.51,1.2,6,45,,,,, 9 | M6-1,12,4.6,T30,8,60,12,3.6,1.91,1.4,8,45,,,,, 10 | M8-1.25,16,6,T45,10,60,16,4.8,2.31,1.9,10,45,,,,, 11 | M10-1.5,20,7.5,T50,12,60,20,6,2.81,2.4,12,45,,,,, 12 | #3-48,,,,,,,,,,,,0.193,0.078,R00,0.88,2.00 13 | #4-40,,,,,,,,,,,,0.219,0.086,R00,1.00,2.25 14 | #5-40,,,,,,,,,,,,0.245,0.095,R0,1.00,2.50 15 | #6-32,,,,,,,,,,,,0.27,0.103,R0,1.25,2.75 16 | #8-32,,,,,,,,,,,,0.322,0.12,R1,1.25,3.25 17 | #10-24,,,,,,,,,,,,0.373,0.137,R1,1.25,4.00 18 | #12-24,,,,,,,,,,,,0.425,0.153,R2,1.25,4.50 19 | 1/4-20,,,,,,,,,,,,0.492,0.175,R2,1.50,5.00 20 | 5/16-18,,,,,,,,,,,,0.615,0.218,R3,1.75,6.25 21 | 3/8-16,,,,,,,,,,,,0.74,0.261,R3,1.75,7.50 22 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/pan_head_with_collar_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,din967:dk,din967:k,din967:c,din967:rf,din967:recess,din967:short,din967:long 2 | M3-0.5,7.5,2.35,0.8,3.8,PH1,4,30 3 | M3.5-0.6,9,2.6,0.9,4.6,PH2,5,35 4 | M4-0.7,10,3.05,1.1,5.8,PH2,5,40 5 | M5-0.8,11.5,3.55,1.35,6.6,PH2,6,45 6 | M6-1,14.5,4.55,1.8,8.2,PH3,8,60 7 | M8-1.25,19,5.9,2.2,11,PH4,10,60 8 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/plain_washer_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,iso7089:d1,iso7089:d2,iso7089:h,iso7091:d1,iso7091:d2,iso7091:h,iso7093:d1,iso7093:d2,iso7093:h,iso7094:d1,iso7094:d2,iso7094:h 2 | M1.6,1.7,4,0.35,1.8,4,0.4,,,,,, 3 | M1.7,1.8,4.5,0.35,,,,,,,,, 4 | M2,2.2,5,0.35,2.4,5,0.4,,,,,, 5 | M2.3,2.5,6,0.55,,,,,,,,, 6 | M2.5,2.7,6,0.55,2.9,6,0.6,2.7,8,0.9,,, 7 | M2.6,2.8,7,0.55,,,,,,,,, 8 | M3,3.2,7,0.55,3.4,7,0.6,3.2,9,0.9,,, 9 | M3.5,3.7,8,0.55,,,,3.7,11,0.9,,, 10 | M4,4.3,9,0.9,4.5,9,1,4.3,12,1.1,,, 11 | M5,5.3,10,1.1,5.5,10,1.2,5.3,15,1.4,5.5,18,2.3 12 | M6,6.4,12,1.8,6.6,12,1.9,6.4,18,1.8,6.6,22,2.3 13 | M7,7.4,14,1.8,,,,7.4,22,2.2,,, 14 | M8,8.4,16,1.8,9,16,1.9,8.4,24,2.2,9,28,3.6 15 | M10,10.5,20,2.2,11,20,2.3,10.5,30,2.7,11,34,3.6 16 | M12,13,24,2.7,13.5,24,2.8,13,37,3.3,13.5,44,4.6 17 | M14,15,28,2.7,,,,15,44,3.3,,, 18 | M16,17,30,3.3,17.5,30,3.6,17,50,3.3,17.5,56,6 19 | M18,19,34,3.3,,,,20,56,4.6,,, 20 | M20,21,37,3.3,22,37,3.6,22,60,4.6,22,72,7 21 | M22,23,39,3.3,,,,,,,,, 22 | M24,25,44,4.3,26,44,4.6,26,72,6,26,85,7 23 | M26,27,50,4.3,,,,,,,,, 24 | M27,28,50,4.3,,,,,,,,, 25 | M28,29,50,4.3,,,,,,,,, 26 | M30,31,56,4.3,33,56,4.6,33,92,7,33,105,7 27 | M32,33,60,5.6,,,,,,,,, 28 | M33,34,60,5.6,,,,,,,,, 29 | M35,36,66,5.6,,,,,,,,, 30 | M36,37,66,5.6,39,66,6,39,110,9.2,39,125,9.2 31 | M42,,,,45,78,9.2,,,,,, 32 | M48,,,,52,92,9.2,,,,,, 33 | M56,,,,62,105,11.2,,,,,, 34 | M64,,,,70,115,11.2,,,,,, 35 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/raised_cheese_head_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,iso7045:dk,iso7045:k,iso7045:rf,iso7045:recess,iso7045:short,iso7045:long 2 | M1.6-0.35,3.2,1.3,2.5,PH0,3,16 3 | M2-0.4,4,1.6,3.2,PH0,3,20 4 | M2.5-0.45,5,2.1,4,PH1,3,25 5 | M3-0.5,5.6,2.4,5,PH1,4,30 6 | M3.5-0.6,7,2.6,6,PH2,5,35 7 | M4-0.7,8,3.1,6.5,PH2,5,40 8 | M5-0.8,9.5,3.7,8,PH2,6,45 9 | M6-1,12,4.6,10,PH3,8,60 10 | M8-1.25,16,6,13,PH4,10,60 11 | M10-1.5,20,7.5,16,PH4,12,60 12 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/raised_countersunk_oval_head_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,iso2010:a,iso2010:dk,iso2010:k,iso2010:n,iso2010:rf,iso2010:t,iso2010:short,iso2010:long,iso7047:a,iso7047:dk ,iso7047:k,iso7047:rf ,iso7047:recess,iso7047:short,iso7047:long,iso14584:a,iso14584:dk,iso14584:k,iso14584:rf,iso14584:recess,iso14584:short,iso14584:long 2 | M1-0.25,90,1.9,0.6,0.45,2,0.4,2,5,,,,,,,,,,,,,, 3 | M1.2-0.25,90,2.3,0.72,0.5,2.5,0.5,2,6,,,,,,,,,,,,,, 4 | M1.4-0.3,90,2.6,0.84,0.5,3,0.52,2,10,,,,,,,,,,,,,, 5 | M1.6-0.35,90,3,0.96,0.6,3,0.65,2,10,90,3,0.96,3,PH0,3,16,,,,,,, 6 | M2-0.4,90,3.8,1.2,0.7,4,0.8,3,18,90,3.8,1.2,4,PH1,3,20,90,4.4,1.2,4,T6,3,20 7 | M2.5-0.45,90,4.7,1.5,0.8,5,1,3,25,90,4.7,1.5,5,PH1,3,25,90,5.5,1.5,5,T8,3,25 8 | M3-0.5,90,5.6,1.65,1,6,1.2,4,30,90,5.6,1.65,6,PH1,4,30,90,6.3,1.65,6,T10,4,30 9 | M3.5-0.6,90,6.5,1.93,1,7,1.4,4,35,90,6.5,1.93,7,PH2,4,35,90,8.2,2.35,8.5,T15,5,35 10 | M4-0.7,90,7.5,2.2,1.2,8,1.6,5,40,90,7.5,2.2,8,PH2,5,40,90,9.4,2.7,9.5,T20,5,40 11 | M5-0.8,90,9.2,1.25,1.51,10,2,6,50,90,9.2,1.25,10,PH2,6,50,90,10.4,2.7,9.5,T25,6,50 12 | M6-1,90,11,1.5,1.91,12,2.4,8,50,90,11,1.5,12,PH3,8,50,90,12.6,3.3,12,T30,8,60 13 | M8-1.25,90,14.5,2,2.31,16,3.2,10,55,90,14.5,2,16,PH4,10,55,90,17.3,4.65,16.5,T45,10,60 14 | M10-1.5,90,18,2.5,2.81,20,4,12,60,90,18,2.5,20,PH4,12,60,90,20,5,19.5,T50,12,60 15 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/setscrew_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,iso4026:s,iso4026:t,iso4026:short,iso4026:long 2 | M1.4-0.3,0.7,1.4,2.5,6 3 | M1.6-0.35,0.7,1.5,2.5,6 4 | M1.8-0.35,0.7,1.6,2.5,6 5 | M2-0.4,0.9,1.7,3,10 6 | M2.5-0.45,1.3,2,3,10 7 | M3-0.5,1.5,2,3,20 8 | M4-0.7,2,2.5,4,20 9 | M5-0.8,2.5,3,5,25 10 | M6-1,3,3.5,6,35 11 | M8-1.25,4,5,8,40 12 | M10-1.5,5,6,10,40 13 | M12-1.75,6,8,16,40 14 | M16-2,8,10,20,40 15 | M20-2.5,10,12,20,50 16 | M24-3,12,15,25,60 17 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/single_row_angular_contact_ball_bearing_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,SKT:d,SKT:D,SKT:B,SKT:C,SKT:C0,SKT:Pu,SKT:speed-reference,SKT:speed-limit,SKT:mass,SKT:Designation,SKT:d1,SKT:d2,SKT:D1,SKT:r12,SKT:r34,SKT:a,SKT:da,SKT:Da,SKT:Db,SKT:ra,SKT:rb 2 | M10-30-9,10,30,9,7.02,3.35,0.14,30000,30000,0.03, 7200 BECBP,18.3,14.6,22.9,0.6,0.3,13,14.2,25.8,27.6,0.6,0.3 3 | M12-32-10,12,32,10,7.61,3.8,0.16,26000,26000,0.036, 7201 BECBP,20.2,16.6,25,0.6,0.3,14,16.2,27.8,30,0.6,0.3 4 | M12-37-12,12,37,12,10.6,5,0.208,24000,24000,0.06, –,21.8,17,28.3,1,0.6,16.3,17.6,31.4,32.8,1,0.6 5 | M15-35-11,15,35,11,8.8,4.65,0.196,26000,26000,0.045, * 7202 BECBP,22.7,19,27.8,0.6,0.3,16,19.2,30.8,32.6,0.6,0.3 6 | M15-42-13,15,42,13,13,6.7,0.28,20000,20000,0.08, 7302 BECBP,26,20.7,32.6,1,0.6,18.6,20.6,36,38,1,0.6 7 | M17-40-12,17,40,12,11,5.85,0.25,22000,22000,0.065, * 7203 BECBM,26.3,21.7,31.2,0.6,0.6,18,21.2,35.8,35.8,0.6,0.6 8 | M17-47-14,17,47,14,15.9,8.3,0.355,19000,19000,0.11, 7303 BECBP,28.7,22.8,36.2,1,0.6,20.4,22.6,41.4,42.8,1,0.6 9 | M20-52-15,20,52,15,19,10,0.425,18000,18000,0.14, * 7304 BECBPH,33.3,33.3,40.4,1.1,0.6,22.8,27,45,47.8,1,0.6 10 | M25-62-17,25,62,17,26.5,15.3,0.655,15000,15000,0.23, * 7305 BECBPH,39.8,32.4,48.1,1.1,0.6,26.8,32,55,57.8,1,0.6 11 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/single_row_capped_deep_groove_ball_bearing_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,SKT:d,SKT:D,SKT:B,SKT:C,SKT:C0,SKT:Pu,SKT:Speed-reference,SKT:Speed-limit,SKT:mass,SKT:Designation,SKT:d1,SKT:D1,SKT:r12,SKT:damin,SKT:damax,SKT:Da,SKT:ra,SKT:kr,SKT:f0,OpenBuilds:d,OpenBuilds:D,OpenBuilds:B,OpenBuilds:d1,OpenBuilds:D1,OpenBuilds:r12,OpenBuilds:Speed-limit,OpenBuilds:Designation 2 | M3-10-4,3,10,4,0.54,0.18,0.007,130000,60000,0.0015,623-2Z,5.2,8.2,0.15,4.2,5.1,8.8,0.1,0.025,7.5,,,,,,,, 3 | M4-9-3.5,4,9,3.5,0.54,0.18,0.07,140000,70000,0.001,628/4-2Z,5.2,8.1,0.1,4.6,5.1,8.4,0.1,0.015,10,,,,,,,, 4 | M4-9-4,4,9,4,0.54,0.18,0.07,140000,70000,0.0013,638/4-2Z,5.2,8.1,0.1,4.6,5.1,8.4,0.1,0.015,10,,,,,,,, 5 | M4-11-4,4,11,4,0.624,0.18,0.008,130000,63000,0.0017,619/4-2Z,6.1,9.9,0.15,4.8,5.8,10.2,0.1,0.02,6.4,,,,,,,, 6 | M4-12-4,4,12,4,0.806,0.28,0.012,120000,60000,0.0021,604-2Z,6.1,9.8,0.2,5.4,6,10.6,0.2,0.025,10,,,,,,,, 7 | M4-13-5,4,13,5,0.936,0.29,0.012,110000,53000,0.0031,624-2Z,6.7,11.2,0.2,5.8,6.6,11.2,0.2,0.025,7.3,,,,,,,, 8 | M4-16-5,4,16,5,1.11,0.38,0.016,95000,48000,0.0054,634-2Z,8.4,13.3,0.3,6.4,8.3,13.6,0.3,0.03,8.4,,,,,,,, 9 | M5-10-4,,,,,,,,,,,,,,,,,,,,5,10,4,6.2,9.2,0.15,6000,105zz 10 | M5-11-4,5,11,4,0.64,0.26,0.011,120000,60000,0.0014,628/5-2Z,6.8,9.9,0.15,5.8,6.7,10.2,0.1,0.015,11,,,,,,,, 11 | M5-11-5,5,11,5,0.64,0.26,0.011,120000,60000,0.0016,638/5-2Z,6.2,9.9,0.15,5.8,6,10.2,0.1,0.015,11,,,,,,,, 12 | M5-13-4,5,13,4,0.884,0.335,0.014,110000,56000,0.0025,619/5-2Z,7.5,11.2,0.2,6.4,7.5,11.6,0.2,0.02,11,,,,,,,, 13 | M5-16-5,5,16,5,1.14,0.38,0.016,104000,55000,0.005,E2.625-2Z,8.4,13.3,0.3,7.4,8.3,13.6,0.3,0.025,8.4,,,,,,,, 14 | M5-19-6,5,19,6,2.21,0.95,0.04,90000,47000,0.009,E2.635-2Z,11.1,16.5,0.3,7.4,10.6,16.6,0.3,0.03,13,,,,,,,, 15 | M6-13-5,6,13,5,0.88,0.35,0.015,110000,53000,0.0026,628/6-2Z,7.4,11.7,0.15,6.8,7.2,12.2,0.1,0.015,11,,,,,,,, 16 | M6-15-5,6,15,5,0.884,0.27,0.011,100000,50000,0.0039,619/6-2Z,8.2,13,0.2,7.4,8,13.6,0.2,0.02,6.8,,,,,,,, 17 | M6-19-6,6,19,6,2.21,0.95,0.04,90000,47000,0.0084,E2.626-2Z,11.1,16.5,0.3,8.4,11,16.6,0.3,0.025,13,,,,,,,, 18 | M7-14-5,7,14,5,0.956,0.4,0.017,100000,50000,0.0031,628/7-2Z,8.5,12.7,0.15,7.8,8,13.2,0.1,0.015,11,,,,,,,, 19 | M7-17-5,7,17,5,1.06,0.375,0.016,90000,45000,0.0049,619/7-2Z,10.4,14.3,0.3,9,9.7,15,0.3,0.02,7.3,,,,,,,, 20 | M7-19-6,7,19,6,2.21,0.95,0.04,90000,47000,0.008,E2.607-2Z,11.1,16.5,0.3,9,11,17,0.3,0.025,13,,,,,,,, 21 | M8-16-5,8,16,5,1.33,0.57,0.024,90000,45000,0.0036,628/8-2Z,10.1,14.2,0.2,9.4,10,14.6,0.2,0.015,11,,,,,,,, 22 | M8-16-6,8,16,6,1.33,0.57,0.024,90000,45000,0.0043,638/8-2Z,9.6,14.2,0.2,9.4,9.5,14.6,0.2,0.015,11,,,,,,,, 23 | M8-19-6,8,19,6,1.46,0.465,0.02,85000,43000,0.0071,619/8-2Z,9.8,16.7,0.3,9.5,9.8,17,0.3,0.02,6.6,,,,,,,, 24 | M8-22-7,8,22,7,3.32,1.37,0.06,80000,42000,0.012,E2.608-2Z,12.1,19.2,0.3,10,12,20,0.3,0.025,12,,,,,,,, 25 | M8-22-11,8,22,11,3.45,1.37,0.057,–,22000,0.016,630/8-2RS1,11.8,19,0.3,10,11.7,20,0.3,0.025,12,,,,,,,, 26 | M8-24-8,8,24,8,3.71,1.66,0.072,75000,37000,0.017,E2.628-2Z,14.4,21.2,0.3,10.4,14.4,21.6,0.3,0.025,13,,,,,,,, 27 | M8-28-6,8,28,6,1.33,0.57,0.024,60000,30000,0.03,638-2RZ,14.8,22.6,0.3,10.4,14.7,25.6,0.3,0.03,12,,,,,,,, 28 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/single_row_cylindrical_roller_bearing_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,SKT:d,SKT:D,SKT:B,SKT:C,SKT:C0,SKT:Pu,SKT:Speed-reference,SKT:Speed-limit,SKT:mass,SKT:Designation,SKT:d1,SKT:D1,SKT:FE,SKT:r12,SKT:r34,SKT:s,SKT:damin,SKT:damax,SKT:db,SKT:Da,SKT:ra,SKT:rb,SKT:kr 2 | M15-35-11,15,35,11,12.5,10.2,1.22,22000,26000,0.048,NJ 202 ECP,21.9,27.9,19.3,0.6,0.3,1,18.2,18.4,23,31.3,0.6,0.3,0.15 3 | M17-40-12,17,40,12,17.2,14.3,1.73,19000,22000,0.07,NJ 203 ECP,25,32.4,22.1,0.6,0.3,1,20.7,21.1,27,36,0.6,0.3,0.15 4 | M17-40-16,17,40,16,23.8,21.6,2.65,19000,22000,0.093,NJ 2203 ECP,25,32.4,22.1,0.6,0.3,1.5,20.7,21.1,27,36,0.6,0.3,0.2 5 | M17-47-14,17,47,14,28.5,20.4,2.55,15000,20000,0.12,* NJ 303 ECP,27.7,37,24.2,1,0.6,1,22.1,23.1,29,41.7,1,0.6,0.15 6 | M20-47-14,20,47,14,28.5,22,2.75,16000,19000,0.11,* NJ 204 ECP,29.7,38.8,26.5,1,0.6,1,25,25.4,31,41.7,1,0.6,0.15 7 | M20-47-18,20,47,18,34.5,27.5,3.45,16000,19000,0.14,* NJ 2204 ECP,29.7,38.8,26.5,1,0.6,2,25,25.4,31,41.7,1,0.6,0.2 8 | M20-52-15,20,52,15,35.5,26,3.25,15000,18000,0.15,* NU 304 ECP,31.2,42.4,27.5,1.1,0.6,0.9,24.1,26.2,29,45.4,1,0.6,0.15 9 | M20-52-21,20,52,21,47.5,38,4.8,15000,18000,0.22,* NJ 2304 ECP,31.2,42.4,27.5,1.1,0.6,1.9,26.1,26.2,33,45.4,1,0.6,0.25 10 | M25-52-15,25,52,15,32.5,27,3.35,14000,16000,0.13,* NU 205 ECP,34.7,43.8,31.5,1,0.6,1.3,28.9,30.4,33,46.4,1,0.6,0.15 11 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/single_row_deep_groove_ball_bearing_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,SKT:d,SKT:D,SKT:B,SKT:C,SKT:C0,SKT:Pu,SKT:Speed-reference,SKT:Speed-limit,SKT:mass,SKT:Designation,SKT:d1,SKT:D1,SKT:D2,SKT:r12,SKT:da,SKT:Da,SKT:ra,SKT:kr,SKT:f0 2 | M3-10-4,3,10,4,0.54,0.18,0.007,130000,80000,0.0015,623,5.2,7.5,8.2,0.15,4.2,8.8,0.1,0.025,7.5 3 | M4-9-2.5,4,9,2.5,0.423,0.116,0.005,140000,85000,0.0007,618/4,5.2,7.5,–,0.1,4.6,8.4,0.1,0.015,6.5 4 | M4-11-4,4,11,4,0.624,0.18,0.008,130000,80000,0.0017,619/4,6.1,9,9.9,0.15,4.8,10.2,0.1,0.02,6.4 5 | M4-12-4,4,12,4,0.806,0.28,0.012,120000,75000,0.0021,604,6.1,9.9,–,0.2,5.4,10.6,0.2,0.025,10 6 | M4-13-5,4,13,5,0.936,0.29,0.012,110000,67000,0.0031,624,6.7,10.3,11.2,0.2,5.8,11.2,0.2,0.025,10 7 | M4-16-5,4,16,5,1.11,0.38,0.016,95000,60000,0.0054,634,8.4,12,13.3,0.3,6.4,13.6,0.3,0.03,8.4 8 | M5-11-3,5,11,3,0.468,0.143,0.006,120000,75000,0.0012,618/5,6.8,9.2,–,0.15,5.8,10.2,0.1,0.015,7.1 9 | M5-13-4,5,13,4,0.884,0.335,0.014,110000,70000,0.0025,619/5,7.5,10.5,11.2,0.2,6.4,11.6,0.2,0.02,11 10 | M5-16-5,5,16,5,1.14,0.38,0.016,95000,60000,0.005,* 625,8.4,12,13.3,0.3,7.4,13.6,0.3,0.025,8.4 11 | M5-19-6,5,19,6,2.34,0.95,0.04,80000,50000,0.0085,* 635,11.1,15.2,16.5,0.3,7.4,16.6,0.3,0.03,13 12 | M6-13-3.5,6,13,3.5,0.715,0.224,0.01,110000,67000,0.002,618/6,8,11,–,0.15,6.8,12.2,0.1,0.015,7 13 | M6-15-5,6,15,5,0.884,0.27,0.011,100000,63000,0.0039,619/6,8.2,11.7,13,0.2,7.4,13.6,0.2,0.02,6.8 14 | M6-19-6,6,19,6,2.34,0.95,0.04,80000,50000,0.0081,* 626,11.1,15.2,16.5,0.3,8.4,16.6,0.3,0.025,13 15 | M7-14-3.5,7,14,3.5,0.78,0.26,0.011,100000,63000,0.0022,618/7,9,12,–,0.15,7.8,13.2,0.1,0.015,7.2 16 | M7-17-5,7,17,5,1.06,0.375,0.016,90000,56000,0.0049,619/7,10.4,13.6,14.3,0.3,9,15,0.3,0.02,7.3 17 | M7-19-6,7,19,6,2.34,0.95,0.04,85000,53000,0.0076,* 607,11.1,15.2,16.5,0.3,9,17,0.3,0.025,13 18 | M7-22-7,7,22,7,3.45,1.37,0.057,70000,45000,0.012,* 627,12.1,17.6,19.2,0.3,9.4,19.6,0.3,0.025,12 19 | M8-16-4,8,16,4,0.819,0.3,0.012,90000,56000,0.003,618/8,10.5,13.5,–,0.2,9.4,14.6,0.2,0.015,7.5 20 | M8-19-6,8,19,6,1.46,0.465,0.02,85000,53000,0.0071,619/8,10.5,15.5,16.7,0.3,10,17,0.3,0.02,6.6 21 | M8-22-7,8,22,7,3.45,1.37,0.057,75000,48000,0.012,* 608,12.1,17.6,19.2,0.3,10,20,0.3,0.025,12 22 | M8-24-8,8,24,8,3.9,1.66,0.071,63000,40000,0.018,* 628,14.4,19.8,21.2,0.3,10.4,21.6,0.3,0.025,13 23 | M9-17-4,9,17,4,0.871,0.34,0.014,85000,53000,0.0034,618/9,11.5,14.5,–,0.2,10.4,15.6,0.2,0.015,7.7 24 | M9-20-6,9,20,6,2.34,0.98,0.043,80000,50000,0.0076,619/9,11.6,16.2,17.5,0.3,11,18,0.3,0.02,12 25 | M9-24-7,9,24,7,3.9,1.66,0.071,70000,43000,0.014,* 609,14.4,19.8,21.2,0.3,11,22,0.3,0.025,13 26 | M9-26-8,9,26,8,4.75,1.96,0.083,60000,38000,0.02,* 629,14.8,21.2,22.6,0.3,11.4,23.6,0.3,0.025,12 27 | M10-19-5,10,19,5,1.72,0.83,0.036,80000,48000,0.0053,61800,12.7,16.3,–,0.3,12,17,0.3,0.015,15 28 | M10-22-6,10,22,6,2.7,1.27,0.054,70000,45000,0.01,61900,13.9,18.2,–,0.3,12,20,0.3,0.02,14 29 | M10-26-8,10,26,8,4.75,1.96,0.083,67000,40000,0.019,* 6000,14.8,21.2,22.6,0.3,12,24,0.3,0.025,12 30 | M10-28-8,10,28,8,5.07,2.36,0.1,60000,38000,0.024,16100,17,23.2,24.8,0.3,14.2,23.8,0.3,0.025,13 31 | M10-30-9,10,30,9,5.4,2.36,0.1,56000,36000,0.031,* 6200,17,23.2,24.8,0.6,14.2,25.8,0.6,0.025,13 32 | M10-35-11,10,35,11,8.52,3.4,0.143,50000,32000,0.053,* 6300,17.5,26.9,28.7,0.6,14.2,30.8,0.6,0.03,11 33 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/single_row_tapered_roller_bearing_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,SKT:d,SKT:D,SKT:T,SKT:Cl,SKT:Cl0,SKT:Pu,SKT:Speed-reference,SKT:Speed-limit,SKT:kg,SKT:Designation,SKT:d1,SKT:B,SKT:C,SKT:r12,SKT:r34,SKT:a,SKT:da,SKT:db,SKT:Damin,SKT:Damax,SKT:Dbmin,SKT:Camin,SKT:Cbmin,SKT:ra,SKT:rb,SKT:e,SKT:Y,SKT:Y0 2 | M15-42-14.25,15,42,14.25,22.4,20,2.08,13000,18000,0.094,30302 J2,27.3,13,11,1,1,9,22,21,36,36,38,2,3,1,1,0.28,2.1,1.1 3 | M17-40-13.25,17,40,13.25,19,18.6,1.83,13000,18000,0.079,30203 J2,29,12,11,1,1,10,23,23,34,34,37,2,2,1,1,0.35,1.7,0.9 4 | M17-47-15.25,17,47,15.25,28.1,25,2.7,12000,16000,0.13,30303 J2,30.5,14,12,1,1,10,25,23,40,41,42,2,3,1,1,0.28,2.1,1.1 5 | M17-47-20.25,17,47,20.25,34.7,33.5,3.65,11000,16000,0.17,32303 J2/Q,30.7,19,16,1,1,12,24,23,39,41,43,3,4,1,1,0.28,2.1,1.1 6 | M20-42-15,20,42,15,24.2,27,2.65,12000,16000,0.098,32004 X/Q,32.1,15,12,0.6,0.6,10,25,25,36,37,39,3,3,0.6,0.6,0.37,1.6,0.9 7 | M20-47-15.25,20,47,15.25,27.5,28,3,11000,15000,0.12,30204 J2/Q,33.7,14,12,1,1,11,27,26,40,41,43,2,3,1,1,0.35,1.7,0.9 8 | M20-52-16.25,20,52,16.25,34.1,32.5,3.55,11000,14000,0.17,30304 J2/Q,34.4,15,13,1.5,1.5,11,28,27,44,45,47,2,3,1.5,1.5,0.3,2,1.1 9 | M20-52-22.25,20,52,22.25,44,45.5,5,10000,14000,0.23,32304 J2/Q,34.6,21,18,1.5,1.5,14,27,27,43,45,47,3,4,1.5,1.5,0.3,2,1.1 10 | M22-44-15,22,44,15,25.1,29,2.85,11000,15000,0.1,320/22 X,34.1,15,11.5,0.6,0.6,11,27,27,38,39,41,3,3.5,0.6,0.6,0.4,1.5,0.8 11 | M25-47-15,25,47,15,27,32.5,3.25,11000,14000,0.11,32005 X/Q,37.5,15,11.5,0.6,0.6,11,30,30,40,42,44,3,3.5,0.6,0.6,0.43,1.4,0.8 12 | M25-52-16.25,25,52,16.25,30.8,33.5,3.45,10000,13000,0.15,30205 J2/Q,38,15,13,1,1,12,31,31,44,46,48,2,3,1,1,0.37,1.6,0.9 13 | M25-52-19.25,25,52,19.25,35.8,44,4.65,9500,13000,0.19,32205 BJ2/Q,41.5,18,15,1,1,16,30,31,41,46,49,3,4,1,1,0.57,1.05,0.6 14 | M25-52-22,25,52,22,47.3,56,6,9000,13000,0.22,33205/Q,38.7,22,18,1,1,14,30,31,43,46,49,4,4,1,1,0.35,1.7,0.9 15 | M25-62-18.25,25,62,18.25,44.6,43,4.75,9000,12000,0.26,30305 J2/Q,41.5,17,15,1.5,1.5,13,34,32,54,55,57,2,3,1.5,1.5,0.3,2,1.1 16 | M25-62-25.25,25,62,25.25,60.5,63,7.1,8000,12000,0.36,32305 J2,41.7,24,20,1.5,1.5,15,33,32,53,55,57,3,5,1.5,1.5,0.3,2,1.1 17 | M28-52-16,28,52,16,31.9,38,4,9500,13000,0.14,320/28 X/Q,41.3,16,12,1,1,12,33,34,45,46,49,3,4,1,1,0.43,1.4,0.8 18 | M28-58-17.25,28,58,17.25,38,41.5,4.4,9000,12000,0.2,302/28 J2,42,16,14,1,1,13,35,34,50,52,54,2,3,1,1,0.37,1.6,0.9 19 | M28-58-20.25,28,58,20.25,41.8,50,5.5,8500,12000,0.25,322/28 BJ2/Q,43.9,19,16,1,1,17,33,34,46,52,55,3,4,1,1,0.57,1.05,0.6 20 | M30-55-17,30,55,17,35.8,44,4.55,9000,12000,0.17,32006 X/Q,43.6,17,13,1,1,13,35,36,48,49,52,3,4,1,1,0.43,1.4,0.8 21 | M30-62-17.25,30,62,17.25,40.2,44,4.8,8500,11000,0.23,30206 J2/Q,45.3,16,14,1,1,14,37,36,53,56,57,2,3,1,1,0.37,1.6,0.9 22 | M30-62-21.25,30,62,21.25,49.5,58.5,6.55,8000,11000,0.3,32206 BJ2/QCL7CVA606,48.2,20,17,1,1,18,36,36,50,56,60,3,4,1,1,0.57,1.05,0.6 23 | M30-62-21.25,30,62,21.25,50.1,57,6.3,8500,11000,0.29,32206 J2/Q,45.2,20,17,1,1,15,37,36,52,56,59,3,4,1,1,0.37,1.6,0.9 24 | M30-62-25,30,62,25,64.4,76.5,8.5,7500,11000,0.35,33206/Q,45.8,25,19.5,1,1,16,36,36,53,56,59,5,5.5,1,1,0.35,1.7,0.9 25 | M30-72-20.75,30,72,20.75,56.1,56,6.4,7500,10000,0.38,30306 J2/Q,48.4,19,16,1.5,1.5,15,40,37,62,65,66,3,4.5,1.5,1.5,0.31,1.9,1.1 26 | M30-72-28.75,30,72,28.75,76.5,85,9.65,7000,10000,0.55,32306 J2/Q,48.7,27,23,1.5,1.5,18,39,37,59,65,66,4,5.5,1.5,1.5,0.31,1.9,1.1 27 | M32-53-14.5,32,53,14.5,27,35.5,3.65,9000,13000,0.11,JL 26749 F/710,43.4,15,11.5,1.6,1.3,11,38,43,47,47,50,2,3,3,1.3,0.33,1.8,1 28 | M32-58-17,32,58,17,36.9,46.5,4.8,8500,11000,0.19,320/32 X/Q,46.2,17,13,1,1,14,38,38,50,52,55,3,4,1,1,0.46,1.3,0.7 29 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/socket_head_cap_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,iso4762:dk ,iso4762:k ,iso4762:s ,iso4762:t ,iso4762:short,iso4762:long,asme_b18.3:dk ,asme_b18.3:k ,asme_b18.3:s ,asme_b18.3:t ,asme_b18.3:short,asme_b18.3:long 2 | M1.6-0.35,3.14,1.6,1.5,0.7,2.5,16,,,,,, 3 | M2-0.4,3.98,2,1.5,1,3,20,,,,,, 4 | M2.5-0.45,4.68,2.5,2,1.1,4,25,,,,,, 5 | M3-0.5,5.68,3,2.5,1.3,5,30,,,,,, 6 | M4-0.7,7.22,4,3,2,6,40,,,,,, 7 | M5-0.8,8.72,5,4,2.5,8,50,,,,,, 8 | M6-1,10.22,6,5,3,8,60,,,,,, 9 | M8-1.25,13.27,8,6,4,10,80,,,,,, 10 | M10-1.5,16.27,10,8,5,16,100,,,,,, 11 | M12-1.75,18.27,12,10,6,20,120,,,,,, 12 | M14-2,21.33,14,12,7,25,140,,,,,, 13 | M16-2,24.33,16,14,8,25,160,,,,,, 14 | M20-2.5,30.33,20,17,10,16,100,,,,,, 15 | M24-3,36.39,24,19,12,40,200,,,,,, 16 | M30-3.5,45.39,30,22,15.5,45,200,,,,,, 17 | M36-4,54.46,36,27,19,55,200,,,,,, 18 | M42-4.5,63.46,42,32,24,60,300,,,,,, 19 | M48-5,72.46,48,36,28,100,300,,,,,, 20 | M56-5.5,84.54,56,41,34,110,300,,,,,, 21 | M64-6,96.54,64,46,38,120,300,,,,,, 22 | #0-80,,,,,,,0.096,0.0600,0.050,0.025,0.75,1.25 23 | #1-64,,,,,,,0.118,0.0730,1/16,0.031,0.88,1.50 24 | #1-72,,,,,,,0.118,0.0730,1/16,0.031,0.88,1.50 25 | #2-56,,,,,,,0.140,0.0860,5/64,0.038,0.88,1.75 26 | #2-64,,,,,,,0.140,0.0860,5/64,0.038,0.88,1.75 27 | #3-48,,,,,,,0.161,0.0990,5/64,0.044,0.88,2.00 28 | #3-56,,,,,,,0.161,0.0990,5/64,0.044,0.88,2.00 29 | #4-36,,,,,,,0.183,0.1120,3/32,0.051,1.00,2.25 30 | #4-40,,,,,,,0.183,0.1120,3/32,0.051,1.00,2.25 31 | #4-48,,,,,,,0.183,0.1120,3/32,0.051,1.00,2.25 32 | #5-40,,,,,,,0.205,0.1250,3/32,0.057,1.00,2.50 33 | #5-44,,,,,,,0.205,0.1250,3/32,0.057,1.00,2.50 34 | #6-32,,,,,,,0.226,0.1380,7/64,0.064,1.25,2.75 35 | #6-40,,,,,,,0.226,0.1380,7/64,0.064,1.25,2.75 36 | #8-32,,,,,,,0.270,0.1640,9/64,0.077,1.25,3.25 37 | #8-36,,,,,,,0.270,0.1640,9/64,0.077,1.25,3.25 38 | #10-24,,,,,,,0.312,0.1900,5/32,0.090,1.25,4.00 39 | #10-32,,,,,,,0.312,0.1900,5/32,0.090,1.25,4.00 40 | 1/4-20,,,,,,,0.375,0.2500,3/16,0.120,1.50,5.00 41 | 1/4-28,,,,,,,0.375,0.2500,3/16,0.120,1.50,5.00 42 | 5/16-18,,,,,,,0.469,0.3125,1/4,0.151,1.75,6.25 43 | 5/16-24,,,,,,,0.469,0.3125,1/4,0.151,1.75,6.25 44 | 3/8-16,,,,,,,0.562,0.3750,5/16,0.182,1.75,7.50 45 | 3/8-24,,,,,,,0.562,0.3750,5/16,0.182,1.75,7.50 46 | 7/16-14,,,,,,,0.656,0.4375,3/8,0.213,2.00,9.00 47 | 7/16-20,,,,,,,0.656,0.4375,3/8,0.213,2.00,9.00 48 | 1/2-13,,,,,,,0.750,0.5000,3/8,0.245,2.25,10.00 49 | 1/2-20,,,,,,,0.750,0.5000,3/8,0.245,2.25,10.00 50 | 5/8-11,,,,,,,0.938,0.6250,1/2,0.307,2.50,12.00 51 | 5/8-18,,,,,,,0.938,0.6250,1/2,0.307,2.50,12.00 52 | 3/4-10,,,,,,,1.125,0.7500,5/8,0.370,3.00,15.00 53 | 3/4-16,,,,,,,1.125,0.7500,5/8,0.370,3.00,15.00 54 | 7/8-14,,,,,,,1.312,0.8750,3/4,0.432,3.25,18.00 55 | 7/8-9,,,,,,,1.312,0.8750,3/4,0.432,3.25,18.00 56 | 1-8,,,,,,,1.500,1.0000,3/4,0.495,3.50,20.00 57 | 1-12,,,,,,,1.500,1.0000,3/4,0.495,3.50,20.00 58 | 1-14,,,,,,,1.500,1.0000,3/4,0.495,3.50,20.00 -------------------------------------------------------------------------------- /src/bd_warehouse/data/square_nut_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,din557:m,din557:s 2 | M5-0.8,4,8 3 | M6-1,5,10 4 | M8-1.25,6.5,13 5 | M10-1.5,8,17 6 | M12-1.75,10,19 7 | M16-2,13,24 8 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/tap_hole_sizes.csv: -------------------------------------------------------------------------------- 1 | Size,Soft,Hard 2 | M1.5-0.35,1.15,1.25 3 | M1.6-0.35,1.25,1.35 4 | M1.8-0.35,1.45,1.55 5 | M2-0.45,1.55,1.7 6 | M2-0.4,1.6,1.75 7 | M2.2-0.45,1.75,1.9 8 | M2.5-0.45,2.05,2.2 9 | M3-0.6,2.4,2.6 10 | M3-0.5,2.5,2.7 11 | M3.5-0.6,2.9,3.1 12 | M4-0.75,3.25,3.5 13 | M4-0.7,3.3,3.5 14 | M4.5-0.75,3.75,4 15 | M5-1,4,4.4 16 | M5-0.9,4.1,4.4 17 | M5-0.8,4.2,4.5 18 | M5.5-0.9,4.6,4.9 19 | M6-1,5,5.4 20 | M6-0.75,5.25,5.5 21 | M7-1.0,6,6.4 22 | M7-0.75,6.25,6.5 23 | M8-1.25,6.8,7.2 24 | M8-1,7,7.4 25 | M9-1.25,7.8,8.2 26 | M9-1,8,8.4 27 | M10-1.5,8.5,9 28 | M10-1.25,8.8,9.2 29 | M10-1,9,9.4 30 | M11-1.5,9.5,10 31 | M12-1.75,10.3,10.9 32 | M12-1.5,10.5,11 33 | M12-1.25,10.8,11.2 34 | M14-2,12.1,12.7 35 | M14-1.5,12.5,13 36 | M14-1.25,12.8,13.2 37 | M15-1.5,13.5,14 38 | M16-2,14,14.75 39 | M16-1.5,14.5,15 40 | M17-1.5,15.5,16 41 | M18-2.5,15.5,16.5 42 | M18-2,16,16.75 43 | M18-1.5,16.5,17 44 | M19-2.5,16.5,17.5 45 | M20-2.5,17.5,18.5 46 | M21-2,18,18.5 47 | M22-2.5,18.5,19 48 | #0-80,3/64,#55 49 | #1-64,#53,1/16 50 | #1-72,#53,#52 51 | #2-56,#50,#49 52 | #2-64,#50,#48 53 | #3-48,#47,#44 54 | #3-56,#45,#43 55 | #4-40,#43,#41 56 | #4-48,#42,#40 57 | #5-40,#38,7/64 58 | #5-44,#37,#35 59 | #6-32,#36,#32 60 | #6-40,#33,#31 61 | #8-32,#29,#27 62 | #8-36,#29,#26 63 | #10-24,#25,#20 64 | #10-32,#21,#18 65 | #12-24,#16,#12 66 | #12-28,#14,#10 67 | #12-32,#13,#9 68 | 1/4-20,#7,7/32 69 | 1/4-28,#3,#1 70 | 1/4-32,7/32,#1 71 | 5/16-18,F,J 72 | 5/16-24,I,9/32 73 | 5/16-32,9/32,L 74 | 3/8-16,5/16,Q 75 | 3/8-24,Q,S 76 | 3/8-32,11/32,T 77 | 7/16-14,U,25/64 78 | 7/16-20,25/64,13/32 79 | 7/16-28,Y,Z 80 | 1/2-13,27/64,29/64 81 | 1/2-20,29/64,15/32 82 | 1/2-28,15/32,15/32 83 | 9/16-12,31/64,33/64 84 | 9/16-18,33/64,17/32 85 | 9/16-24,33/64,17/32 86 | 5/8-11,17/32,9/16 87 | 5/8-18,37/64,19/32 88 | 5/8-24,37/64,19/32 89 | 11/16-24,41/64,21/32 90 | 3/4-10,21/32,11/16 91 | 3/4-16,11/16,45/64 92 | 3/4-20,45/64,23/32 93 | 13/16-20,49/64,25/32 94 | 7/8-9,49/64,51/64 95 | 7/8-14,13/16,53/64 96 | 7/8-20,53/64,27/32 97 | 15/16-20,57/64,29/32 98 | 1-8,7/8,59/64 99 | 1-12,15/16,61/64 100 | 1-20,61/64,31/32 101 | -------------------------------------------------------------------------------- /src/bd_warehouse/data/unchamfered_hex_nut_parameters.csv: -------------------------------------------------------------------------------- 1 | Size,iso4036:m,iso4036:s 2 | M1.6-0.35,1,3.2 3 | M2-0.4,1.2,4 4 | M2.5-0.45,1.6,5 5 | M3-0.5,1.8,5.5 6 | M3.5-0.6,2,6 7 | M4-0.7,2.2,7 8 | M5-0.8,2.7,8 9 | M6-1,3.2,10 10 | M8-1.25,4,13 11 | M10-1.5,5,16 12 | -------------------------------------------------------------------------------- /src/bd_warehouse/gear.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | Gears - parametric, involute gears of all types 4 | 5 | name: gear.py 6 | by: Gumyr 7 | date: July 14nd 2024 8 | 9 | This module can be used to create a wide variety of involute spur gears, 10 | either standard ISO (metric) or fully custom. Involute gears have 11 | the property of continually meshing at a specific angle (the pressure angle) 12 | thus avoiding the stutter of non-involute gears as the teeth lose 13 | contact with each other. Imagine a telescope mount: involute gears would 14 | allow the telescope to smoothly follow a star as it moves across the night 15 | sky, while non-involute gears would introduce a shake that would blur the 16 | image of a long exposure. 17 | 18 | Gears are art pieces unless they mesh with each other. To ensure two 19 | gears can mesh, follow these guidelines: 20 | - Meshing gears need the same tooth shape and size, so use a common 21 | module (for metric gears) or diametral pitch value (for imperial gears). 22 | For fully custom gears, the base, pitch and outer radii will all 23 | need to be calculated appropriately. 24 | - When positioning two gears to mesh, they need to be separated by the 25 | sum of their pitch radii. For ISO metric gears this is very easy to 26 | do - simply multiply the gear module by the sum of the tooth count and 27 | divide by two (in mm), or: separation = module*(n0 + n1)/2 [mm] 28 | 29 | license: 30 | 31 | Copyright 2024 Gumyr 32 | 33 | Licensed under the Apache License, Version 2.0 (the "License"); 34 | you may not use this file except in compliance with the License. 35 | You may obtain a copy of the License at 36 | 37 | http://www.apache.org/licenses/LICENSE-2.0 38 | 39 | Unless required by applicable law or agreed to in writing, software 40 | distributed under the License is distributed on an "AS IS" BASIS, 41 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 42 | See the License for the specific language governing permissions and 43 | limitations under the License. 44 | """ 45 | 46 | from math import sin, cos, tan, acos, radians, degrees 47 | from typing import Optional, Union 48 | from build123d import * 49 | from OCP.StdFail import StdFail_NotDone 50 | 51 | 52 | class InvoluteToothProfile(BaseLineObject): 53 | """InvoluteToothProfile 54 | 55 | The outline of a single involute tooth. 56 | 57 | Args: 58 | module (float): the ratio of the pitch diameter to the number of teeth and 59 | is expressed in millimeters (mm) 60 | tooth_count (int): number of teeth in complete gear 61 | pressure_angle (float): the angle between the line of action (the line along 62 | which the force is transmitted between meshing gear teeth) and the tangent 63 | to the pitch circle. Common values are 14.5 or 20. 64 | root_fillet (float): radius of the fillet at the root of the tooth 65 | addendum (float, optional): the radial distance between the pitch circle and 66 | the top of the gear tooth. Defaults to None (calculated). 67 | dedendum (float, optional): the radial distance between the pitch circle and 68 | the bottom of the gear tooth space. It defines the depth of the space 69 | between gear teeth below the pitch circle. Defaults to None (calculated). 70 | closed (bool, optional): create a closed wire. Defaults to False. 71 | mode (Mode, optional): combination mode. Defaults to Mode.ADD. 72 | """ 73 | 74 | _applies_to = [BuildLine._tag] 75 | 76 | def __init__( 77 | self, 78 | module: float, 79 | tooth_count: int, 80 | pressure_angle: float, 81 | root_fillet: Optional[float] = None, 82 | addendum: Optional[float] = None, 83 | dedendum: Optional[float] = None, 84 | closed: bool = False, 85 | mode: Mode = Mode.ADD, 86 | ): 87 | self.module = module 88 | self.tooth_count = tooth_count 89 | self.pitch_radius = module * tooth_count / 2 90 | self.base_radius = self.pitch_radius * cos(radians(pressure_angle)) 91 | self.addendum = addendum if addendum is not None else module 92 | self.addendum_radius = self.pitch_radius + self.addendum 93 | self.dedendum = dedendum if dedendum is not None else 1.25 * module 94 | self.root_radius = self.pitch_radius - self.dedendum 95 | half_thick_angle = 90 / tooth_count 96 | half_pitch_angle = half_thick_angle + degrees( 97 | tan(radians(pressure_angle)) - radians(pressure_angle) 98 | ) 99 | # # Create the involute curve points 100 | involute_size = self.addendum_radius - self.base_radius 101 | pnts = [] 102 | for i in range(11): 103 | r = self.base_radius + involute_size * i / 10 104 | α = acos(self.base_radius / r) # in radians 105 | involute = tan(α) - α 106 | if (rp := r * cos(involute)) > self.root_radius: 107 | pnts.append((rp, r * sin(involute))) 108 | 109 | with BuildLine(Plane.XY.rotated((0, 0, -half_pitch_angle))) as tooth: 110 | l1 = Spline(*pnts) 111 | l2 = Line(pnts[0], (self.root_radius, 0)) 112 | root = RadiusArc( 113 | l2 @ 1, 114 | Vector(self.root_radius, 0).rotate(Axis.Z, -2 * half_thick_angle), 115 | self.root_radius, 116 | ) 117 | top_land = RadiusArc( 118 | l1 @ 1, 119 | Vector(self.addendum_radius, 0), 120 | -self.addendum_radius, 121 | ) 122 | if root_fillet is not None: 123 | try: 124 | fillet(tooth.vertices().sort_by(Axis.X)[1], root_fillet) 125 | except StdFail_NotDone as err: 126 | raise ValueError( 127 | "Invalid root radius, try a smaller value" 128 | ) from err 129 | 130 | mirror(about=Plane.XZ) 131 | 132 | close = ( 133 | [ 134 | Edge.make_line( 135 | tooth.vertices().sort_by(Axis.Y)[-1].to_tuple(), 136 | tooth.vertices().sort_by(Axis.Y)[0].to_tuple(), 137 | ) 138 | ] 139 | if closed 140 | else [] 141 | ) 142 | 143 | super().__init__(Wire(tooth.edges() + close), mode=mode) 144 | 145 | 146 | class SpurGearPlan(BaseSketchObject): 147 | """InvoluteToothProfile 148 | 149 | The 2D plan of the gear. 150 | 151 | Args: 152 | module (float): the ratio of the pitch diameter to the number of teeth and 153 | is expressed in millimeters (mm) 154 | tooth_count (int): number of teeth in complete gear 155 | pressure_angle (float): the angle between the line of action (the line along 156 | which the force is transmitted between meshing gear teeth) and the tangent 157 | to the pitch circle. Common values are 14.5 or 20. 158 | root_fillet (float): radius of the fillet at the root of the tooth 159 | addendum (float, optional): the radial distance between the pitch circle and 160 | the top of the gear tooth. Defaults to None (calculated). 161 | dedendum (float, optional): the radial distance between the pitch circle and 162 | the bottom of the gear tooth space. It defines the depth of the space 163 | between gear teeth below the pitch circle. Defaults to None (calculated). 164 | closed (bool, optional): create a closed wire. Defaults to False. 165 | align (Union[None, Align, tuple[Align, Align]], optional): align min, center, 166 | or max of object. Defaults to (Align.CENTER, Align.CENTER). 167 | mode (Mode, optional): combination mode. Defaults to Mode.ADD. 168 | """ 169 | 170 | _applies_to = [BuildSketch._tag] 171 | 172 | def __init__( 173 | self, 174 | module: float, 175 | tooth_count: int, 176 | pressure_angle: float, 177 | root_fillet: Optional[float] = None, 178 | addendum: Optional[float] = None, 179 | dedendum: Optional[float] = None, 180 | rotation: float = 0, 181 | align: Union[Align, tuple[Align, Align]] = (Align.CENTER, Align.CENTER), 182 | mode: Mode = Mode.ADD, 183 | ): 184 | gear_tooth = InvoluteToothProfile( 185 | module, tooth_count, pressure_angle, root_fillet, addendum, dedendum 186 | ) 187 | self.pitch_radius = gear_tooth.pitch_radius 188 | self.base_radius = gear_tooth.base_radius 189 | self.addendum_radius = gear_tooth.addendum_radius 190 | self.root_radius = gear_tooth.root_radius 191 | if self.base_radius < self.root_radius: 192 | raise ValueError("Invalid configuration, try changing the pressure angle") 193 | gear_teeth = PolarLocations(0, tooth_count) * gear_tooth 194 | gear_wire = Wire([e for tooth in gear_teeth for e in tooth.edges()]) 195 | gear_face = Face(gear_wire) 196 | if gear_face.normal_at().Z < 0: 197 | gear_face = -gear_face 198 | super().__init__(gear_face, rotation, align, mode) 199 | 200 | 201 | class SpurGear(BasePartObject): 202 | """InvoluteToothProfile 203 | 204 | The 3D representation of the gear. 205 | 206 | Args: 207 | module (float): the ratio of the pitch diameter to the number of teeth and 208 | is expressed in millimeters (mm) 209 | tooth_count (int): number of teeth in complete gear 210 | pressure_angle (float): the angle between the line of action (the line along 211 | which the force is transmitted between meshing gear teeth) and the tangent 212 | to the pitch circle. Common values are 14.5 or 20. 213 | root_fillet (float): radius of the fillet at the root of the tooth 214 | thickness (float): gear thickness 215 | addendum (float, optional): the radial distance between the pitch circle and 216 | the top of the gear tooth. Defaults to None (calculated). 217 | dedendum (float, optional): the radial distance between the pitch circle and 218 | the bottom of the gear tooth space. It defines the depth of the space 219 | between gear teeth below the pitch circle. Defaults to None (calculated). 220 | closed (bool, optional): create a closed wire. Defaults to False. 221 | align (Union[None, Align, tuple[Align, Align, Align]], optional): align min, 222 | center, or max of object. Defaults to Align.CENTER. 223 | mode (Mode, optional): combination mode. Defaults to Mode.ADD. 224 | """ 225 | 226 | _applies_to = [BuildPart._tag] 227 | 228 | def __init__( 229 | self, 230 | module: float, 231 | tooth_count: int, 232 | pressure_angle: float, 233 | thickness: float, 234 | root_fillet: Optional[float] = None, 235 | addendum: Optional[float] = None, 236 | dedendum: Optional[float] = None, 237 | rotation: RotationLike = (0, 0, 0), 238 | align: Union[None, Align, tuple[Align, Align, Align]] = Align.CENTER, 239 | mode: Mode = Mode.ADD, 240 | ): 241 | gear_plan = SpurGearPlan( 242 | module, tooth_count, pressure_angle, root_fillet, addendum, dedendum 243 | ) 244 | self.pitch_radius = gear_plan.pitch_radius 245 | self.base_radius = gear_plan.base_radius 246 | self.addendum_radius = gear_plan.addendum_radius 247 | self.root_radius = gear_plan.root_radius 248 | super().__init__( 249 | extrude(gear_plan, amount=thickness), 250 | rotation, 251 | align, 252 | mode, 253 | ) 254 | 255 | 256 | if __name__ == "__main__": 257 | # from ocp_vscode import show, set_defaults, Camera 258 | 259 | # set_defaults(reset_camera=Camera.CENTER) 260 | 261 | gear_tooth = InvoluteToothProfile( 262 | module=2, 263 | tooth_count=12, 264 | pressure_angle=14.5, 265 | root_fillet=0.5 * MM, 266 | ) 267 | 268 | gear_profile = SpurGearPlan( 269 | module=2, 270 | tooth_count=12, 271 | pressure_angle=14.5, 272 | root_fillet=0.5 * MM, 273 | ) 274 | 275 | spur_gear = SpurGear( 276 | module=2, 277 | tooth_count=12, 278 | pressure_angle=14.5, 279 | root_fillet=0.5 * MM, 280 | thickness=5 * MM, 281 | ) 282 | # show(pack([gear_tooth, gear_profile, spur_gear], 5)) 283 | -------------------------------------------------------------------------------- /src/bd_warehouse/pipe.csv: -------------------------------------------------------------------------------- 1 | nps,material,identifier,od,thickness 2 | 1/8,stainless,10S,0.405,0.049 3 | 1/8,iron,STD,0.405,0.068 4 | 1/8,steel,40,0.405,0.068 5 | 1/8,stainless,40S,0.405,0.068 6 | 1/8,iron,XS,0.405,0.095 7 | 1/8,steel,80,0.405,0.095 8 | 1/8,stainless,80S,0.405,0.095 9 | 1/4,stainless,10S,0.54,0.065 10 | 1/4,iron,STD,0.54,0.088 11 | 1/4,steel,40,0.54,0.088 12 | 1/4,stainless,40S,0.54,0.088 13 | 1/4,iron,XS,0.54,0.119 14 | 1/4,steel,80,0.54,0.119 15 | 1/4,stainless,80S,0.54,0.119 16 | 3/8,stainless,10S,0.675,0.065 17 | 3/8,iron,STD,0.675,0.091 18 | 3/8,steel,40,0.675,0.091 19 | 3/8,stainless,40S,0.675,0.091 20 | 3/8,iron,XS,0.675,0.126 21 | 3/8,steel,80,0.675,0.126 22 | 3/8,stainless,80S,0.675,0.126 23 | 1/2,stainless,5S,0.84,0.065 24 | 1/2,stainless,10S,0.84,0.083 25 | 1/2,iron,STD,0.84,0.109 26 | 1/2,steel,40,0.84,0.109 27 | 1/2,stainless,40S,0.84,0.109 28 | 1/2,iron,XS,0.84,0.147 29 | 1/2,steel,80,0.84,0.147 30 | 1/2,stainless,80S,0.84,0.147 31 | 1/2,steel,160,0.84,0.187 32 | 1/2,iron,XXS,0.84,0.294 33 | 3/4,stainless,5S,1.05,0.065 34 | 3/4,stainless,10S,1.05,0.083 35 | 3/4,iron,STD,1.05,0.113 36 | 3/4,steel,40,1.05,0.113 37 | 3/4,stainless,40S,1.05,0.113 38 | 3/4,iron,XS,1.05,0.154 39 | 3/4,steel,80,1.05,0.154 40 | 3/4,stainless,80S,1.05,0.154 41 | 3/4,steel,160,1.05,0.219 42 | 3/4,iron,XXS,1.05,0.308 43 | 1,stainless,5S,1.315,0.065 44 | 1,stainless,10S,1.315,0.109 45 | 1,iron,STD,1.315,0.133 46 | 1,steel,40,1.315,0.133 47 | 1,stainless,40S,1.315,0.133 48 | 1,iron,XS,1.315,0.179 49 | 1,steel,80,1.315,0.179 50 | 1,stainless,80S,1.315,0.179 51 | 1,steel,160,1.315,0.25 52 | 1,iron,XXS,1.315,0.358 53 | 1 1/4,stainless,5S,1.66,0.065 54 | 1 1/4,stainless,10S,1.66,0.109 55 | 1 1/4,iron,STD,1.66,0.14 56 | 1 1/4,steel,40,1.66,0.14 57 | 1 1/4,stainless,40S,1.66,0.14 58 | 1 1/4,iron,XS,1.66,0.191 59 | 1 1/4,steel,80,1.66,0.191 60 | 1 1/4,stainless,80S,1.66,0.191 61 | 1 1/4,steel,160,1.66,0.25 62 | 1 1/4,iron,XXS,1.66,0.382 63 | 1 1/2,stainless,5S,1.9,0.065 64 | 1 1/2,stainless,10S,1.9,0.109 65 | 1 1/2,iron,STD,1.9,0.145 66 | 1 1/2,steel,40,1.9,0.145 67 | 1 1/2,stainless,40S,1.9,0.145 68 | 1 1/2,iron,XS,1.9,0.2 69 | 1 1/2,steel,80,1.9,0.2 70 | 1 1/2,stainless,80S,1.9,0.2 71 | 1 1/2,steel,160,1.9,0.281 72 | 1 1/2,iron,XXS,1.9,0.4 73 | 2,stainless,5S,2.375,0.065 74 | 2,stainless,10S,2.375,0.109 75 | 2,iron,STD,2.375,0.154 76 | 2,steel,40,2.375,0.154 77 | 2,stainless,40S,2.375,0.154 78 | 2,iron,XS,2.375,0.218 79 | 2,steel,80,2.375,0.218 80 | 2,stainless,80S,2.375,0.218 81 | 2,steel,160,2.375,0.344 82 | 2,iron,XXS,2.375,0.436 83 | 2 1/2,stainless,5S,2.875,0.083 84 | 2 1/2,stainless,10S,2.875,0.12 85 | 2 1/2,iron,STD,2.875,0.203 86 | 2 1/2,steel,40,2.875,0.203 87 | 2 1/2,stainless,40S,2.875,0.203 88 | 2 1/2,iron,XS,2.875,0.276 89 | 2 1/2,steel,80,2.875,0.276 90 | 2 1/2,stainless,80S,2.875,0.276 91 | 2 1/2,steel,160,2.875,0.375 92 | 2 1/2,iron,XXS,2.875,0.552 93 | 3,stainless,5S,3.5,0.083 94 | 3,stainless,10S,3.5,0.12 95 | 3,iron,STD,3.5,0.216 96 | 3,steel,40,3.5,0.216 97 | 3,stainless,40S,3.5,0.216 98 | 3,iron,XS,3.5,0.3 99 | 3,steel,80,3.5,0.3 100 | 3,stainless,80S,3.5,0.3 101 | 3,steel,160,3.5,0.438 102 | 3,iron,XXS,3.5,0.6 103 | 3 1/2,stainless,5S,4.0,0.083 104 | 3 1/2,stainless,10S,4.0,0.12 105 | 3 1/2,iron,STD,4.0,0.226 106 | 3 1/2,steel,40,4.0,0.226 107 | 3 1/2,stainless,40S,4.0,0.226 108 | 3 1/2,iron,XS,4.0,0.318 109 | 3 1/2,steel,80,4.0,0.318 110 | 3 1/2,stainless,80S,4.0,0.318 111 | 4,stainless,5S,4.5,0.083 112 | 4,stainless,10S,4.5,0.12 113 | 4,iron,STD,4.5,0.237 114 | 4,steel,40,4.5,0.237 115 | 4,stainless,40S,4.5,0.237 116 | 4,iron,XS,4.5,0.337 117 | 4,steel,80,4.5,0.337 118 | 4,stainless,80S,4.5,0.337 119 | 4,steel,120,4.5,0.438 120 | 4,steel,160,4.5,0.531 121 | 4,iron,XXS,4.5,0.674 122 | 5,stainless,5S,5.563,0.109 123 | 5,stainless,10S,5.563,0.134 124 | 5,iron,STD,5.563,0.258 125 | 5,steel,40,5.563,0.258 126 | 5,stainless,40S,5.563,0.258 127 | 5,iron,XS,5.563,0.375 128 | 5,steel,80,5.563,0.375 129 | 5,stainless,80S,5.563,0.375 130 | 5,steel,120,5.563,0.5 131 | 5,steel,160,5.563,0.625 132 | 5,iron,XXS,5.563,0.75 133 | 6,stainless,5S,6.625,0.109 134 | 6,stainless,10S,6.625,0.134 135 | 6,iron,STD,6.625,0.28 136 | 6,steel,40,6.625,0.28 137 | 6,stainless,40S,6.625,0.28 138 | 6,iron,XS,6.625,0.432 139 | 6,steel,80,6.625,0.432 140 | 6,stainless,80S,6.625,0.432 141 | 6,steel,120,6.625,0.562 142 | 6,steel,160,6.625,0.718 143 | 6,iron,XXS,6.625,0.864 144 | 8,stainless,5S,8.625,0.109 145 | 8,stainless,10S,8.625,0.148 146 | 8,steel,20,8.625,0.25 147 | 8,steel,30,8.625,0.277 148 | 8,iron,STD,8.625,0.322 149 | 8,steel,40,8.625,0.322 150 | 8,stainless,40S,8.625,0.322 151 | 8,steel,60,8.625,0.406 152 | 8,iron,XS,8.625,0.5 153 | 8,steel,80,8.625,0.5 154 | 8,stainless,80S,8.625,0.5 155 | 8,steel,100,8.625,0.594 156 | 8,steel,120,8.625,0.719 157 | 8,steel,140,8.625,0.812 158 | 8,iron,XXS,8.625,0.875 159 | 8,steel,160,8.625,0.906 160 | 10,stainless,5S,10.75,0.134 161 | 10,stainless,10S,10.75,0.165 162 | 10,steel,20,10.75,0.25 163 | 10,steel,30,10.75,0.307 164 | 10,iron,STD,10.75,0.365 165 | 10,steel,40,10.75,0.365 166 | 10,stainless,40S,10.75,0.365 167 | 10,iron,XS,10.75,0.5 168 | 10,steel,60,10.75,0.5 169 | 10,stainless,80S,10.75,0.5 170 | 10,steel,80,10.75,0.594 171 | 10,steel,100,10.75,0.719 172 | 10,steel,120,10.75,0.844 173 | 10,steel,140,10.75,1.0 174 | 10,steel,160,10.75,1.125 175 | 12,stainless,5S,12.75,0.156 176 | 12,stainless,10S,12.75,0.18 177 | 12,steel,20,12.75,0.25 178 | 12,steel,30,12.75,0.33 179 | 12,iron,STD,12.75,0.375 180 | 12,stainless,40S,12.75,0.375 181 | 12,steel,40,12.75,0.406 182 | 12,iron,XS,12.75,0.5 183 | 12,stainless,80S,12.75,0.5 184 | 12,steel,60,12.75,0.562 185 | 12,steel,80,12.75,0.688 186 | 12,steel,100,12.75,0.844 187 | 12,steel,120,12.75,1.0 188 | 12,steel,140,12.75,1.125 189 | 12,steel,160,12.75,1.312 190 | 14,stainless,5S,14.0,156.0 191 | 14,stainless,10S,14.0,0.188 192 | 14,steel,10,14.0,0.25 193 | 14,steel,20,14.0,0.312 194 | 14,iron,STD,14.0,0.375 195 | 14,steel,30,14.0,0.375 196 | 14,steel,40,14.0,0.438 197 | 14,iron,XS,14.0,0.5 198 | 14,steel,60,14.0,0.594 199 | 14,steel,80,14.0,0.75 200 | 14,steel,100,14.0,0.938 201 | 14,steel,120,14.0,1.094 202 | 14,steel,140,14.0,1.25 203 | 14,steel,160,14.0,1.406 204 | 16,stainless,5S,16.0,0.165 205 | 16,stainless,10S,16.0,0.188 206 | 16,steel,10,16.0,0.25 207 | 16,steel,20,16.0,0.312 208 | 16,iron,STD,16.0,0.375 209 | 16,steel,30,16.0,0.375 210 | 16,iron,XS,16.0,0.5 211 | 16,steel,40,16.0,0.5 212 | 16,steel,60,16.0,0.656 213 | 16,steel,80,16.0,0.844 214 | 16,steel,100,16.0,1.031 215 | 16,steel,120,16.0,1.219 216 | 16,steel,140,16.0,1.438 217 | 16,steel,160,16.0,1.594 218 | 18,stainless,5S,18.0,0.165 219 | 18,stainless,10S,18.0,0.188 220 | 18,steel,10,18.0,0.25 221 | 18,stainless,,18.0,0.25 222 | 18,steel,20,18.0,0.312 223 | 18,stainless,,18.0,0.312 224 | 18,iron,STD,18.0,0.375 225 | 18,steel,30,18.0,0.438 226 | 18,iron,XS,18.0,0.5 227 | 18,steel,40,18.0,0.562 228 | 18,steel,60,18.0,0.75 229 | 18,steel,80,18.0,0.938 230 | 18,steel,100,18.0,1.156 231 | 18,steel,120,18.0,1.375 232 | 18,steel,140,18.0,1.562 233 | 18,steel,160,18.0,1.781 234 | 20,stainless,5S,20.0,0.188 235 | 20,stainless,10S,20.0,0.218 236 | 20,steel,10,20.0,0.25 237 | 20,iron,STD,20.0,0.375 238 | 20,steel,20,20.0,0.375 239 | 20,iron,XS,20.0,0.5 240 | 20,steel,30,20.0,0.5 241 | 20,steel,40,20.0,0.594 242 | 20,steel,60,20.0,0.812 243 | 20,steel,80,20.0,1.031 244 | 20,steel,100,20.0,1.281 245 | 20,steel,120,20.0,1.5 246 | 20,steel,140,20.0,1.75 247 | 20,steel,160,20.0,1.969 248 | 22,stainless,5S,22.0,0.188 249 | 22,stainless,10S,22.0,0.218 250 | 22,steel,10,22.0,0.25 251 | 22,iron,STD,22.0,0.375 252 | 22,steel,20,22.0,0.375 253 | 22,iron,XS,22.0,0.5 254 | 22,steel,30,22.0,0.5 255 | 22,steel,60,22.0,0.875 256 | 22,steel,80,22.0,1.125 257 | 22,steel,100,22.0,1.375 258 | 22,steel,120,22.0,1.625 259 | 22,steel,140,22.0,1.875 260 | 22,steel,160,22.0,2.125 261 | 24,stainless,5S,24.0,0.218 262 | 24,steel,10,24.0,0.25 263 | 24,stainless,10S,24.0,0.25 264 | 24,iron,STD,24.0,0.375 265 | 24,steel,20,24.0,0.375 266 | 24,iron,XS,24.0,0.5 267 | 24,steel,30,24.0,0.562 268 | 24,steel,40,24.0,0.688 269 | 24,steel,60,24.0,0.969 270 | 24,steel,80,24.0,1.219 271 | 24,steel,100,24.0,1.531 272 | 24,steel,120,24.0,1.812 273 | 24,steel,140,24.0,2.062 274 | 24,steel,160,24.0,2.344 275 | 26,steel,10,26.0,0.312 276 | 26,iron,STD,26.0,0.375 277 | 26,iron,XS,26.0,0.5 278 | 26,steel,20,26.0,0.5 279 | 28,steel,10,28.0,0.312 280 | 28,iron,STD,28.0,0.375 281 | 28,iron,XS,28.0,0.5 282 | 28,steel,20,28.0,0.5 283 | 28,steel,30,28.0,0.625 284 | 30,stainless,5S,30.0,0.25 285 | 30,steel,10,30.0,0.312 286 | 30,stainless,10S,30.0,0.312 287 | 30,iron,STD,30.0,0.375 288 | 30,iron,XS,30.0,0.5 289 | 30,steel,20,30.0,0.5 290 | 30,steel,30,30.0,0.625 291 | 32,steel,10,32.0,0.312 292 | 32,iron,STD,32.0,0.375 293 | 32,iron,XS,32.0,0.5 294 | 32,steel,20,32.0,0.5 295 | 32,steel,30,32.0,0.625 296 | 32,steel,40,32.0,0.688 297 | 34,steel,10,34.0,0.344 298 | 34,iron,STD,34.0,0.375 299 | 34,iron,XS,34.0,0.5 300 | 34,steel,20,34.0,0.5 301 | 34,steel,30,34.0,0.625 302 | 34,steel,40,34.0,0.688 303 | 36,steel,10,36.0,0.312 304 | 36,iron,STD,36.0,0.375 305 | 36,iron,XS,36.0,0.5 306 | 36,steel,20,36.0,0.5 307 | 36,steel,30,36.0,0.625 308 | 36,steel,40,36.0,0.75 309 | 42,iron,STD,42.0,0.375 310 | 42,iron,XS,42.0,0.5 311 | 42,steel,20,42.0,0.5 312 | 42,steel,30,42.0,0.625 313 | 42,steel,40,42.0,0.75 314 | 1/4,copper,K,0.375,0.035 315 | 1/4,copper,L,0.375,0.03 316 | 3/8,copper,K,0.5,0.049 317 | 3/8,copper,L,0.5,0.035 318 | 3/8,copper,M,0.5,0.025 319 | 1/2,copper,K,0.625,0.049 320 | 1/2,copper,L,0.625,0.04 321 | 1/2,copper,M,0.625,0.028 322 | 5/8,copper,K,0.75,0.049 323 | 5/8,copper,L,0.75,0.042 324 | 3/4,copper,K,0.875,0.065 325 | 3/4,copper,L,0.875,0.045 326 | 3/4,copper,M,0.875,0.032 327 | 1,copper,K,1.125,0.065 328 | 1,copper,L,1.125,0.05 329 | 1,copper,M,1.125,0.035 330 | 1 1/4,copper,K,1.375,0.065 331 | 1 1/4,copper,L,1.375,0.055 332 | 1 1/4,copper,M,1.375,0.042 333 | 1 1/2,copper,K,1.625,0.072 334 | 1 1/2,copper,L,1.625,0.06 335 | 1 1/2,copper,M,1.625,0.049 336 | 2,copper,K,2.125,0.083 337 | 2,copper,L,2.125,0.07 338 | 2,copper,M,2.125,0.058 339 | 2 1/2,copper,K,2.625,0.095 340 | 2 1/2,copper,L,2.625,0.08 341 | 2 1/2,copper,M,2.625,0.065 342 | 3,copper,K,3.125,0.109 343 | 3,copper,L,3.125,0.09 344 | 3,copper,M,3.125,0.072 345 | 3 1/2,copper,K,3.625,0.12 346 | 3 1/2,copper,L,3.625,0.1 347 | 3 1/2,copper,M,3.625,0.083 348 | 4,copper,K,4.125,0.134 349 | 4,copper,L,4.125,0.11 350 | 4,copper,M,4.125,0.095 351 | 5,copper,K,5.125,0.16 352 | 5,copper,L,5.125,0.125 353 | 5,copper,M,5.125,0.109 354 | 6,copper,K,6.125,0.192 355 | 6,copper,L,6.125,0.14 356 | 6,copper,M,6.125,0.122 357 | 8,copper,K,8.125,0.271 358 | 8,copper,L,8.125,0.2 359 | 8,copper,M,8.125,0.17 360 | 10,copper,K,10.125,0.338 361 | 10,copper,L,10.125,0.25 362 | 10,copper,M,10.125,0.212 363 | 12,copper,K,12.125,0.405 364 | 12,copper,L,12.125,0.28 365 | 12,copper,M,12.125,0.254 366 | 1 1/4,abs,40,1.660,0.140 367 | 1 1/2,abs,40,1.900,0.145 368 | 2,abs,40,2.375,0.154 369 | 3,abs,40,3.500,0.216 370 | 4,abs,40,4.500,0.237 371 | 6,abs,40,6.625,0.280 372 | 1/2,pvc,40,0.840,0.109 373 | 1/2,pvc,80,0.840,0.147 374 | 3/4,pvc,40,1.050,0.113 375 | 3/4,pvc,80,1.050,0.154 376 | 1,pvc,40,1.315,0.133 377 | 1,pvc,80,1.315,0.179 378 | 1 1/4,pvc,40,1.660,0.140 379 | 1 1/4,pvc,80,1.660,0.191 380 | 1 1/2,pvc,40,1.900,0.145 381 | 1 1/2,pvc,80,1.900,0.200 382 | 2,pvc,40,2.375,0.154 383 | 2,pvc,80,2.375,0.218 384 | 2 1/2,pvc,40,2.875,0.203 385 | 2 1/2,pvc,80,2.875,0.276 386 | 3,pvc,40,3.500,0.216 387 | 3,pvc,80,3.500,0.300 388 | 4,pvc,40,4.500,0.237 389 | 4,pvc,80,4.500,0.337 390 | 5,pvc,40,5.563,0.258 391 | 5,pvc,80,5.563,0.375 392 | 6,pvc,40,6.625,0.280 393 | 6,pvc,80,6.625,0.432 394 | 8,pvc,40,8.625,0.322 395 | 8,pvc,80,8.625,0.500 396 | 10,pvc,40,10.750,0.365 397 | 10,pvc,80,10.750,0.593 398 | 12,pvc,40,12.750,0.406 399 | 12,pvc,80,12.750,0.687 400 | 14,pvc,40,14.000,0.437 401 | 16,pvc,40,16.000,0.500 402 | 18,pvc,40,18.000,0.562 403 | 20,pvc,40,20.000,0.593 404 | 24,pvc,40,24.000,0.687 405 | -------------------------------------------------------------------------------- /src/bd_warehouse/pipe.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | Pipes 4 | 5 | name: pipe.py 6 | by: Gumyr 7 | date: May 23, 2023 8 | 9 | desc: 10 | This python module is a CAD library of parametric pipes. 11 | 12 | The pipes created by this package are based off the following standards: 13 | 14 | * ASTM A312 is a standard specification issued by the American Society for 15 | Testing and Materials (ASTM) that covers seamless, welded, and heavily 16 | cold-worked austenitic stainless steel pipe intended for high-temperature 17 | and general corrosive service. The standard specifies various dimensions, 18 | mechanical properties, testing requirements, and acceptable manufacturing 19 | practices for stainless steel pipes. 20 | * ASME B36 is a standard issued by the American Society of Mechanical Engineers 21 | (ASME) that provides guidelines for the dimensions, tolerances, and related 22 | requirements of steel pipes and fittings. It covers both seamless and welded 23 | pipes made from various materials, including carbon steel, stainless steel, 24 | and alloy steel. The standard specifies the nominal pipe sizes (NPS), outside 25 | diameters (OD), wall thicknesses, and length dimensions. ASME B36 aims to ensure 26 | consistency and compatibility in the design, manufacturing, and installation of 27 | steel pipes, facilitating efficient piping system construction and operation in 28 | various industries. 29 | * ASTM B88 is a standard specification issued by ASTM International for seamless 30 | copper water tube used in plumbing applications. The standard defines the requirements 31 | for copper water tube in terms of its dimensions, chemical composition, mechanical 32 | properties, and permissible variations. It covers various sizes and types of copper 33 | water tube, including both hard-drawn and annealed tempers. ASTM B88 ensures the 34 | quality and reliability of copper water tube by providing specifications for its 35 | manufacturing and performance. It serves as a reference for manufacturers, engineers, 36 | and contractors involved in plumbing systems, ensuring compatibility, durability, 37 | and safe water transportation. 38 | * ASTM F628 is a standard specification issued by ASTM International that pertains 39 | to the installation and performance requirements of plastic pipes in non-pressure 40 | applications. It specifically focuses on the installation of plastic pipes, such 41 | as PVC (Polyvinyl Chloride) and CPVC (Chlorinated Polyvinyl Chloride), for drainage, 42 | waste, and vent systems. The standard covers various aspects, including pipe sizes, 43 | materials, dimensions, joint methods, and testing procedures. ASTM F628 ensures the 44 | proper installation and performance of plastic pipes in non-pressure plumbing 45 | applications, promoting safe and efficient drainage and waste disposal systems in 46 | residential and commercial buildings. 47 | * ASTM D1785 is a standard specification issued by ASTM International for rigid 48 | polyvinyl chloride (PVC) pipes used in pressure applications, primarily in potable 49 | water systems. The standard outlines the requirements for PVC pipes in terms of 50 | their dimensions, material properties, and quality control procedures. It covers 51 | various aspects, including pipe sizes, wall thicknesses, chemical composition, 52 | hydrostatic pressure testing, and marking. ASTM D1785 ensures the durability, 53 | strength, and safety of PVC pipes by establishing guidelines for their manufacturing, 54 | performance, and testing. The standard serves as a reference for manufacturers, 55 | engineers, and regulatory bodies to ensure the reliable and efficient use of PVC 56 | pipes in pressure applications. 57 | 58 | license: 59 | 60 | Copyright 2023 Gumyr 61 | 62 | Licensed under the Apache License, Version 2.0 (the "License"); 63 | you may not use this file except in compliance with the License. 64 | You may obtain a copy of the License at 65 | 66 | http://www.apache.org/licenses/LICENSE-2.0 67 | 68 | Unless required by applicable law or agreed to in writing, software 69 | distributed under the License is distributed on an "AS IS" BASIS, 70 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 71 | See the License for the specific language governing permissions and 72 | limitations under the License. 73 | 74 | """ 75 | from __future__ import annotations 76 | import csv 77 | import importlib.resources as pkg_resources 78 | from typing import Literal, Union 79 | from build123d import * 80 | from build123d import tuplify 81 | import bd_warehouse 82 | 83 | # fmt: off 84 | Nps = Literal[ 85 | "1/8", "1/4", "3/8", "1/2", "3/4", "1", "1 1/4", "1 1/2", "2", "2 1/2", "3", "4", "5", 86 | "6", "8", "10", "12", "14", "16", "18", "20", "22", "24", "30", "32", "34", "36", "42" 87 | ] 88 | Identifier = Literal[ 89 | "K", "L", "M", "STD", "XS", "XXS", "5S", "10", "10S", "20", "30", "40", "40S", 90 | "60", "80", "80S", "100", "120", "140", "160" 91 | ] 92 | # fmt: on 93 | Material = Literal["abs", "copper", "iron", "pvc", "stainless", "steel"] 94 | 95 | 96 | class PipeSection(BaseSketchObject): 97 | """Pipe Section 98 | 99 | The cross section of a pipe with the given parameters. 100 | 101 | Args: 102 | nps (Nps): nominal pipe size 103 | material (Material, optional): material type. 104 | identifier (Identifier): pipe identifier, i.e. schedule or type 105 | align (Union[None, Align, tuple[Align, Align]], optional): alignment. 106 | Defaults to Align.CENTER. 107 | mode (Mode, optional): combination mode. Defaults to Mode.ADD. 108 | 109 | Raises: 110 | ValueError: Invalid nps 111 | ValueError: Invalid identifier 112 | ValueError: Invalid material 113 | """ 114 | 115 | # Read the pipe data 116 | pipe_data = {} 117 | with pkg_resources.open_text(bd_warehouse, "pipe.csv") as csvfile: 118 | reader = csv.reader(csvfile) 119 | next(reader, None) # skip the header row 120 | for row in reader: 121 | if len(row) == 0: # skip blank rows 122 | continue 123 | nps, material, identifier, od, thickness = row 124 | pipe_data[nps + material + identifier] = (float(od), float(thickness)) 125 | 126 | def __init__( 127 | self, 128 | nps: Nps, 129 | material: Material, 130 | identifier: Identifier, 131 | align: Union[None, Align, tuple[Align, Align]] = Align.CENTER, 132 | mode: Mode = Mode.ADD, 133 | ): 134 | self.nps = nps 135 | self.sch = identifier 136 | self.material = material 137 | 138 | if nps not in Nps.__args__: 139 | raise ValueError( 140 | f"Invalid nps value - the valid values are: {Nps.__args__}" 141 | ) 142 | if identifier not in Identifier.__args__: 143 | raise ValueError( 144 | f"Invalid identifier value - the valid values are: {Identifier.__args__}" 145 | ) 146 | if material not in Material.__args__: 147 | raise ValueError( 148 | f"Invalid material value - the valid values are: {Material.__args__}" 149 | ) 150 | 151 | try: 152 | od_in, thickness_in = PipeSection.pipe_data[nps + material + identifier] 153 | except: 154 | raise ValueError(f"No pipe data for {nps}, {material}, {identifier}") 155 | 156 | self.od = od_in * IN 157 | self.thickness = thickness_in * IN 158 | self.id = self.od - 2 * self.thickness 159 | 160 | with BuildSketch() as cross_section: 161 | Circle(radius=self.od / 2) 162 | Circle(radius=self.id / 2, mode=Mode.SUBTRACT) 163 | 164 | super().__init__(obj=cross_section.sketch, align=tuplify(align, 2), mode=mode) 165 | 166 | 167 | class Pipe(BasePartObject): 168 | """Pipe 169 | 170 | Parametric Pipes of standard sizes and materials with its center 171 | following the provided path parameter. 172 | 173 | Args: 174 | nps (Nps): nominal pipe size 175 | material (Material, optional): material type. 176 | identifier (Identifier): pipe identifier, i.e. schedule or type 177 | path (Union[Edge, Wire]): center line path of the pipe 178 | rotation (RotationLike, optional): rotations about axes. Defaults to (0, 0, 0). 179 | align (Union[NOne, Align, tuple[Align, Align, Align]], optional): alignment. 180 | Defaults to None. 181 | mode (Mode, optional): combination mode. Defaults to Mode.ADD. 182 | 183 | Joints: 184 | "inlet" (Rigid): inlet end of the pipe 185 | "outlet" (Rigid): outlet end of the pipe 186 | """ 187 | 188 | def __init__( 189 | self, 190 | nps: Nps, 191 | material: Material, 192 | identifier: Identifier, 193 | path: Union[None, Edge, Wire] = None, 194 | rotation: RotationLike = (0, 0, 0), 195 | align: Union[None, Align, tuple[Align, Align, Align]] = None, 196 | mode: Mode = Mode.ADD, 197 | ): 198 | context: BuildPart = BuildPart._get_context() 199 | 200 | if path is None: 201 | if context is not None and context.pending_edges: 202 | # Get pending edges for the path 203 | path = context.pending_edges 204 | context.pending_edges = [] 205 | else: 206 | raise ValueError("A path must be provided") 207 | elif isinstance(path, Wire): 208 | path = path.edges() 209 | elif isinstance(path, Edge): 210 | path = [path] 211 | else: 212 | raise ValueError("Invalid path type") 213 | 214 | section = PipeSection(nps, material, identifier) 215 | self.od = section.od 216 | self.id = section.id 217 | self.thickness = section.thickness 218 | self.length = ( 219 | sum([p.length for p in path]) if isinstance(path, list) else path.length 220 | ) 221 | 222 | with BuildPart() as pipe: 223 | for p in path: 224 | add(p) 225 | with BuildSketch(Plane(origin=p @ 0, z_dir=p % 0)): 226 | add(section) 227 | sweep() 228 | 229 | super().__init__( 230 | part=pipe.part, rotation=rotation, align=tuplify(align, 3), mode=mode 231 | ) 232 | self.material = material 233 | 234 | # Add the joints 235 | RigidJoint("inlet", self, Location(Plane(path[0] @ 0, z_dir=-(path[0] % 0)))) 236 | RigidJoint("outlet", self, path[-1].location_at(1)) 237 | -------------------------------------------------------------------------------- /tests/test_bearings.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | Bearing Tests 4 | 5 | name: test_bearings.py 6 | by: Gumyr 7 | date: May 12, 2025 8 | 9 | desc: Basic pytests for the bearing classes. 10 | 11 | license: 12 | 13 | Copyright 2025 Gumyr 14 | 15 | Licensed under the Apache License, Version 2.0 (the "License"); 16 | you may not use this file except in compliance with the License. 17 | You may obtain a copy of the License at 18 | 19 | http://www.apache.org/licenses/LICENSE-2.0 20 | 21 | Unless required by applicable law or agreed to in writing, software 22 | distributed under the License is distributed on an "AS IS" BASIS, 23 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 | See the License for the specific language governing permissions and 25 | limitations under the License. 26 | 27 | """ 28 | 29 | import random 30 | import re 31 | 32 | import pytest 33 | from bd_warehouse.bearing import ( 34 | Bearing, 35 | PressFitHole, 36 | SingleRowDeepGrooveBallBearing, 37 | SingleRowTaperedRollerBearing, 38 | ) 39 | from build123d import Axis, Box, BuildPart, Locations 40 | 41 | 42 | @pytest.mark.parametrize( 43 | "bearing_class, bearing_type, bearing_size", 44 | [ 45 | (bearing_class, bearing_type, bearing_size) 46 | for bearing_class in Bearing.__subclasses__() 47 | for bearing_type in bearing_class.types() 48 | for bearing_size in bearing_class.sizes(bearing_type) 49 | ], 50 | ) 51 | def test_bearings(bearing_class: Bearing, bearing_type: str, bearing_size: str): 52 | bearing: Bearing = bearing_class( 53 | size=bearing_size, 54 | bearing_type=bearing_type, 55 | ) 56 | 57 | # Check that bearing properties are created 58 | assert bearing.roller_diameter > 0 59 | assert bearing.bore_diameter > 0 60 | assert len(bearing.clearance_hole_diameters) > 0 61 | assert len(bearing.info) > 2 62 | assert bearing.length_offset() is not None 63 | 64 | # Check that the bearing is the correct size 65 | bbox_size = bearing.bounding_box().size 66 | _, diameter, thickness = re.match( 67 | r"M(\d+)-([\d\.]+)-([\d\.]+)", bearing_size 68 | ).groups() 69 | assert bbox_size.X == pytest.approx(float(diameter), abs=1e-2) 70 | # The cage may extend past the bottom of the outer race 71 | if bearing_class != SingleRowTaperedRollerBearing: 72 | assert bbox_size.Z == pytest.approx(float(thickness), abs=1e-2) 73 | 74 | # Check that holes can be created 75 | with BuildPart() as hole_tests: 76 | Box(100, 100, 50) 77 | top = hole_tests.faces().sort_by(Axis.Z)[-1] 78 | with Locations(top): 79 | PressFitHole(bearing, fit=random.choice(["Close", "Normal", "Loose"])) 80 | assert hole_tests.part.volume < 100 * 100 * 50 81 | 82 | 83 | if __name__ == "__main__": 84 | test_bearings(SingleRowDeepGrooveBallBearing, "SKT", "M8-22-7") 85 | test_bearings(SingleRowTaperedRollerBearing, "SKT", "M15-42-14.25") 86 | -------------------------------------------------------------------------------- /tests/test_fasteners.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | Fastener Tests 4 | 5 | name: test_fasteners.py 6 | by: Gumyr 7 | date: May 12, 2025 8 | 9 | desc: Basic pytests for the fastener classes. 10 | 11 | license: 12 | 13 | Copyright 2025 Gumyr 14 | 15 | Licensed under the Apache License, Version 2.0 (the "License"); 16 | you may not use this file except in compliance with the License. 17 | You may obtain a copy of the License at 18 | 19 | http://www.apache.org/licenses/LICENSE-2.0 20 | 21 | Unless required by applicable law or agreed to in writing, software 22 | distributed under the License is distributed on an "AS IS" BASIS, 23 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 | See the License for the specific language governing permissions and 25 | limitations under the License. 26 | 27 | """ 28 | 29 | import random 30 | 31 | import pytest 32 | from bd_warehouse.fastener import ( 33 | ClearanceHole, 34 | DomedCapNut, 35 | HeatSetNut, 36 | HexNut, 37 | InsertHole, 38 | Nut, 39 | Screw, 40 | SetScrew, 41 | SocketHeadCapScrew, 42 | SquareNut, 43 | TapHole, 44 | UnchamferedHexagonNut, 45 | Washer, 46 | ) 47 | from build123d import Axis, Box, BuildPart, Locations 48 | 49 | 50 | @pytest.mark.parametrize( 51 | "screw_class, screw_type, screw_size", 52 | [ 53 | (screw_class, screw_type, screw_size) 54 | for screw_size in ["M5-0.8", "1/4-20"] 55 | for screw_class, screw_types in Screw.select_by_size(screw_size).items() 56 | for screw_type in screw_types 57 | ], 58 | ) 59 | def test_screws(screw_class: Screw, screw_type: str, screw_size: str): 60 | screw_min_length = screw_class.nominal_length_range[screw_type][0] 61 | screw: Screw = screw_class( 62 | size=screw_size, 63 | length=screw_min_length, 64 | fastener_type=screw_type, 65 | simple=False, 66 | ) 67 | # Check that screw properties are created 68 | assert len(screw.tap_drill_sizes) > 0 69 | assert len(screw.tap_hole_diameters) > 0 70 | assert len(screw.clearance_drill_sizes) > 0 71 | assert len(screw.clearance_hole_diameters) > 0 72 | assert len(screw.info) > 2 73 | assert screw.length_offset() is not None 74 | if isinstance(screw, SetScrew): 75 | assert screw.min_hole_depth(random.choice([True, False])) == 0 76 | else: 77 | assert screw.min_hole_depth(random.choice([True, False])) > 0 78 | assert len(screw.nominal_lengths) > 0 79 | 80 | # Check that holes can be created 81 | with BuildPart() as hole_tests: 82 | Box(100, 100, screw_min_length) 83 | top = hole_tests.faces().sort_by(Axis.Z)[-1] 84 | with Locations(top): 85 | with Locations((25, 0)): 86 | ClearanceHole(screw) 87 | with Locations((-25, 0)): 88 | TapHole(screw) 89 | assert hole_tests.part.volume < 100 * 100 * screw_min_length 90 | 91 | 92 | @pytest.mark.parametrize( 93 | "nut_class, nut_type, nut_size", 94 | [ 95 | (nut_class, nut_type, nut_size) 96 | for nut_size in ["M5-0.8", "M5-0.8-Standard", "1/4-20"] 97 | for nut_class, nut_types in Nut.select_by_size(nut_size).items() 98 | for nut_type in nut_types 99 | ], 100 | ) 101 | def test_nuts(nut_class: Nut, nut_type: str, nut_size: str): 102 | nut: Nut = nut_class(size=nut_size, fastener_type=nut_type, simple=False) 103 | 104 | # Check that screw properties are created 105 | assert len(nut.tap_drill_sizes) > 0 106 | assert len(nut.tap_hole_diameters) > 0 107 | assert len(nut.clearance_drill_sizes) > 0 108 | assert len(nut.clearance_hole_diameters) > 0 109 | assert len(nut.info) > 2 110 | assert nut.nut_diameter > nut.thread_diameter 111 | assert nut.length_offset() == 0 112 | 113 | if isinstance(nut, (DomedCapNut, HexNut, UnchamferedHexagonNut, SquareNut)): 114 | captive = random.choice([True, False]) 115 | else: 116 | captive = False 117 | 118 | with BuildPart() as hole_tests: 119 | Box(100, 100, 20) 120 | bottom = hole_tests.faces().sort_by(Axis.Z)[0] 121 | with Locations(bottom): 122 | if nut_class == HeatSetNut: 123 | InsertHole(nut) 124 | assert nut.fill_factor > 1.0 # hole smaller than nut 125 | else: 126 | ClearanceHole(nut, captive_nut=captive) 127 | assert hole_tests.part.volume < 100 * 100 * 20 128 | 129 | 130 | @pytest.mark.parametrize( 131 | "washer_class, washer_type, washer_size", 132 | [ 133 | (washer_class, washer_type, washer_size) 134 | for washer_size in ["M5", "1/4"] 135 | for washer_class, washer_types in Washer.select_by_size(washer_size).items() 136 | for washer_type in washer_types 137 | ], 138 | ) 139 | def test_washers(washer_class: Nut, washer_type: str, washer_size: str): 140 | washer: Washer = washer_class(size=washer_size, fastener_type=washer_type) 141 | 142 | # Check that screw properties are created 143 | assert len(washer.clearance_hole_diameters) > 0 144 | assert len(washer.info) > 2 145 | assert washer.washer_diameter > washer.thread_diameter 146 | assert washer.washer_thickness > 0 147 | 148 | with BuildPart() as hole_tests: 149 | Box(100, 100, 20) 150 | bottom = hole_tests.faces().sort_by(Axis.Z)[0] 151 | with Locations(bottom): 152 | ClearanceHole(washer) 153 | assert hole_tests.part.volume < 100 * 100 * 20 154 | 155 | 156 | if __name__ == "__main__": 157 | test_screws(SocketHeadCapScrew, "iso4762", "M5-0.8") 158 | -------------------------------------------------------------------------------- /tests/test_gears.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | Gears Tests 4 | 5 | name: test_gears.py 6 | by: Gumyr 7 | date: May 13, 2025 8 | 9 | desc: Basic pytests for the gear classes. 10 | 11 | license: 12 | 13 | Copyright 2025 Gumyr 14 | 15 | Licensed under the Apache License, Version 2.0 (the "License"); 16 | you may not use this file except in compliance with the License. 17 | You may obtain a copy of the License at 18 | 19 | http://www.apache.org/licenses/LICENSE-2.0 20 | 21 | Unless required by applicable law or agreed to in writing, software 22 | distributed under the License is distributed on an "AS IS" BASIS, 23 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 | See the License for the specific language governing permissions and 25 | limitations under the License. 26 | 27 | """ 28 | 29 | import pytest 30 | from bd_warehouse.gear import SpurGear, SpurGearPlan 31 | from build123d import Edge, GeomType, Vector 32 | 33 | 34 | def test_spur_gear_plan(): 35 | module, tooth_count, pressure_angle, root_fillet = (1, 14, 14.5, 0.5) 36 | spur_gear_plan = SpurGearPlan( 37 | module=module, 38 | tooth_count=tooth_count, 39 | pressure_angle=pressure_angle, 40 | root_fillet=root_fillet, 41 | ) 42 | outside_arcs = ( 43 | spur_gear_plan.edges().filter_by(GeomType.CIRCLE).group_by(Edge.radius)[-1] 44 | ) 45 | # Each tooth has two tip edges 46 | assert len(outside_arcs) == 2 * tooth_count 47 | # Validate the addendum_radius 48 | assert outside_arcs[0].radius == pytest.approx( 49 | module * tooth_count / 2 + module, abs=1e-5 50 | ) 51 | # Face should point up 52 | assert spur_gear_plan.face().normal_at() == pytest.approx(Vector(0, 0, 1), abs=1e-5) 53 | 54 | 55 | def test_invalid_spur_gear(): 56 | # Too large root fillet 57 | with pytest.raises(Exception): 58 | spur_gear_plan = SpurGearPlan( 59 | module=1, 60 | tooth_count=100, 61 | pressure_angle=14.5, 62 | root_fillet=0.5, 63 | ) 64 | # Too many teeth for pressure angle 65 | with pytest.raises(Exception): 66 | spur_gear_plan = SpurGearPlan( 67 | module=1, 68 | tooth_count=100, 69 | pressure_angle=14.5, 70 | ) 71 | 72 | 73 | def test_spur_gear(): 74 | module, tooth_count, pressure_angle, root_fillet, thickness = (2, 12, 14.5, 0.5, 5) 75 | spur_gear = SpurGear( 76 | module=module, 77 | tooth_count=tooth_count, 78 | pressure_angle=pressure_angle, 79 | root_fillet=root_fillet, 80 | thickness=thickness, 81 | ) 82 | 83 | # Validate size 84 | addendum_radius = module * tooth_count / 2 + module 85 | bbox = spur_gear.bounding_box() 86 | assert bbox.size == pytest.approx( 87 | Vector(2 * addendum_radius, 2 * addendum_radius, thickness), abs=1e-5 88 | ) 89 | 90 | 91 | if __name__ == "__main__": 92 | test_spur_gear_plan() 93 | test_invalid_spur_gear() 94 | test_spur_gear() 95 | -------------------------------------------------------------------------------- /tests/test_thread.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | Thread Unit Tests 4 | 5 | name: thread_tests.py 6 | by: Gumyr 7 | date: June 22th 2023 8 | 9 | desc: Unit tests for the fastener sub-package of bd_warehouse 10 | 11 | license: 12 | 13 | Copyright 2023 Gumyr 14 | 15 | Licensed under the Apache License, Version 2.0 (the "License"); 16 | you may not use this file except in compliance with the License. 17 | You may obtain a copy of the License at 18 | 19 | http://www.apache.org/licenses/LICENSE-2.0 20 | 21 | Unless required by applicable law or agreed to in writing, software 22 | distributed under the License is distributed on an "AS IS" BASIS, 23 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 | See the License for the specific language governing permissions and 25 | limitations under the License. 26 | 27 | """ 28 | import random 29 | import unittest 30 | from bd_warehouse.thread import * 31 | 32 | 33 | class TestSupportFunctions(unittest.TestCase): 34 | def test_is_safe(self): 35 | self.assertTrue(is_safe("1 1/8")) 36 | self.assertFalse(is_safe("rm -rf *")) 37 | 38 | def test_imperial_str_to_float(self): 39 | self.assertAlmostEqual(imperial_str_to_float("1 1/2"), 1.5 * IN) 40 | self.assertEqual(imperial_str_to_float("rm -rf *"), "rm -rf *") 41 | 42 | 43 | class TestThread(unittest.TestCase): 44 | def test_parsing(self): 45 | with self.assertRaises(ValueError): 46 | Thread( 47 | apex_radius=10, 48 | apex_width=2, 49 | root_radius=8, 50 | root_width=3, 51 | pitch=2, 52 | length=20, 53 | end_finishes=("not", "supported"), 54 | ) 55 | 56 | 57 | class TestIsoThread(unittest.TestCase): 58 | end_finishes = ["raw", "fade", "square", "chamfer"] 59 | 60 | def test_exterior_thread(self): 61 | """Simple validity check for an exterior thread""" 62 | 63 | for end0 in TestIsoThread.end_finishes: 64 | for end1 in TestIsoThread.end_finishes: 65 | length = (1 + random.random() * 9) * MM 66 | with self.subTest(end0=end0, end1=end1, length=length): 67 | thread = IsoThread( 68 | major_diameter=6 * MM, 69 | pitch=1 * MM, 70 | length=length, 71 | external=True, 72 | end_finishes=(end0, end1), 73 | hand="right", 74 | ) 75 | self.assertTrue(thread.is_valid()) 76 | 77 | def test_interior_thread(self): 78 | """Simple validity check for an interior thread""" 79 | 80 | for end0 in TestIsoThread.end_finishes: 81 | for end1 in TestIsoThread.end_finishes: 82 | with self.subTest(end0=end0, end1=end1): 83 | thread = IsoThread( 84 | major_diameter=6 * MM, 85 | pitch=1 * MM, 86 | length=8 * MM, 87 | external=False, 88 | end_finishes=(end0, end1), 89 | hand="left" if end0 == end1 else "right", 90 | ) 91 | self.assertTrue(thread.is_valid()) 92 | 93 | def test_parsing(self): 94 | with self.assertRaises(ValueError): 95 | IsoThread(major_diameter=5, pitch=1, length=5, hand="righty") 96 | with self.assertRaises(ValueError): 97 | IsoThread( 98 | major_diameter=5, pitch=1, length=5, end_finishes=("not", "supported") 99 | ) 100 | 101 | def test_simple(self): 102 | thread = IsoThread( 103 | major_diameter=6 * MM, pitch=1 * MM, length=8 * MM, simple=True 104 | ) 105 | self.assertTrue(thread.wrapped.IsNull()) 106 | 107 | 108 | class TestAcmeThread(unittest.TestCase): 109 | def test_exterior_thread(self): 110 | """Simple validity check for an exterior thread""" 111 | 112 | acme_thread = AcmeThread( 113 | size="1 1/4", 114 | length=1 * IN, 115 | external=True, 116 | ) 117 | self.assertTrue(acme_thread.is_valid()) 118 | 119 | def test_interior_thread(self): 120 | """Simple validity check for an interior thread""" 121 | 122 | acme_thread = AcmeThread( 123 | size="1 1/4", 124 | length=1 * IN, 125 | external=False, 126 | ) 127 | self.assertTrue(acme_thread.is_valid()) 128 | 129 | def test_sizes(self): 130 | """Validate sizes list if created""" 131 | self.assertGreater(len(AcmeThread.sizes()), 0) 132 | 133 | def test_parsing(self): 134 | with self.assertRaises(ValueError): 135 | AcmeThread(size="1 1/4", length=1 * IN, external=False, hand="righty") 136 | with self.assertRaises(ValueError): 137 | AcmeThread(size="1.25", length=1 * IN) 138 | with self.assertRaises(ValueError): 139 | AcmeThread(size="1 1/4", length=1 * IN, end_finishes=("not", "supported")) 140 | 141 | 142 | class TestMetricTrapezoidalThread(unittest.TestCase): 143 | def test_exterior_thread(self): 144 | """Simple validity check for an exterior thread""" 145 | 146 | trap_thread = MetricTrapezoidalThread( 147 | size="8x1.5", 148 | length=10 * MM, 149 | external=True, 150 | ) 151 | self.assertTrue(trap_thread.is_valid()) 152 | 153 | def test_interior_thread(self): 154 | """Simple validity check for an interior thread""" 155 | 156 | trap_thread = MetricTrapezoidalThread( 157 | size="95x18", 158 | length=100 * MM, 159 | external=False, 160 | ) 161 | self.assertTrue(trap_thread.is_valid()) 162 | 163 | def test_parsing(self): 164 | with self.assertRaises(ValueError): 165 | MetricTrapezoidalThread(size="8x1", length=50 * MM) 166 | 167 | def test_sizes(self): 168 | """Validate sizes list if created""" 169 | self.assertGreater(len(MetricTrapezoidalThread.sizes()), 0) 170 | 171 | 172 | class TestPlasticBottleThread(unittest.TestCase): 173 | def test_exterior_thread(self): 174 | """Simple validity check for an exterior thread""" 175 | 176 | bottle_thread = PlasticBottleThread( 177 | size="M38SP444", 178 | external=True, 179 | ) 180 | self.assertTrue(bottle_thread.is_valid()) 181 | 182 | def test_exterior_left_thread(self): 183 | """Simple validity check for an exterior thread""" 184 | 185 | bottle_thread = PlasticBottleThread(size="M38SP444", external=True, hand="left") 186 | self.assertTrue(bottle_thread.is_valid()) 187 | 188 | def test_interior_thread(self): 189 | """Simple validity check for an interior thread""" 190 | 191 | bottle_thread = PlasticBottleThread( 192 | size="L18SP400", external=False, manufacturing_compensation=0.2 193 | ) 194 | self.assertTrue(bottle_thread.is_valid()) 195 | 196 | def test_parsing(self): 197 | """Validate sizes""" 198 | with self.assertRaises(ValueError): 199 | PlasticBottleThread(size="Q12SP100") 200 | with self.assertRaises(ValueError): 201 | PlasticBottleThread(size="M37SP444") 202 | with self.assertRaises(ValueError): 203 | PlasticBottleThread(size="L12XX100") 204 | with self.assertRaises(ValueError): 205 | PlasticBottleThread(size="L12SP12") 206 | with self.assertRaises(ValueError): 207 | PlasticBottleThread(size="M38SP444", hand="righty") 208 | 209 | 210 | if __name__ == "__main__": 211 | unittest.main(failfast=True) 212 | --------------------------------------------------------------------------------