# Using Codification to produce OpenSCAD scripts

I'd like to be able to use Snap! to construct OpenSCAD scripts (text processing language that produces 3D models)

But I need a bit of help to get started as I don't seem to be able to quite grasp what to do

I'd like this sort of Snap! construct

to produce this sort of text ouput

color([1,0,0])translate([0,0,10])cube([20,20,20]);


This makes a cube 20mm on each side then moves it up 10mm) and then colours it red

I only need the line command block and say the color reporter - I can work the others out if I had those

If the variadic line command block can't be done then I could resort to this sort of construct

18th Mar 23 - I've got this far myself by modifying the Codification example (specifically the JavaScript mapping)

[edit2] a little bit later ....
I've got it working

The variadic line block adds , between each item so I came up with a kludge to add in the ¬ char on the output of each reporter and then do a search and replace for ¬, to remove them (plus a search and replace for the trailing ¬ one as well)