BOLTS Open Library of Technical Specifications

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

BOLTS Open Library of Technical Specifications

Johannes Reinhardt
Hi everybody,

this is going to be a rather lengthy post, so I add sections for easier
orientation.

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

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

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

when I saw the Mendel90 design by Nophead
(https://github.com/nophead/Mendel90) I was impressed by many things,
but in particular I liked the way in which the code is structured,
including the automatic BOM generation, and the careful modeling of
standard parts. I think it is desireable to use such an approach all
the time, and thought about ripping the nuts and bolts and bom part out
into a small standalone library.

At the same time I began to look into FreeCAD (http://freecadweb.org/),
and noticed that a standard parts library is missing. There I got the
idea, that it would be a great thing to have a common data base of
standard dimensions and metadata. Then one could use the parametric
abilities of different CAD tools to create a standard parts library
with a manageable amount of effort.

I thought about it for a while, forgot it, then played around a bit
with the idea, got distracted several times, rediscovered
it again, and now, more than a year after my initial commit I can show
you some results.

I call it BOLTS (BOLTS is a Open Library of Technical Specifications),
and it is probably not very useful yet. In the future I hope that i
will become something like a MCAD (another inspiration) on steroids.

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

As a disclaimer I should probably mention, that most of the stuff that I
did for this project is stuff that I do not really have a lot of
experience with, so if you read the following description of the general
architecture and think: "I guess this could be done a lot easier and
better", than this is probably the case and I ask you to enter in the
discussion.

The common data base is realized as a bunch of YAML (http://yaml.org)
files with extension .blt. I chose yaml because it is both human- and
machine-readable, and a plain text representation that is well suited
to be stored in version control.

These blt files contain informations about the author, license of the
data, a number of parts with names, descriptions, tables of dimensions.
OpenSCAD is not suited to read these blt files directly (other systems
might be, for example FreeCAD is), so for the case of OpenSCAD I use a
bit of python to generate scad code that allows use from within
OpenSCAD. For example the tables of dimensions are written to huge
functions (again inspired by the way nophead did it) like this:

function DIN125A_table(key) =␣
key == "M2.6" ? [2.8, 7.0, 0.5] :␣
key == "M2.5" ? [2.7, 6.0, 0.5] :␣
key == "M56" ? [58.0, 105.0, 9.0] :␣
key == "M2.3" ? [2.5, 6.0, 0.5] :␣
key == "M2.2" ? [2.4, 6.0, 0.5] :␣
key == "M39" ? [40.0, 72.0, 6.0] :␣
...

Now we are missing the specific geometric details of a bolt or a washer
or any other object that one would like to have in our library. This is
realized as with OpenSCAD modules called base module. Basically
all washers can be covered by a single module, these are shared between
different standards. My python magic now connects the table data and
the base module and creates a set of modules that are easily usable
from within OpenSCAD.

I hope in this way it will be easy to contribute, because both
the creation and edition of blt files and base modules should be
relatively small and simple tasks.

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

To add a washer according to DIN125A it now suffices to do

include<BOLTS.scad>
DIN125A("M4");

and it should just work.

Of course most of us do not know the works of DIN, ISO and companions
by heart, so I used the data base to generate a set of html files that
can serve as a documentation.
http://jreinhardt.github.io/BOLTS//html/index.html

One can also use BOLTS from FreeCAD (see the homepage for details), but
there not all the base geometries are implemented, so they are basically
restricted to only washers :).

Future plans
------------

This is a collection of things that I think might be useful

* Nophead style BOM generation
* Some kind of orientation and placement help, maybe using the attach
  library http://www.thingiverse.com/thing:30136. I fear at the moment
  it might be awkward to actually use, because one somehow still needs
  to know the dimensions of the parts to put them into the right
  position.
* May be a special differencing mode, for easy creation of holes for
  bolts or other places, where a fastener has to fit in. And maybe some
  kind of mechanism to be able to trade of accuracy and amount of
  details and rendering time.

Join the discussion
-------------------

The infrastructure and the data formats and basically everything is
still very alpha. I basically built everything in such a way that it is
easy to be very convenient to manage different kinds of washers (which,
for this reason, is the most popular part in BOLTS, offering the choice
of 18 different standards :). But I guess, use cases in reality are
different, so please tell me what you would like to do with BOLTS, or
even better try to make BOLTS do it, and tell me about the problems.

In the next phase I want to focus less on amassing a huge number of
parts, but more getting the infrastructure right to cover the most
common use cases. And this I can do only with your help.

So please try it out and give some feedback. You can download the
current state of BOLTS on its website:

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

Best Regards

Johannes
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Fwd: BOLTS Open Library of Technical Specifications

Bryan Bishop

From: Johannes Reinhardt <[hidden email]>
Date: Mon, Sep 9, 2013 at 12:59 PM
Subject: [OpenSCAD] BOLTS Open Library of Technical Specifications
To: [hidden email]


Hi everybody,

this is going to be a rather lengthy post, so I add sections for easier
orientation.

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

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

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

when I saw the Mendel90 design by Nophead
(https://github.com/nophead/Mendel90) I was impressed by many things,
but in particular I liked the way in which the code is structured,
including the automatic BOM generation, and the careful modeling of
standard parts. I think it is desireable to use such an approach all
the time, and thought about ripping the nuts and bolts and bom part out
into a small standalone library.

At the same time I began to look into FreeCAD (http://freecadweb.org/),
and noticed that a standard parts library is missing. There I got the
idea, that it would be a great thing to have a common data base of
standard dimensions and metadata. Then one could use the parametric
abilities of different CAD tools to create a standard parts library
with a manageable amount of effort.

I thought about it for a while, forgot it, then played around a bit
with the idea, got distracted several times, rediscovered
it again, and now, more than a year after my initial commit I can show
you some results.

I call it BOLTS (BOLTS is a Open Library of Technical Specifications),
and it is probably not very useful yet. In the future I hope that i
will become something like a MCAD (another inspiration) on steroids.

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

As a disclaimer I should probably mention, that most of the stuff that I
did for this project is stuff that I do not really have a lot of
experience with, so if you read the following description of the general
architecture and think: "I guess this could be done a lot easier and
better", than this is probably the case and I ask you to enter in the
discussion.

The common data base is realized as a bunch of YAML (http://yaml.org)
files with extension .blt. I chose yaml because it is both human- and
machine-readable, and a plain text representation that is well suited
to be stored in version control.

These blt files contain informations about the author, license of the
data, a number of parts with names, descriptions, tables of dimensions.
OpenSCAD is not suited to read these blt files directly (other systems
might be, for example FreeCAD is), so for the case of OpenSCAD I use a
bit of python to generate scad code that allows use from within
OpenSCAD. For example the tables of dimensions are written to huge
functions (again inspired by the way nophead did it) like this:

function DIN125A_table(key) =␣
key == "M2.6" ? [2.8, 7.0, 0.5] :␣
key == "M2.5" ? [2.7, 6.0, 0.5] :␣
key == "M56" ? [58.0, 105.0, 9.0] :␣
key == "M2.3" ? [2.5, 6.0, 0.5] :␣
key == "M2.2" ? [2.4, 6.0, 0.5] :␣
key == "M39" ? [40.0, 72.0, 6.0] :␣
...

Now we are missing the specific geometric details of a bolt or a washer
or any other object that one would like to have in our library. This is
realized as with OpenSCAD modules called base module. Basically
all washers can be covered by a single module, these are shared between
different standards. My python magic now connects the table data and
the base module and creates a set of modules that are easily usable
from within OpenSCAD.

I hope in this way it will be easy to contribute, because both
the creation and edition of blt files and base modules should be
relatively small and simple tasks.

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

To add a washer according to DIN125A it now suffices to do

include<BOLTS.scad>
DIN125A("M4");

and it should just work.

Of course most of us do not know the works of DIN, ISO and companions
by heart, so I used the data base to generate a set of html files that
can serve as a documentation.
http://jreinhardt.github.io/BOLTS//html/index.html

One can also use BOLTS from FreeCAD (see the homepage for details), but
there not all the base geometries are implemented, so they are basically
restricted to only washers :).

Future plans
------------

This is a collection of things that I think might be useful

* Nophead style BOM generation
* Some kind of orientation and placement help, maybe using the attach
  library http://www.thingiverse.com/thing:30136. I fear at the moment
  it might be awkward to actually use, because one somehow still needs
  to know the dimensions of the parts to put them into the right
  position.
* May be a special differencing mode, for easy creation of holes for
  bolts or other places, where a fastener has to fit in. And maybe some
  kind of mechanism to be able to trade of accuracy and amount of
  details and rendering time.

Join the discussion
-------------------

The infrastructure and the data formats and basically everything is
still very alpha. I basically built everything in such a way that it is
easy to be very convenient to manage different kinds of washers (which,
for this reason, is the most popular part in BOLTS, offering the choice
of 18 different standards :). But I guess, use cases in reality are
different, so please tell me what you would like to do with BOLTS, or
even better try to make BOLTS do it, and tell me about the problems.

In the next phase I want to focus less on amassing a huge number of
parts, but more getting the infrastructure right to cover the most
common use cases. And this I can do only with your help.

So please try it out and give some feedback. You can download the
current state of BOLTS on its website:

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

Best Regards

Johannes
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566



--
- Bryan
http://heybryan.org/
1 512 203 0507

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: BOLTS Open Library of Technical Specifications

Bryan Bishop
On Mon, Sep 9, 2013 at 12:59 PM, Johannes Reinhardt <[hidden email]> wrote:
The common data base is realized as a bunch of YAML (http://yaml.org)
files with extension .blt. I chose yaml because it is both human- and
machine-readable, and a plain text representation that is well suited
to be stored in version control.

Hi there, I appreciate what you're doing here. I have written a pile of code that you might find helpful (or not) that does a few similar things.


Let me know if this can be repurposed to help you somehow.

- Bryan
http://heybryan.org/
1 512 203 0507

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: BOLTS Open Library of Technical Specifications

Bryan Bishop

On Mon, Sep 9, 2013 at 1:09 PM, Bryan Bishop <[hidden email]> wrote:
On Mon, Sep 9, 2013 at 12:59 PM, Johannes Reinhardt <[hidden email]> wrote:

The common data base is realized as a bunch of YAML (http://yaml.org)
files with extension .blt. I chose yaml because it is both human- and
machine-readable, and a plain text representation that is well suited
to be stored in version control.

Hi there, I appreciate what you're doing here. I have written a pile of code that you might find helpful (or not) that does a few similar things.


One other quick thought, after looking over your implementation. I strongly disagree with using freecad-python because the dependencies become out-of-whack. As far as I know, the freecad/python support is only inside of freecad itself, as in it's bolted into python, rather than exposed as a ctypes/cython/pyrex/whatever binding against the freecad/opencascade library. This really limits the potential use of freecad-based python dependencies. In skdb, you will see that we decided to use the python swig wrappers against opencascade (pythonocc), but that had its own helping of problems. At this point I think the way forward is to generate bindings against BRL-CAD, since opencascade is a steaming pile of unmaintainable junk (which is sad, because FreeCAD deserves to not be thrown away so quickly).

Also, it would be really helpful if your python module had a setup.py so that I could grab it from the python package index or use it in my virtualenvs...

Things like including pyqt4 and qt4 and freecad in the specification of a bolt is really really problematic for using it downstream by people like me:

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: BOLTS Open Library of Technical Specifications

Johannes Reinhardt
In reply to this post by Bryan Bishop
Hi there,

As usual: A few minutes of searching the internet can usually be
conveniently replaced by several weeks of coding :)

I have to look into your stuff in more detail, but on the surface it
looks like we had similar things in mind.

Greetings

Johannes

On Mon, 9 Sep 2013 13:09:19 -0500
Bryan Bishop <[hidden email]> wrote:

> On Mon, Sep 9, 2013 at 12:59 PM, Johannes Reinhardt <
> [hidden email]> wrote:
>
> > The common data base is realized as a bunch of YAML
> > (http://yaml.org) files with extension .blt. I chose yaml because
> > it is both human- and machine-readable, and a plain text
> > representation that is well suited to be stored in version control.
> >
>
> Hi there, I appreciate what you're doing here. I have written a pile
> of code that you might find helpful (or not) that does a few similar
> things.
>
> http://gnusha.org/skdb/package_spec.html
> https://github.com/kanzure/skdb
> http://gnusha.org/skdb
>
> Let me know if this can be repurposed to help you somehow.
>
> - Bryan
> http://heybryan.org/
> 1 512 203 0507



--

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: BOLTS Open Library of Technical Specifications

Johannes Reinhardt
In reply to this post by Bryan Bishop

> One other quick thought, after looking over your implementation. I
> strongly disagree with using freecad-python because the dependencies
> become out-of-whack. As far as I know, the freecad/python support is
> only inside of freecad itself, as in it's bolted into python, rather
> than exposed as a ctypes/cython/pyrex/whatever binding against the
> freecad/opencascade library. This really limits the potential use of
> freecad-based python dependencies. In skdb, you will see that we
> decided to use the python swig wrappers against opencascade
> (pythonocc), but that had its own helping of problems. At this point
> I think the way forward is to generate bindings against BRL-CAD,
> since opencascade is a steaming pile of unmaintainable junk (which is
> sad, because FreeCAD deserves to not be thrown away so quickly).
>
> Also, it would be really helpful if your python module had a setup.py
> so that I could grab it from the python package index or use it in my
> virtualenvs...
>
> Things like including pyqt4 and qt4 and freecad in the specification
> of a bolt is really really problematic for using it downstream by
> people like me:
> https://github.com/jreinhardt/BOLTS/blob/master/freecad_bolts.py
>
> Thanks for doing this!
>
> - Bryan
> http://heybryan.org/
> 1 512 203 0507

As I mentioned, my stuff is probably not done in the most optimal way.

The FreeCAD dependency only concerns BOLTS for FreeCAD.

The idea is that for using BOLTS with FreeCAD one basically has to
implement the base geometries for FreeCAD to get a complete standard
library.

Or more generally if a tool has parametric geometries, than one only
has to find a way to get the data from bolts into the tool and
implement a few base geometries.

So if one does not want to use BOLTS with FreeCAD one does not
need FreeCAD. I think one can run generate_scad.py (which builds the
OpenSCAD distribution of BOLTS) without having FreeCAD installed.
But this might be also not true.

Greetings Johannes

--

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566