BOLTS Open Library of Technical Specifications

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
jreinhardt
Posts: 329
Joined: Mon Sep 09, 2013 6:08 pm

BOLTS Open Library of Technical Specifications

Post by jreinhardt »

Hi everybody,

this is going to be a rather long post, so here is tl;dr summary:

I am working on a cross-CAD standard parts library called BOLTS. It is already somewhat useable, and you are cordially
invited to join the discussion to make it better.

http://www.bolts-library.org/en/index.html

Although there are several threads with similar content like:
viewtopic.php?f=8&t=4348
viewtopic.php?f=19&t=4205
viewtopic.php?f=10&t=4390
I did not feel comfortable hijacking any of these, but decided to start a new one.

Introduction
-----------------

When I got a 3D printer a while ago I looked into various free and open source CAD tools, and FreeCAD struck me as promising. I played around a bit, but there were a few bugs hitting me, so I ended up with using mostly OpenSCAD. I like programming, but on the other hand there are some warts in this language. I have seen CATIA in Action, and this seems to be a powerful way of doing stuff.

One of the most complex OpenSCAD projects that I am aware of is the Mendel90 3D Printer by nophead (https://github.com/nophead/Mendel90), and he created a few pretty nifty constructs to keep the scad code manageable. Among others he had reusable standard parts and a automatic BOM creator.

Having FreeCAD still on my mind, I developed the vision of a cross-CAD standard parts repository, where one has a common repository of data and metadata (like dimensions, standards, ...), such that it is relatively easy from there to build a standard parts library for an arbitrary CAD system using its parametric capabilities.

I played around with this idea, and got again sidetracked several times, but now I can show you some results. It is already roughly working, but probably not very useful. I show examples how to use BOLTS with FreeCAD below.

Architecture
-----------------

I should add that I am not an expert in this stuff. I am neither a mechanical engineer, nor have I otherwise been exposed to standards. I am not very familiar with the inner workings of FreeCAD, I only know enough python to be able to get everything somehow done. So if you read this description and think "No, this should be done differently", then you are probably right. Please tell me about it.

The non-geometric data and metadata is stored in yaml files (http://yaml.org/)with extension blt, as yaml is both machine and human-readable, and works well with version control. They includes dimensions, author and licence information, standards, and stuff like that. The geometric information has to be supplied separately. For FreeCAD I used python functions, that add a part (e.g. a washer with certain dimensions) to the current document. I call these functions base functions, because the represent the base geometry of a part. This geometric information can usually be shared between many different standards (DIN, ISO,...). For example, BOLTS currently provides 18 different standards for washers using only two base functions.

Only the base functions are application specific (e.g. I need to do it both for OpenSCAD and FreeCAD), the data and metadata can be shared. I hope that this will allow to exploit synergies, as all communities can profit from each other.

FreeCAD is conveniently written in Python, so it was relatively easy to write a widget that docks into the main window and reads in the yaml files with the data. At the moment I have only added 4 base functions, so in FreeCAD the selection of parts is restricted to hexagon head bolts and washers.

How to use it
--------------------

You can download the current state of BOLTS for FreeCAD from its homepage:
http://jreinhardt.github.io/BOLTS//index.html
It currently consists of a bunch of python modules and a few yaml files. One needs to start FreeCAD with the right include paths, I have supplied a script that does that for you (at least in Linux). A short description what to do can be found on the Homepage.

From an overview over all the data and metadata currently I generated a set of html files giving an overview over all the standards currently available. This is also useful if one does not know the DIN and ISO norms by heart.

http://www.bolts-library.org/en/index.html

Future Plans
------------------

All this code is very much a proof of concept. It is basically built to handle nuts, bolts, washers and similar items well, but from some of these other threads about standard parts in this forum I got that there are also other use cases. In the beginning I want to focus more on getting the overall infrastructure right, and less so on adding thousands of parts. So please tell me about your needs for standard parts and use cases.

In particular there are a few things that I plan to research, where I might have questions:

- Drawings: Currently I have very ugly drawings (that show the different dimensions of a part) generated using a horrible OpenSCAD mechanism. I have the feeling that FreeCAD is much better suited to create such drawings. Is there a way to do it automatically or at least half-automatically?
- Base geometries: The base geometries that I have implemented for FreeCAD right now are basically one to one translations from the corresponding OpenSCAD ones, done is CSG style. I guess this is not the best way to do it, and there are other ways to do it. In particular I would be interested in having the base geometries in fcstd files, because then it would be possible to reuse the work that was done for https://github.com/yorikvanhavre/FreeCAD-library

I would like to hear your opinions, criticism, suggestions, ideas, usecases. Or even better: try to do something with BOLTS and tell me about the difficulties.

http://www.bolts-library.org/en/index.html

Greetings

Johannes

[Edit: Changed links to new website URL]
Last edited by jreinhardt on Tue Sep 02, 2014 3:10 pm, edited 1 time in total.
BOLTS, standard parts library for FreeCAD Thread, Help with Translation
jreinhardt
Posts: 329
Joined: Mon Sep 09, 2013 6:08 pm

Re: BOLTS Open Library of Technical Specifications

Post by jreinhardt »

BOLTS, standard parts library for FreeCAD Thread, Help with Translation
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: BOLTS Open Library of Technical Specifications

Post by ickby »

Hello,

I just tried it, what python package is needed for blt_parser? Can't find it. (Ubuntu 13.04)
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: BOLTS Open Library of Technical Specifications

Post by NormandC »

That looks fantastic! :)

There are quite a few topics about parts libraries, I wonder if requesting a specific forum would be a good idea...
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: BOLTS Open Library of Technical Specifications

Post by triplus »

It's nice to see "the standard part libraries" progressing vividly!
jreinhardt
Posts: 329
Joined: Mon Sep 09, 2013 6:08 pm

Re: BOLTS Open Library of Technical Specifications

Post by jreinhardt »

ickby wrote:Hello,

I just tried it, what python package is needed for blt_parser? Can't find it. (Ubuntu 13.04)
Thank you for trying it out. blt_parser is a custom module that should be included in the tarball. I forgot to put that file into the distribution and failed to detect that when I tested. I will fix that tonight.

If you want to try right now, you can get it here https://github.com/jreinhardt/BOLTS/raw ... _parser.py . Just put in the same folder than the other files from the tar.
BOLTS, standard parts library for FreeCAD Thread, Help with Translation
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: BOLTS Open Library of Technical Specifications

Post by yorik »

Looks totally excellent! I'll give it a try too
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: BOLTS Open Library of Technical Specifications

Post by yorik »

Just tested, amazing work! One little cosmetic bug I found, if you press the "add shape" button when there is no value in the "I" field, an error arises.
Another thing I found strange, is that the top faces of the bolts are heavily triangulated?

I would also suggest turning this into a macro, with an icon, so it could be added to the FreeCAD interface without the hassle to make a complete workbench, which would be overkill in this case... If your bolts folder is placed inside the FreeCAD macros folder (~/.FreeCAD on linux & mac, don't remember exactly where for windows), and you rename freecad_bolts.py as __init__.py, you can do "import bolts" without the need for your launch script... So your macro would basically contain only that line :)
jreinhardt
Posts: 329
Joined: Mon Sep 09, 2013 6:08 pm

Re: BOLTS Open Library of Technical Specifications

Post by jreinhardt »

Thank you for testing!

The heavy triangulation is due to the fact that I build the hexagonal head as a union of three boxes (CSG). I did it this way, because I could more or less literally translate what I had done for OpenSCAD. I became now aware of the screw maker macro
viewtopic.php?f=19&t=4205&start=70#p34684
which is written in the same spirit as BOLTS, with the organisational difference, that the data and metadata is not separated. But I think I can convert all the geometries to BOLTS easily.

Thank you for the hint with the macro. I was aware that the integration is non-optimal, but was not aware of a way to improve it. I will see if I can manage the macrofication.
BOLTS, standard parts library for FreeCAD Thread, Help with Translation
jreinhardt
Posts: 329
Joined: Mon Sep 09, 2013 6:08 pm

Re: BOLTS Open Library of Technical Specifications

Post by jreinhardt »

ickby wrote:Hello,

I just tried it, what python package is needed for blt_parser? Can't find it. (Ubuntu 13.04)
This should be fixed by now
BOLTS, standard parts library for FreeCAD Thread, Help with Translation
Post Reply