Attach library for Openscad

by obijuan, published

Attach library for Openscad by obijuan Sep 10, 2012

Use This Project

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

Thing Statistics

7688Views 941Downloads Found in Robotics


Openscad library for easily attaching parts. This is an experimental work on enhancing the openscad tool. Usually the code written by users is difficult to read and understand. If we want to share the code and to reuse parts made by others, it is very important to write clean code.

The attach operator is a experimental way of joining together parts. It just hides all the translate/rotate operators to the user, making the code easier to read, maitain and reuse.

I have written about it (and given an example of use) in this post:


The attach operator is part of the obiscad tools I am developing:


More information in this wiki (in Spanish):



Example of use:

1) Define the connectors in a part (the points were you want to attach other parts). You should provide the attachment point, the axis and the roll angle:

//-- att. point att. axis roll
c1 = [ [0,0,10], [0,0,1], 20 ];

Add your main part.
You can easily see the connector you have defined invoking the connector module:


Then define the connector for the second part:

//-- att. point att. axis roll
a = [ [0, 2,2], [0,0,1], 0 ];

Again, put your part and then view the connector with:

Now you are ready to attach the second part to the first one invoking the attach operator:

attach(c1,a) your_part();

Were your_part() is a module or a tree of operators (union, translates and so on).

More from Robotics

view more

All Apps

No results.