Welcome! Log In Create A New Profile

Advanced

BOLTS, a standard parts library for OpenSCAD and FreeCAD

Posted by jreinhardt 
BOLTS, a standard parts library for OpenSCAD and FreeCAD
April 28, 2014 10:25AM
Hi,

I have posted this here already, but now that I have discovered this forum I think it is much more appropriate. Scrolling down sometimes pays off smiling smiley

I am working on BOLTS, the Open Library of Technical Specifications, a standard parts library for open source CAD tools. The idea is to have the parts data (dimension, etc) in a generic format and then use a parametric model to get a certain version of a part. This way one can reuse the data across several CAD tools. It is in development, but already usable.

OpenSCAD is one of the supported systems at the moment, FreeCAD is the other one. There have been some efforts towards supporting SolidWorks, but this requires more help from people with access to Solidworks, which I do not have. For all other CAD systems IGES files for many parts are available.

Using BOLTS for OpenSCAD is quite easy, one downloads a zip archive with the files, extracts them into a folder (or puts them somewhere where OpenSCAD can find them), and then it is possible to write

include 

//insert a washer according to ISO7089
ISO7089("M4");

There is a list of all parts that are currently in BOLTS, and for every part it is listed whether it is available for OpenSCAD, and how it can be used.

If a part is missing it is usually easy to add it. All that is needed is a OpenSCAD module that turns some parameters into a model, and a few lines in plain text files to tell BOLTS about it. If you want to contribute to BOLTS, there is a list of parts that have no OpenSCAD module yet.

Greetings
Re: BOLTS, a standard parts library for OpenSCAD and FreeCAD
May 08, 2014 02:50AM
This is pretty fantastic. I've been working on something that might help. A layer of abstraction to automatically build SCAD files from different SCAD technologies (openSCAD, coffeeSCAD, openJSCAD etc.)

[github.com]

Here is a video overview. I'm working on a blog post and some more updates.
[www.youtube.com]
Re: BOLTS, a standard parts library for OpenSCAD and FreeCAD
May 08, 2014 05:34AM
That is a neat idea, and if I understand correctly, it should work nicely with BOLTS. I believe there is a need for tools that allow SCAD designs to scale to higher complexity. Looking forward to see where this is going.

Greetings
Re: BOLTS, a standard parts library for OpenSCAD and FreeCAD
September 02, 2014 11:43AM
Hi everybody,

BOLTS now has a new website:

[www.bolts-library.org]

The new site offers many new features including

Internationalisation (in progress): BOLTS will be available in different languages. Help with translating here
Responsive design: The site is now usable also with tablets and mobile devices
Search: Quickly find what you are looking for with the new search feature

Please update your bookmarks! The old website hosted by github, only shows a migration message. If you have posted links to the old website which you believe attract a lot of traffic, please consider updating them.

Greetings

Johannes

Edited 1 time(s). Last edit at 09/02/2014 11:45AM by jreinhardt.
Re: BOLTS, a standard parts library for OpenSCAD and FreeCAD
September 04, 2014 04:25PM
I am using freecad 0.14
When i run the macro nothing happens. I have also tried to make the Bolt button but it dont show up.
What am i doing wrong?
Re: BOLTS, a standard parts library for OpenSCAD and FreeCAD
September 04, 2014 04:35PM
Can you post the information from Help->About FreeCAD->Copy to clipboard ?

You can try to activate the redirection of error messages in Edit->Preferences->Output Window by checking the two boxes at the bottom and then type "import BOLTS" in the python console. If there are error messages, please also post them.
Re: BOLTS, a standard parts library for OpenSCAD and FreeCAD
September 04, 2014 05:02PM
Freecad:

OS: Windows 7
Word size: 32-bit
Version: 0.14.3700 (Git)
Branch: releases/FreeCAD-0-14
Hash: 32f5aae0a64333ec8d5d160dbc46e690510c8fe1
Python version: 2.6.2
Qt version: 4.5.2
Coin version: 3.1.0
SoQt version: 1.4.1
OCC version: 6.5.1

Error in python:
ImportError: No module named BOLTS


I have extracted the zip file, there is a submap named BOLTS
Re: BOLTS, a standard parts library for OpenSCAD and FreeCAD
September 06, 2014 04:15AM
To which directory have you extracted the zip file? As mentioned in the installation instructions

[www.bolts-library.org]

you have to extract it to a directory, where FreeCAD can find it:

Quote

