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

Re: BOLTS Open Library of Technical Specifications

Post by jreinhardt »

keithsloan52 wrote:Just tried BOLTS which looks a great idea.

On import BOLTS I get
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/media/Drive D/Shared/FreeCAD/testmacro/BOLTS/__init__.py", line 20, in <module>
from bolttools import blt_parser
File "/media/Drive D/Shared/FreeCAD/testmacro/BOLTS/bolttools/blt_parser.py", line 72
self.standardized = {body:[] for body in self.standard_bodies}
^
SyntaxError: invalid syntax
>>> If I try and run the start_bolts.FCMacro I get similar
Traceback (most recent call last):
File "/media/Drive D/Shared/FreeCAD/testmacro/start_bolts.FCMacro", line 1, in <module>
import BOLTS
File "/media/Drive D/Shared/FreeCAD/testmacro/BOLTS/__init__.py", line 20, in <module>
from bolttools import blt_parser
<type 'exceptions.SyntaxError'>: ('invalid syntax', ('/media/Drive D/Shared/FreeCAD/testmacro/BOLTS/bolttools/blt_parser.py', 72, 34, '\t\tself.standardized = {body:[] for body in self.standard_bodies}\n'))

and I nearly forgot
OS: Ubuntu 10.04.4 LTS
Platform: 32-bit
Version: 0.13.1830 (Git)
Branch: releases/FreeCAD-0-13
Hash: ec7636d7aaf2612e9b43cff5d6a424037d53e505
Python version: 2.6.5
Qt version: 4.6.2
Coin version: 3.1.2
SoQt version: 1.4.2a
OCC version: 6.3.0
Hmm, I can not reproduce this problem, but I think that it is because dict comprehensions seem to not be available in python 2.6. Could you please verify this: open a ordinary python interpreter by typing python in the console and then enter the following code:

Code: Select all

a = {k:[] for k in [1,2,3]}
and tell me whether python complains.

I will look into this soon and create a development snapshot with this constructs reformulated in a 2.6 compatible way. This problem is tracked in https://github.com/jreinhardt/BOLTS/issues/60, if you have a GitHub account, you can also comment there, if not, it is fine to continue the discussion here. It would be great if you could assist me with getting BOLTS to work with python 2.6. There might be more problems lurking.
berndhahnebach wrote:
jreinhardt wrote:... It has one problem though: an internet search for it will not give you the result you want. But PARTS has the same problem.
patience ...

If I google for "bolts library" there are allready two results on the first page which takes me to your forum article in OpenScad Forum.

bernd
With https://duckduckgo.com it is much further down, but I have only started to advertise it a bit, I hope it gets more popular (and findable) with time.

Greetings

Johannes

Thank you

Johannes

Thank you
BOLTS, standard parts library for FreeCAD Thread, Help with Translation
keithsloan52
Veteran
Posts: 2764
Joined: Mon Feb 27, 2012 5:31 pm

Re: BOLTS Open Library of Technical Specifications

Post by keithsloan52 »

jreinhardt wrote:
keithsloan52 wrote:Just tried BOLTS which looks a great idea.
...
Hmm, I can not reproduce this problem, but I think that it is because dict comprehensions seem to not be available in python 2.6. Could you please verify this: open a ordinary python interpreter by typing python in the console and then enter the following code:

Code: Select all

a = {k:[] for k in [1,2,3]}
and tell me whether python complains.

I will look into this soon and create a development snapshot with this constructs reformulated in a 2.6 compatible way. This problem is tracked in https://github.com/jreinhardt/BOLTS/issues/60, if you have a GitHub account, you can also comment there, if not, it is fine to continue the discussion here. It would be great if you could assist me with getting BOLTS to work with python 2.6. There might be more problems lurking.
As requested cut and pasted to python window.

Code: Select all

>>> a = {k:[] for k in [1,2,3]}
  File "<input>", line 1
    a = {k:[] for k in [1,2,3]}
                ^
SyntaxError: invalid syntax
jreinhardt
Posts: 329
Joined: Mon Sep 09, 2013 6:08 pm

