The problem:

* sometimes I want to print something that’s larger than my printer’s print bed.

* if I print two parts, they need to have some kind of join beyond just gluing them together

* that’s a lot of work every time I have to do this.

Idea:

* I define an OpenSCAD “operator” module that can be applied to any kind of too-big-part, and splits it into two parts.

* Even better: I could define an entire library of such “cut” operators that split my part in different ways, such as with a clean edge, and various types of joins: rectangular, triangle, and various kinds of interlocks. One could get fancy if one could define those only once and reuse for any too-big-part.

State of the implementation:

* It’s beginning to work. Here are some examples:

https://github.com/jernst/openscad-cuts/tree/master/examplese.g.

Example part for testing: simply a cube:

module MyPart() {

translate( [ -50, 0, 0 ] ) {

cube( [ 100, 100, 5 ] );

}

}

Now I’m applying one of my operators (it creates a comb-like join):

Combs() {

MyPart();

}

and I get a left and a right part, split by the x=0 plane, with some offset, and using a “comb” pattern to connect the left and the right part.

So far so good. But my implementation is not as neat as I would like. If you look at the Combs module:

https://github.com/jernst/openscad-cuts/blob/master/cuts/comb.scad , you see that I am repeating the two “cube” statements for both the Right and the Left part.

module Combs( … ) {

Right( ... ) {

cube( [ insert+play, step+2*play, height ] );

cube( [ insert-play, step-2*play, height ] );

children();

};

…

Left( … ) {

cube( [ insert+play, step+2*play, height ] );

cube( [ insert-play, step-2*play, height ] );

children();

}

}

These three items: two cubes and children() are passed to the Left and the Right module, which extract them:

* child 1 and child 2 are used as the pattern for the cut

* child 3 is the part to be cut

I was thinking I should be able to do something like this, declaring the two cubes only once and reusing them via children():

module Combs2( ... ) {

LeftRight( ... ) {

cube( [ insert+play, step+2*play, height ] );

cube( [ insert-play, step-2*play, height ] );

children();

};

};

module LeftRight( ... ) {

translate( [ apart, 0, 0 ] )

Right( ... )

children();

translate( [ -apart, 0, 0 ] )

Left( ... )

children();

};

but somehow the children() aren’t making it down over multiple levels.

What am I doing wrong?

Thanks,

Johannes.

_______________________________________________

OpenSCAD mailing list

[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org