- my ($modb,@argl) = (@_);
- p "module ${modb}(".(join ', ', @argl)."){\n";
- p " d=Commitid_depth();\n";
- p " translate([0,0,-d]) linear_extrude(height=d*2)\n";
- p " ${modb}_2D(".(join ',', map { m/=/ ? $` : $_ } @argl).");\n";
- p "}\n";
+ my ($modb,$size,@argl) = (@_);
+ $size ||= "${modb}_sz()";
+ p "module ${modb}_M_2D(".argl_formal(@argl)."){\n";
+ p " translate([${size}[0],0])\n";
+ p " mirror([1,0,0])\n";
+ p " ${modb}_2D(".argl_actual(@argl).");\n";
+ p "};\n";
+ foreach my $mir ('','_M') {
+ my $mm = "${modb}${mir}";
+ p "module ${mm}(".argl_formal(@argl)."){\n";
+ p " d=Commitid_depth();\n";
+ p " translate([0,0,-d]) linear_extrude(height=d*2)\n";
+ p " ${mm}_2D(".argl_actual(@argl).");\n";
+ p "}\n";
+ }