I would say I had part b) doing this in 2014 using ShapeJS v1. Now I'm trying to port that over to ShapeJS v2 and encountering some difficulties. The part of my code that did this was to pattern the surface of a cylinder using trig functions. Basically think of lots of equations to generate ridges, flutes, or combinations thereof on the surface. In general the use of all sorts of math functions are possible, but regular repeating sine wave functions would be the most common. In the parameter inputs you could specify things like the number of flutes, or how many cycles of ridges along a length, or a specific wavelength for the pattern of ridges, etc. Typical engineering stuff. But I'm not completely sure what was in v1 but is not in v2 or visa versa.

How this worked before... In the main function I had some simple code to define the voxel grid and the patterned cylinder:

---------------------------------------------------------

var grid = createGrid(-a,a,-a,a,-a,a,0.1*MM)

var union1 = new Union();

union1.add(Pattern);

---------------------------------------------------------

Outside of the main function I had a routine that defined the pattern. I must have modeled that after some example code because I didn't fully understand it then and I don't fully understand it now. Suffice it to say it returned the desired patterned cylinder and put it into union1, which was then available for further manipulation in the main function. Anyway, the pattern thing looked like this:

----------------------------------------------------------------------

var Pattern = {

getDataValue : function(pnt, data) {

var x = pnt.v[0];

var y = pnt.v[1];

var z = pnt.v[2];

var vs = pnt.getScaledVoxelSize();

var bumps = messy equation of (x,y,z,) and some global variables;

var r = bumps +Math.sqrt(x*x+y*y);

data.v[0] = MathUtil.step10(r, radiusp, vs);

return DataSource.RESULT_OK;

}

};

-----------------------------------------------------------------------

(The parameter radiusp there is simply a global radius variable)

Anyway, the present hangup appears to happen when the main routine needs to deal with the Pattern variable and everything stops. The

ShapeJS developer editor doesn't seem to be working right now so I can't show the error, but does anyone have a clue why this isn't working in v2? Is it a change in syntax, commands, or just a bone headed goof? Maybe some improper variable passing? Has this functionality been removed to speed things up?

I'm assuming that I archived the correct old code in the first place, that it is not backwards compatible with v2, and that there is no longer a run time editor window available for v1. It would be great to see the old code run again if only to use it as a benchmark.