Re: BOLTS Open Library of Technical Specifications

Post by jreinhardt »

To finish this up, the discussion about python 2.6 compatibility had continued on GitHub and we successfully figured out all the problems already a while ago, so that BOLTS for FreeCAD should run now with python 2.6. At least the most current development snapshot.

In the meantime I have been busy working on new features, among others the possibility to export the parts in BOLTS into the STEP format. This should make it useful for a large range of commercial CAD packages, as their consumer/prosumer versions often do not include a standard parts library.

This wil not replace BOLTS for FreeCAD, because the STEP export actually depends on BOLTS for FreeCAD. Plus, BOLTS for FreeCAD is way more elegant and efficient, it only needs a few python and data files, compared to a few thousand STEP files.

I use FreeCAD and the FreeCAD backend of BOLTS to export to STEP, and this works well but produces a unexpected result. Some of the geometries (like the ball bearing) consist of a compound of shapes created by something like this:

Code: Select all

	shapes = ...
	part=document.addObject("Part::Feature",name)
	comp=Part.Compound(shapes)
	part.Shape=comp.removeSplitter()
The resulting step file has lost this compound and contains all the individual shapes, see attachment.

Is there a way to have something like a compound in STEP?

OS: Ubuntu 13.04
Platform: 64-bit
Version: 0.14.2756 (Git)
Branch: master
Hash: 8f01d64d6a910335a9b6ecccd4dbddd1b5bc73f2
Python version: 2.7.4
Qt version: 4.8.4
Coin version: 3.1.3
SoQt version: 1.5.0
Attachments
step_export_grouping.png
step_export_grouping.png (134.03 KiB) Viewed 4213 times
BOLTS, standard parts library for FreeCAD Thread, Help with Translation
arcol
Posts: 223
Joined: Sun Nov 10, 2013 9:02 am

Re: BOLTS Open Library of Technical Specifications

Post by arcol »

I just downloaded from github, and looked a bit into.

A few questions crossed my mind:

- Is the /output directory consumable without doing anything?
Because the .html files are full of {% highlight python %} keywords.

- Is there a search function somewhere? Maybe it would be doable with some javascript magic without a
server program. I recently bought a M6x10 grubscrew, and the company stated it is after DIN913.
Knowing these two informations (M6x10, DIN913), how can I find in BOLTS?

- I wanted to look up a simple 608 bearing. What is the simplest method? I have not found it...

EURO screw (woodscrew, requires 5mm predrilled hole, and has 6.3mm nominal diameter), what IKEA is using, is completely missing. Also some other wood related screws.

Maybe would make sense to put up an online version for the beginners.
The learning curve seems a bit too high.



Best,
arcol
jreinhardt
Posts: 329
Joined: Mon Sep 09, 2013 6:08 pm

Re: BOLTS Open Library of Technical Specifications

Post by jreinhardt »

Thank you for trying it. You confirm that my biggest fear, that I fail to communicate clearly what BOLTS is and does, is not unfounded. If you have suggestions how to improve that, I am thankful.

What is on GitHub is mostly for the developer or for people who want to add parts. The contents of the output directory can be directly used for the generated FreeCAD and OpenSCAD files, the html files go through an additional stage to layout. The processing of the html files is a bit of a magic mess right now, I admit that. But this is not the part that the user is supposed to see first.

I hope the webpage is a more accessible entry point:

http://jreinhardt.github.io/BOLTS/index.html

A (I hope) understandable overview over the general inner structure and idea of BOLTS can be found here:

http://jreinhardt.github.io/BOLTS/doc/g ... ction.html

For those who just want to use stuff there are readily downloadable distributions for OpenSCAD and FreeCAD:

http://jreinhardt.github.io/BOLTS/downloads.html

Instructions on how to use them can be found on the documentation pages, there are also tutorials on how to contribute parts:

http://jreinhardt.github.io/BOLTS/doc/index.html

To find a particular part (like your grub screw), I would recommend the generated online documentation:

http://jreinhardt.github.io/BOLTS/html/index.html