You can look up the location of the macro folder in the preferences: Choose Edit->Preferences, in the dialog select the macro tab. The macro path is listed there.
Re: BOLTS, a standard parts library for OpenSCAD and FreeCAD
September 06, 2014 06:27AM
I have extracted it in the ap according the instructions. I have also tried a different map and browsed for this map in the macro popup screen.
I have installed a different library in the same map and this works fine.
Re: BOLTS, a standard parts library for OpenSCAD and FreeCAD
September 06, 2014 06:39AM
Which directory did you extract the archive to? Can you give me a path?

Then you can try to check the list of directories that FreeCAD searches for libraries and see if this directory is there. To do that type

import sys
print sys.path

in the python console in FreeCAD.
Re: BOLTS, a standard parts library for OpenSCAD and FreeCAD
September 06, 2014 07:45AM
Bolts is extracted to:
D:\Documents\Arduino\Prusa i3\Corexy\Freecad\macros\BOLTS_FreeCAD_0.3_lgpl2.1+

Python console:

>>> import sys
>>> print sys.path
['D:\\Program Files (x86)\\FreeCAD 0.14\\Mod', 'D:\\Program Files (x86)\\FreeCAD 0.14\\lib', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Drawing', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Inspection', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Idf', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Part', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Robot', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Arch', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Mesh', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Raytracing', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Material', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Web', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Complete', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Import', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Test', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Draft', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Points', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Start', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Spreadsheet', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Fem', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\OpenSCAD', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\MeshPart', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Plot', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Ship', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\PartDesign', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Image', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\ReverseEngineering', 'D:\\Program Files (x86)\\FreeCAD 0.14\\Mod\\Sketcher', 'D:\\Program Files (x86)\\FreeCAD 0.14\\bin', 'D:\\Program Files (x86)\\FreeCAD 0.14\\bin\\python26.zip', 'd:\\Program Files (x86)\\FreeCAD 0.14\\DLLs', 'd:\\Program Files (x86)\\FreeCAD 0.14\\lib', 'd:\\Program Files (x86)\\FreeCAD 0.14\\lib\\plat-win', 'd:\\Program Files (x86)\\FreeCAD 0.14\\lib\\lib-tk', 'D:\\Program Files (x86)\\FreeCAD 0.14\\bin', 'D:/Documents/Arduino/Prusa i3/Corexy/Freecad/macros/BOLTS_FreeCAD_0.3_lgpl2.1+']
>>>
Re: BOLTS, a standard parts library for OpenSCAD and FreeCAD
September 06, 2014 08:12AM
Hmm, that seems to be all right. So there is a directory

D:\Documents\Arduino\Prusa i3\Corexy\Freecad\macros\BOLTS_FreeCAD_0.3_lgpl2.1+\BOLTS

and a file

D:\Documents\Arduino\Prusa i3\Corexy\Freecad\macros\BOLTS_FreeCAD_0.3_lgpl2.1+\BOLTS\__init__.py

?
Re: BOLTS, a standard parts library for OpenSCAD and FreeCAD
September 06, 2014 08:35AM
When i now type "import BOLTS" python comes with:

>>> import BOLTS
Traceback (most recent call last):
File "", line 1, in
File "D:/Documents/Arduino/Prusa i3/Corexy/Freecad/macros/BOLTS_FreeCAD_0.3_lgpl2.1+\BOLTS\__init__.py", line 21, in
import bolttools.blt
File "D:/Documents/Arduino/Prusa i3/Corexy/Freecad/macros/BOLTS_FreeCAD_0.3_lgpl2.1+\BOLTS\bolttools\blt.py", line 18, in
import yaml
ImportError: No module named yaml
>>>

So i have to install yaml. i have downloaded and extracted yaml, but how do i install it?
Re: BOLTS, a standard parts library for OpenSCAD and FreeCAD
September 06, 2014 08:46AM
See the instructions:

[www.bolts-library.org]

Quote

If you are on windows you can get an installer here; you have to install YAML for the version of Python (first two digits) that is bundled with FreeCAD. You can find out which version that is from the first line of the python console in FreeCAD.

where "here" is a link to [pyyaml.org]

Edited 1 time(s). Last edit at 09/06/2014 08:47AM by jreinhardt.
Re: BOLTS, a standard parts library for OpenSCAD and FreeCAD
September 06, 2014 04:30PM
It's working smiling bouncing smiley

Great library.

Thanks for the help.thumbs up
Sorry, only registered users may post in this forum.

Click here to login