This repository has been archived on 2023-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
mightyscape-1.1-deprecated/extensions/fablabchemnitz/papercraft/openjscad/node_modules/@jscad/openscad-openjscad-translator/tests/examples/example006.jscad

30 lines
8.1 KiB
Plaintext
Raw Normal View History

function main(){
return CSG.cube({center: [0,0,0],radius: [50,50,50], resolution: 16}).subtract([CSG.cube({center: [0,0,0],radius: [10,10,75], resolution: 16}).subtract([CSG.cylinder({start: [0,0,-40], end: [0,0,40],radiusStart: 10, radiusEnd: 10, resolution: 30}).translate([-10,-10,0]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,40]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,-40])]).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 0)).translate([50,50,0]).union([CSG.cube({center: [0,0,0],radius: [10,10,75], resolution: 16}).subtract([CSG.cylinder({start: [0,0,-40], end: [0,0,40],radiusStart: 10, radiusEnd: 10, resolution: 30}).translate([-10,-10,0]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,40]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,-40])]).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 90)).translate([-50,50,0])]).union([CSG.cube({center: [0,0,0],radius: [10,10,75], resolution: 16}).subtract([CSG.cylinder({start: [0,0,-40], end: [0,0,40],radiusStart: 10, radiusEnd: 10, resolution: 30}).translate([-10,-10,0]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,40]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,-40])]).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 180)).translate([-50,-50,0])]).union([CSG.cube({center: [0,0,0],radius: [10,10,75], resolution: 16}).subtract([CSG.cylinder({start: [0,0,-40], end: [0,0,40],radiusStart: 10, radiusEnd: 10, resolution: 30}).translate([-10,-10,0]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,40]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,-40])]).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 270)).translate([50,-50,0])]).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 90)).union([CSG.cube({center: [0,0,0],radius: [10,10,75], resolution: 16}).subtract([CSG.cylinder({start: [0,0,-40], end: [0,0,40],radiusStart: 10, radiusEnd: 10, resolution: 30}).translate([-10,-10,0]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,40]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,-40])]).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 0)).translate([50,50,0]).union([CSG.cube({center: [0,0,0],radius: [10,10,75], resolution: 16}).subtract([CSG.cylinder({start: [0,0,-40], end: [0,0,40],radiusStart: 10, radiusEnd: 10, resolution: 30}).translate([-10,-10,0]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,40]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,-40])]).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 90)).translate([-50,50,0])]).union([CSG.cube({center: [0,0,0],radius: [10,10,75], resolution: 16}).subtract([CSG.cylinder({start: [0,0,-40], end: [0,0,40],radiusStart: 10, radiusEnd: 10, resolution: 30}).translate([-10,-10,0]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,40]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,-40])]).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 180)).translate([-50,-50,0])]).union([CSG.cube({center: [0,0,0],radius: [10,10,75], resolution: 16}).subtract([CSG.cylinder({start: [0,0,-40], end: [0,0,40],radiusStart: 10, radiusEnd: 10, resolution: 30}).translate([-10,-10,0]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,40]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,-40])]).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 270)).translate([50,-50,0])]).transform(CSG.Matrix4x4.rotation([0,0,0], [1,0,0], 90))]).union([CSG.cube({center: [0,0,0],radius: [10,10,75], resolution: 16}).subtract([CSG.cylinder({start: [0,0,-40], end: [0,0,40],radiusStart: 10, radiusEnd: 10, resolution: 30}).translate([-10,-10,0]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,40]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,-40])]).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 0)).translate([50,50,0]).union([CSG.cube({center: [0,0,0],radius: [10,10,75], resolution: 16}).subtract([CSG.cylinder({start: [0,0,-40], end: [0,0,40],radiusStart: 10, radiusEnd: 10, resolution: 30}).translate([-10,-10,0]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,40]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,-40])]).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 90)).translate([-50,50,0])]).union([CSG.cube({center: [0,0,0],radius: [10,10,75], resolution: 16}).subtract([CSG.cylinder({start: [0,0,-40], end: [0,0,40],radiusStart: 10, radiusEnd: 10, resolution: 30}).translate([-10,-10,0]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,40]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,-40])]).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 180)).translate([-50,-50,0])]).union([CSG.cube({center: [0,0,0],radius: [10,10,75], resolution: 16}).subtract([CSG.cylinder({start: [0,0,-40], end: [0,0,40],radiusStart: 10, radiusEnd: 10, resolution: 30}).translate([-10,-10,0]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,40]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-10,-10,-40])]).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 270)).translate([50,-50,0])]).transform(CSG.Matrix4x4.rotation([0,0,0], [0,1,0], 90))]),
CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([0,0,0]).translate([0,-50,0]).transform(CSG.Matrix4x4.rotation([0,0,0], [1,0,0], 0)).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 0)).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-20,0,-20]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([20,0,20])]).translate([0,-50,0]).transform(CSG.Matrix4x4.rotation([0,0,0], [1,0,0], 0)).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 90))]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-20,0,-25]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-20,0,0])]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-20,0,25])]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([20,0,-25])]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([20,0,0])]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([20,0,25])]).translate([0,-50,0]).transform(CSG.Matrix4x4.rotation([0,0,0], [1,0,0], 0)).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 180))]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([0,0,0]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-25,0,-25])]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([25,0,-25])]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-25,0,25])]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([25,0,25])]).translate([0,-50,0]).transform(CSG.Matrix4x4.rotation([0,0,0], [1,0,0], 0)).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 270))]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-25,0,-25]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([0,0,0])]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([25,0,25])]).translate([0,-50,0]).transform(CSG.Matrix4x4.rotation([0,0,0], [1,0,0], 90)).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 0))]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-25,0,-25]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([25,0,-25])]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([-25,0,25])]).union([CSG.sphere({center: [0,0,0], radius: 10, resolution: 30}).translate([25,0,25])]).translate([0,-50,0]).transform(CSG.Matrix4x4.rotation([0,0,0], [1,0,0], -90)).transform(CSG.Matrix4x4.rotation([0,0,0], [0,0,1], 0))])]);
};