There one can look for parts by category and by standardisation body. DIN913 is not yet available in BOLTS. A search function might be doable, but I feel that the online documentation is quite useable even without it.

The 608 bearing is here:
http://jreinhardt.github.io/BOLTS/html/ ... 625-1.html

And yes, there are not so many parts yet. At the moment I still try to figure out the fundamental processes and data structures, and put less effort in adding parts.
BOLTS, standard parts library for FreeCAD Thread, Help with Translation
arcol
Posts: 223
Joined: Sun Nov 10, 2013 9:02 am

Re: BOLTS Open Library of Technical Specifications

Post by arcol »

jreinhardt wrote:Thank you for trying it. You confirm that my biggest fear, that I fail to communicate clearly what BOLTS is and does, is not unfounded. If you have suggestions how to improve that, I am thankful.

What is on GitHub is mostly for the developer or for people who want to add parts. The contents of the output directory can be directly used for the generated FreeCAD and OpenSCAD files, the html files go through an additional stage to layout. The processing of the html files is a bit of a magic mess right now, I admit that. But this is not the part that the user is supposed to see first.

I hope the webpage is a more accessible entry point:

http://jreinhardt.github.io/BOLTS/index.html

A (I hope) understandable overview over the general inner structure and idea of BOLTS can be found here:

http://jreinhardt.github.io/BOLTS/doc/g ... ction.html

For those who just want to use stuff there are readily downloadable distributions for OpenSCAD and FreeCAD:

http://jreinhardt.github.io/BOLTS/downloads.html

Instructions on how to use them can be found on the documentation pages, there are also tutorials on how to contribute parts:

http://jreinhardt.github.io/BOLTS/doc/index.html

To find a particular part (like your grub screw), I would recommend the generated online documentation:

http://jreinhardt.github.io/BOLTS/html/index.html

There one can look for parts by category and by standardisation body. DIN913 is not yet available in BOLTS. A search function might be doable, but I feel that the online documentation is quite useable even without it.

The 608 bearing is here:
http://jreinhardt.github.io/BOLTS/html/ ... 625-1.html

And yes, there are not so many parts yet. At the moment I still try to figure out the fundamental processes and data structures, and put less effort in adding parts.

Yepp, I missed the readme's first line:
"""
For more information check the BOLTS webpage:

http://jreinhardt.github.io/BOLTS/index.html
"""

Still would be nice a clearer explanation:
"""
If you only want to try out, or just a quick overview,
then CHECK OUT THE ONLINE DEMO, where everything was already generated for you, ready to be consumed.
"""

Also would be nice to explain the difference (if any) between the online version and the generated output.

"More information" is put everywhere, so I just skipped it routinely. Mea culpa.

I'll dive into the webpage version myself. Thank you for the thorough respond.

Also some quick usage/examples would make sense in the readme too. With more info at "[website] (deeplink)".

Best,
arcol
jreinhardt
Posts: 329
Joined: Mon Sep 09, 2013 6:08 pm

Re: BOLTS Open Library of Technical Specifications

Post by jreinhardt »

I made it more explicit in the Readme file that the webpage should be the first visit. Thank you for your feedback.

I had implicitly assumed that people would know that the repo is not the main source of information. But for many software projects thats the case nowadays.
BOLTS, standard parts library for FreeCAD Thread, Help with Translation
arcol
Posts: 223
Joined: Sun Nov 10, 2013 9:02 am

Re: BOLTS Open Library of Technical Specifications

Post by arcol »

