/usr/share/openscad/libraries/MCAD/multiply.scad is in openscad-mcad 2014.03-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | /*
* Multiplication along certain curves
*
* Copyright by Elmo Mäntynen, 2012.
* Licenced under LGPL2 or later
*/
include <units.scad>
use <utilities.scad>
// TODO check that the axis parameter works as intended
// Duplicate everything $no of times around an $axis, for $angle/360 rounds
module spin(no, angle=360, axis=Z){
for (i = [1:no]){
rotate(normalized_axis(axis)*angle*no/i) union(){
for (i = [0 : $children-1]) child(i);
}
}
}
//Doesn't work currently
module duplicate(axis=Z) spin(no=2, axis=axis) child(0);
module linear_multiply(no, separation, axis=Z){
for (i = [0:no-1]){
translate(i*separation*axis) child(0);
}
}
|