User Guide

334 APPENDIX E
volume = (max.x - min.x) * (max.y - min.y) * (max.z - min.z);
chat.print(“Primitive’s bounding-box volume is “ + volume);
children
An array of Primitives that are children to the given Primitive in the Builder object hierarcy. If children is
undefi ned the Primitive has no children.
if (foo.children == ‘undefi ned’)
{
chat.print(“Primitive has no children”);
}
else
{
chat.print(“First child’s name is “ + foo.children[0].name);
}
parent
The Primitive’s parent. If parent is undefi ned then it is the rootPrimitive of the SolidObject.
if (foo.parent == ‘undefi ned’)
{
chat.print(“Primitive has no parent”);
}
else
{
chat.print(“Parent’s name is “ + foo.parent.name);
}
Methods
nd(path)
Returns the fi rst descendant of this object which matches the specifi ed path. The path is similar to a fi le path,
where ‘/’ separates each element, and where each element is one of:
A name refers to the child with that name
. refers to the current Primitive
.. refers to the parent of the current Primitive
... refers to any number of elements (other than ..”)
“*” refers to any one element (other than ..”)
root = stageModel.getSolidObject(0).rootPrimitive;
rstTorch = root.fi nd(“.../torch”);
ndAll(path1, path2, path3, ...)
Similar to the method fi nd but returns an array of all the matching Primitives.
root = stageModel.getSolidObject(0).rootPrimitive;
torches = root.fi ndAll (“.../torch”);