Hi!

Here I've got an example of a difference between BSh and Groovy -- I ended up helping myself on this one, but I thought I'd post it anyway :D This is a scripted object.

In BeanShell:

addElement(Vec3 p0, Vec3 p1) { Tube t = new Tube(new Vec3[]{p0,p1},0.1,Tube.INTERPOLATING,Tube.FLAT_ENDS); script.addObject(t, new CoordinateSystem()); } Vec3 p0 = new Vec3(), p1 = new Vec3(0,1,0); addElement(p0,p1);

To make it palatible to Groovy, I had to write:

void addElement(Vec3 p0, Vec3 p1) { Vec3[] v = new Vec3[2]; v[0] = p0; v[1] = p1; Tube t = new Tube(v,0.1,Tube.INTERPOLATING,Tube.FLAT_ENDS); script.addObject(t, new CoordinateSystem()); } Vec3 p0 = new Vec3(), p1 = new Vec3(0,1,0); addElement(p0,p1);

The above is acceptable for both languages.

It turns out that the expression ** new Vec3(){p0,p1}** in it's groovy form is

**, like so:**

`[p0,p1] as Vec3[]`

void addElement(Vec3 p0, Vec3 p1) { Tube t = new Tube([p0,p1]as Vec3[],0.1,Tube.INTERPOLATING,Tube.FLAT_ENDS); script.addObject(t, new CoordinateSystem()); } Vec3 p0 = new Vec3(), p1 = new Vec3(0,1,0); addElement(p0,p1);

In the original context the ** add.element()** is going to be used up to a few million times for each rendered frame, so getting rid of variables, that are used only once seemed relevant. -- Having said that, there is much more to be optimized in that code and certainly this was not the only syntax issue, but maybe the key-one. ;)