// A model of a (somewhat crude) chess pawn. // Dimensions of the base, the shaft, the collar, and the head. baseDiameter = 25; baseHeight = 5; headDiameter = 18; collarDiameter = 18; collarHeight = 4; collarAltitude = 30; shaftBottomDiameter = 15; shaftTopDiameter = 10; shaftLength = 35; // The base. cylinder(d=baseDiameter, h=baseHeight); // The tapering shaft. translate([0, 0, baseHeight]) cylinder(d1=shaftBottomDiameter, d2=shaftTopDiameter, h=shaftLength); // The "collar", partway up the shaft. translate([0, 0, collarAltitude]) cylinder(d=collarDiameter, h=collarHeight); // The head, a sphere. translate([0, 0, baseHeight + shaftLength + headDiameter/2 - 2]) sphere(d=headDiameter);
These assignments added to the model, as one eample, will decrease the size of the facets in the rendering.
$fs = .5; $fa = 10;
These assignments, as one example, make the facets larger than the default.
$fs = 5; $fa = 15;
Values to use may vary depending on the printer and print settings. I have had success with use these assignments in several models, but rendering can be lengthy. The pawn takes about 20 seconds to render on my computer.
$fs = .1; // 1/10 mm $fa = 3; // 3 degrees of arc
Add a value for $fn
when creating the “cylinder” for the shaft.
translate([0, 0, baseHeight]) cylinder(d1=shaftBottomDiameter, d2=shaftTopDiameter, h=shaftLength, $fn=8);
These variable values increase the size of the base and collar and make the shaft narrow. Nothing else in the script need change.
baseDiameter = 35; collarDiameter = 25; shaftBottomDiameter = 8; shaftTopDiameter = 4;
Note that since the last assignment to a variable is the value that is used, you can add those 4 lines to the bottom without changing the original script.