※Primitive Wrangleで使用
int pts[] = primpoints(0,@primnum);
float tx = 0.0;
float ty = 0.0;
float tz = 0.0;
for(int i=0;i<len(pts);i++){
vector pos = point(0,"P",pts[i]);
tx += pos.x;
ty += pos.y;
tz += pos.z;
}
tx = tx / len(pts);
ty = ty / len(pts);
tz = tz / len(pts);
int ap = addpoint(0,set(tx,ty,tz));
for(int i=0;i<len(pts);i++){
removepoint(0,pts[i]);
}