Hey folks. Having some alignment issue. AlignRight2() suppose to
produce same result as AlignRight but it does not. Any suggestions?
Thanks in advance
//====
include <relativity/relativity.scad>;
module AlignRight2() {
rod(d=10,h=2, anchor=[-1,0,0])
align([[1,0,0],[1,0,0],[1,0,0]])
rod(d=10,h=2, anchor=[-1,0,0]);
}
module AlignRight() {
rod(d=10,h=2, anchor=[-1,0,0])
align([1,0,0])
rod(d=10,h=2, anchor=[-1,0,0])
align([1,0,0])
rod(d=10,h=2, anchor=[-1,0,0])
align([1,0,0])
rod(d=10,h=2, anchor=[-1,0,0]);
}
AlignRight();
Hi tobject!
I think the result is not the same for the two modules due to AlignRight2
manipulates the same object. Try to change AlignRight2 to:
module AlignRight2() {
rod(d=10,h=2, anchor=[-1,0,0])
align([[1,0,0],[4,0,0],[8,0,0]])
rod(d=10,h=2, anchor=[-1,0,0]);
}
and you will see the other rods in a row.
//BR Henrik
--
Sent from: http://forum.openscad.org/
You are right! I was treating these guys as siblings, in fact they are
generations instead. But your solution uses undocumented feature of
the library (which maybe a bug). Instead, recursion solves the
problem.
module AlignRight3(n) {
if (n>0) {
rod(d=10,h=2, anchor=[-1,0,0])
align([1,0,0])
AlignRight3(n-1);
}
else
{
rod(d=10,h=2, anchor=[-1,0,0]);
}
}
AlignRight3(3);
On 6/14/19, grit henwist@gmail.com wrote:
Hi tobject!
I think the result is not the same for the two modules due to AlignRight2
manipulates the same object. Try to change AlignRight2 to:
module AlignRight2() {
rod(d=10,h=2, anchor=[-1,0,0])
align([[1,0,0],[4,0,0],[8,0,0]])
rod(d=10,h=2, anchor=[-1,0,0]);
}
and you will see the other rods in a row.
//BR Henrik
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org