The Revolution Was Madeup
Madeup now supports surfaces of revolution. Trace out a radially-symmetric cross-section of an object, then spin it around the object’s central axis some number of degrees using the revolve
command to form a solid. The variable nsides
determines how many intermediate stops are made as the cross-section is spun.
I offer a few examples of the revolve
command in action.
Barbell
barRadius = 5 bellRadius = 10 deltaRadius = bellRadius - barRadius barLength = 20 bellLength = 10 yaw 90 moveto 0 0 0 yaw 90 move bellRadius yaw -90 move bellLength yaw -90 move deltaRadius yaw 90 move barLength yaw 90 move deltaRadius yaw -90 move bellLength yaw -90 move bellRadius nsides = 50 revolve 1 0 0 360
Vase
nsides = 100 -- trace outside moveto 0 0 0 for i through 10 moveto (4 + sin (360 * i / 10)) i 0 end -- trace inside for i through 9 moveto (3.5 + sin (360 * (10 - i) / 10)) (10 - i) 0 end moveto 0 1 0 revolve 0 1 0 360
Pie Sans Wedge
nsides = 50 moveto 0 0 0 yaw 90 move 3 yaw -90 move 1 yaw -90 move 3 revolve 0 1 0 270