// Last edited on 2020-03-08 11:03:02 by jstolfi // For visualization purposes, each part of the homunculus is // fattened. Line segments are fattened to /sticks/, // and rectangles are fattened to /pillows/. #macro homunculus_stick(XYZ, ii, jj) // Returns the stick form of a line segment part from {A = XYZ[ii]} to // {B = XYZ[jj]}. // The stick is a cylinder of standard radius {rad} with base centers at those ponts, // completed with hemispherical caps centered at those points, to fill // the gaps at joints. #local rad = 25; // Stick radius (mm). union{ sphere{ XYZ[ii], rad } cylinder{ XYZ[ii], XYZ[jj], rad } sphere{ XYZ[jj], rad } } #end #macro homunculus_pillow(XYZ, ii, XD, YD, ZD) // The pillow form of a rectangle part {R} lying on the {X,Z} plane is // a rectangular box whose largest faces are copies of that rectangle // displaced by certain distances {Tm,Tp} in the rectangle's {-Y} and {+Y} // directions, with the other four faces rounded off by half cylinders, // and the edges between these faces rounded off by quarter spheres. # To be written. #end