standard logo    Personal Education


queen

Chess Queen

With the queen, this series of notes is closing in on a complete set of chess pieces.

Because the final version of the rook was done after I'd created the crown for the queen's head, there really isn't any new trick to explore with this piece. The crenelations of the rook and the crown were done the same way, except that the queen's crown is made of spheres while the rook uses cubes.

But I'll take the opportunity to mention that OpenSCAD uses semi-colons to mark the ends of any of the commands which actually create a shape, for example, cylinder(6,5,8);. The semicolon "completes" the command. If you forget to use it, you'll get an error message in the editor. By contrast, there are commands like translate([0,0,28]) which do not have a semi-colon. I think that the logic is that translate really acts like a modifier for the cylinder (cube, sphere, etc.) command. You actually could write the combination on the same line in the editor, translate([0,0,28]) cylinder(6,5,8);. In some situations, that way of formatting your code might be easier to use and explain. Develop your style. Be consistent, as much as you can. Use comments to explain the reason for blocks of code. Looking back at old code should be a pleasant experience, not a chore.

Another program upgrade to consider is adding in the curve smoother variable $fn=30;. Without it, the curve face/fragment count is low, which results in blocky curves. Look closely at my image of the queen to see how blocky the small spheres are for the queen's crown. Values between 30 and 60 have worked well for me in the $fn variable. Figure out what works consistently well for your projects. The OpenSCAD manual recommends not using a value over 100. Compilation time is the main issue. Try adding the command near the top of the code, before any curves get made. Experiment and learn. So far, I have not tested the related variables $fa or $fs, but I will get around to it. Ignorance is NOT bliss.


// queen's head    
translate([0,0,28])
cylinder(6,5,8);        
translate([0,0,38])
    translate([0,0,-4])
     cylinder(8,8,6); // main cylinder
 // add crown
 //crownbase=42;
 cb=42;
 translate([5,0,cb])
sphere(2);
 translate([-5,0,cb])
sphere(2);
 translate([0,5,cb])
sphere(2);
 translate([0,-5,cb])
sphere(2);
 // second set of crown 
 rotate([0,0,45]){
      translate([5,0,cb])
 //cube([2,2,4], center=true);
     sphere(2);
 translate([-5,0,cb])
sphere(2);
 translate([0,5,cb])
sphere(2);
 translate([0,-5,cb])
sphere(2);
 }

Available Files:

queen02c.scad - use this file to explore and study the design
queen02c.stl - for those who just want to print this design
GPL3 License