By Odin, I think she’s got it!
I have this test:
_:test("first double drawing", function()
svg._instances = {}
local rect = svg.Rect{x=0, y=0, width=640,
height=480, fill=0x191919}
local group = svg.Group({stroke_width=0.1}, function()
local group45 = svg.Group({}, function()
local wheel = DriveWheel(10, 2, 2)
local wheel_circ = 2*math.pi*2
wheel:move(wheel_circ/8) -- 45 == pi/4
local rod = CouplingRod(6, wheel, 1)
wheel:to_svg()
rod:to_svg()
end)
group45:translate(0, 12)
local group90 = svg.Group({}, function()
local wheel = DriveWheel(10, 2, 2)
local wheel_circ = 2*math.pi*2
wheel:move(wheel_circ/4)
local rod = CouplingRod(6, wheel, 1)
wheel:to_svg()
rod:to_svg()
end)
group90:translate(0, 24)
end)
group:scale(10,-10)
group:translate(0, -48)
local s = svg.Shape:draw()
print(s)
end)
It draws this:
And that, believe it or not, is what I intended it to draw. I think this yak is shaved.