Ruby Sketch [ Proven | 2027 ]
require 'ruby2d'
show
on :mouse_down do |event| Circle.new(x: event.x, y: event.y, radius: 10, color: 'fuchsia') @points << [event.x, event.y] end ruby sketch
Here's an example of a simple Ruby Sketch application:
While they seem different, both "Ruby sketches" rely on . Whether you are coding a new structural wall in SketchUp using Ruby or meticulously detailing a scythe in a digital sketchpad, the process is one of turning a concept into a tangible (or digital) reality. Class: Length — SketchUp Ruby API Documentation require 'ruby2d' show on :mouse_down do |event| Circle
on :key_down do |e| clear if e.key == 'r' end
require 'ruby2d'
require 'chunky_png'