-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom bearing sizes #80
Comments
@gumyr thanks, that's what I understood. But that makes my project not portable :-( What happens if I want to open it on my other workstation, or to share it with someone? And then my changes will be lost if I reinstall or update the package. |
I'm sorry that cq_warehouse isn't suitable for your needs. |
Maybe it's possible to make it possible to construct instances of bearings, screws etc by providing their parameters directly? |
I solved my issue using the following code, borrowed and modified from the cq_warehouse's source code: def read_fastener_parameters_from_csv(filename: str) -> dict:
"""Parse a csv parameter file into a dictionary of strings"""
parameters = {}
with open(filename, mode='r', newline='', encoding='utf-8') as csvfile:
reader = csv.DictReader(csvfile)
fieldnames = reader.fieldnames
for row in reader:
key = row[fieldnames[0]]
row.pop(fieldnames[0])
parameters[key] = row
return parameters
class CustomSingleRowDeepGrooveBallBearing(SingleRowDeepGrooveBallBearing):
"""Custom Single Row Deep Groove Ball Bearing"""
bearing_data = read_fastener_parameters_from_csv("bearing.csv") |
Hello! First of all, thank you for this great piece of work!
I wanted to use it but the size of the bearing I want to use in my design (
M5-14-5
) is not in the database.How do I extend the database so my CQ project remains portable? The documentation says:
and then
So am I supposed to modify the source code of cq_warehouse? I've checked the code and it seems the only place the file(s) are read from is the package's directory:
cq_warehouse/src/cq_warehouse/fastener.py
Line 63 in 56fa36e
Do I miss anything? Any suggestions how to solve this issue? Thank you!
The text was updated successfully, but these errors were encountered: