John posted a solution in the thread that we need to copy/paste into
the ruby console in SU, but there is also a handy ruby out there
(shapes.rb) that could even be modified with this addition.
You can copy/paste the following into a new text file (sphere.rb for
example) with an .rb extension. Place the file in the same directory
with shapes.rb.
require 'shapes.rb'
class Sphere < Parametric
def create_entities(data, e)
r = data["r"].to_l; n = 24
c1 = e.add_circle(ORIGIN,Z_AXIS,r,n)
c2 = e.add_circle(ORIGIN,X_AXIS,2*r,n)
f = e.add_face(c1)
status = f.followme(c2)
status = c2.each {|edge| edge.erase!}
end
def default_parameters; {"r", 6.feet}; end
def translate_key(key); "Radius"; end
end
if $sphere_menu.nil? then sphere_menu =
UI.menu("Draw").add_item("Sphere") { Sphere.new }; end