for developers
Sign In
Join
Discussions
Documentation
Tutorials
Examples
Editor
Scene
Import Scene
Export Scene
Load Last Scene
Save Current Scene
Model
Save Model
Upload Model
Show Printability
Render
Preferences
Help
Reference Guide
Examples
Tutorials
Generate
Save Model
Reset Params
Check Model
// // Example of generalized kaleidoscope. The idea is similar to traditional kaleidoscope, // which consists of 3 flat mirrors with dihedral angles 60 degree. One can place an arbitrary objects inside of // such kaleidoscope and reflections in the mirrors create infinite repeating pattern. // Here in addition to usual flat mirrors we use spherical mirrors. "Reflections" in spherical mirrors are // inversion in the spheres. // If dihedral angles between spheres and planes is integer submultiple of the half turn (PI or 180 degrees) // the reflections in such mirros form regular pattern. // The type of pattern created by such kaleidoscope can be wildly complex. // In this case we have 4 mirrors: 2 flat mirros and 2 spherical mirrors. The mirrors are placed in such a ways, that // the pattern scales down near the boundary of a disk. It resembles a tiling of 2D hyperbolic plane in Poincare disk model // with important difference that our pattern is three dimensional. // var voxelSize = 0.2*MM; function getQuad( r, r1, alpha){ var r2 = r*r/(r1*Math.cos(alpha)); var x1 = Math.sqrt(r1*r1 + r*r); var y2 = Math.sqrt(r2*r2 + r*r); var splanes = new Array(); var count = 0; splanes[count++] = new ReflectionSymmetry.getPlane(new Vector3d(0,-1,0), 0.0); splanes[count++] = new ReflectionSymmetry.getPlane(new Vector3d(-1,0,0), 0.0); splanes[count++] = new ReflectionSymmetry.getSphere(new Vector3d(x1,0,0), -r1); splanes[count++] = new ReflectionSymmetry.getSphere(new Vector3d(0,y2,0), -r2); return splanes; } function makePart(size, thickeness){ var union = new Union(); var boxX = new Box(0,0,0,thickeness, thickeness, size); union.add(boxX); return union; } function main(args){ var a = 25*MM; var voxelSize = 0.1*MM; var cz = 20.0*MM; var cx = 5.0*MM; var cy = 5.0*MM; var part = makePart(30*MM, 5*MM); part.setTransform(new Rotation(new Vector3d(-1,1,0), 3*Math.PI/8)); var shape = new DataTransformer(); shape.setSource(part); var sym = new ReflectionSymmetry(getQuad(25*MM, 30*MM, Math.PI/3)); sym.set("riemannSphereRadius", a); shape.setTransform(sym); return new Scene(shape, new Bounds(-a,a,-a,a,-a,a,voxelSize)); }
Preferences
Close
Printability Check
Region check
Voxel size
Number of regions
Largest region
Close