Script-Problem - Access to point-components

 From:  Michael Gibson
6622.2 In reply to 6622.1 
Hi Karsten, so it looks like you almost have it - to get the components of a point you should use the .x .y .z properties just like you are doing currently.

I think the problem is on line 216, where you're trying to extract points from the result of the arraycurve:

var nx=moi.vectorMath.createPoint(arrayed_pts.item(iPts).pt);


The vectorMath.createPoint() function only expects to take 3 coordinates as its input - here it's being passed another point object instead of coordinates and so it's probably generating garbage out.

Try doing this on this line instead:

var nx=arrayed_pts.item(iPts).pt;



Also it looks like a proper array point of points is being assembled in the "pts" array, so you could try using that instead of ptx.

One of the things that's kind of confusing about these points is that there are 2 kinds of points being worked with here - one is a "point object" which is the type of thing that can be created in MoI under Draw curve > More > Point, and it can have all kinds of properties same as curves or solids like hidden, locked, name, style assignment, selection, etc... - then the second kind of point is a "point data structure" which is much more basic and only has .x .y .z properties and none of that other stuff with it. When you have a "point object" you can retreive the "data structure point" from it by the .pt property.

Hope this helps!

- Michael