Also when you are browsing the library every naming begins with "BOLTS", which is rather misleading.
(I don't know if its marketing purpose)

Like:
BOLTS hexagon fasteners
BOLTS pipes
BOLTS nuts
BOLTS bearings

"BOLTS nuts" is the most obvious. I think it should either omitted (if every name starts with BOLT), or have a different column for the BOLTS tag (like PREFIX column).

Also I don't know if the general family tree is set into stone, but I think "BOLTS hexagon fasteners" should not be a whole group.
I think people are looking for thread type first (metric, acme, imperial, wood, euro), then onto length, then onto head type (countersunk, dome, pan), then onto drive design (philips, slot, hex socket, torx, etc).

Hexagon fasteners is a mixture. It is either metric or imperial, or hexagonal, or combined hexagonal.
an example of the combined head: http://en.wikipedia.org/wiki/File:Cross_slot_screw.jpg

Some kind of filtering will be necessary. Eg. Show all standard sized bolts between 10-18mm length of head type philips.
Dunno how to implement it. Maybe with tags? tag:metric, tag:philips, tag:M4

Best,
arcol
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: BOLTS Open Library of Technical Specifications

Post by jmaustpc »

Hi
You have done a lot of work! It looks good.

Some quick comments/suggestions
1) the quick start for FreeCAD on your home page here should say that you have to install pyyaml
http://jreinhardt.github.io/BOLTS/index.html
I only found out when I got an error message on running it. I then later found a note three or so pages down..but I still missed it at first. Needs to be more obvious.
2)the git pull gives me something different to the tar.gz download
3)the difference between the LGPL and GPL versions...is that only licence or is the content different?
4) I picked a din625-1 ball bearing for no particular reason. You probably can't do anything about this but it took a while. I didn't realise it was working at first. Then all of a sudden it worked. :)
5)the above bearing worked but produced the following error
TypeError: on_addButton_clicked() takes exactly 2 arguments (1 given)
6)I wonder if you should run "view fit" after creation so that FreeCAD scales so you can see what was just created?
7)I created a t-slot 20x20 (the first in the list) it seemed to work but gave the following out put and error
lLength (mm)10
Failed to create fillet
TypeError: on_addButton_clicked() takes exactly 2 arguments (1 given)


all items I tried got the addButton error.

Note the Length should that be Length and not lLength ?
I tried a Hexagon_head_screw_DINENISO4017___M3_20 and it said "lLength" in the report view window as well.

Jim

The above was tested with BOLTS version "BOLTS_FreeCAD_201311102345_lgpl2.1+"
and FreeCAD
OS: Ubuntu 12.04.3 LTS
Platform: 64-bit
Version: 0.14.2766 (Git)
Branch: master
Hash: f4da53bd1d59739092e7b08cf521c11c47d7432a
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0
jreinhardt
Posts: 329
Joined: Mon Sep 09, 2013 6:08 pm

Re: BOLTS Open Library of Technical Specifications

Post by jreinhardt »

Hi,

1) Thanks for the pointer. It came up a few times, and it is noted somewhere, but now I have put it on the front page.

2) The git repository contains all the data and development scripts that are used to create all the distributions and the website. In this case git is used as a tool in developing, not as a means of distribution of the software. The tar.gz downloads contain all the files necessary to use BOLTS with one CAD package.

3) I tried to design the infrastructure in a way that allows it to incorporate existing model code (i.e. OpenSCAD modules or FreeCAD python scripts generating parts). But existing code comes in different licenses, so BOLTS keeps track of that. In that way I can automatically get a license compatible distribution of BOLTS by excluding content with incompatible license, so that this distribution can be licensed under LGPL, i.e. for bundling with FreeCAD. At the moment there is no difference between the LGPL and GPL versions, because all parts that are added (by me) are license compatible with LGPL 2.1+ and GPL3.0.

4) This is a known problem: https://github.com/jreinhardt/BOLTS/issues/38 The bearing models all use a toroidal groove as runway:
https://github.com/jreinhardt/BOLTS/blo ... earings.py
But for some reason tori are incredibly slow. I will work on that when I find a bit of time.

5) This is also known and caused by a peculiarity of PyQT, that I did not manage to fix yet.

6) This is a very good idea.

7) Hmm, I have to look into that. The t-slot profiles are currently the only parts in BOLTS for FreeCAD that are not python scripted, but based on a .fcstd file, where the parameters are adjusted to match the users choice. This functionality might have some issues. I am not sure where the ILength comes from, I can not reproduce that. Maybe it is a forgotten debug statement.

Thanks a lot for your detailed feedback.

Johannes
BOLTS, standard parts library for FreeCAD Thread, Help with Translation
Post Reply