FromAssembly:
PUBLIC
PROC [assem: Assembly, inverted:
BOOL]
RETURNS [prim: Primitive] = {
mo: MasterObject;
prim ← NEW[PrimitiveObj];
IF NOT ISTYPE[assem.object, MasterObject] THEN ERROR PrimitiveAssemblyWithoutMO;
mo ← NARROW[assem.object];
prim.name ← assem.name;
prim.artwork ← assem.artwork;
prim.assembly ← assem;
prim.mo ← mo;
prim.rayCast ← mo.class.rayCast;
prim.rayCastNoBBoxes ← mo.class.rayCastNoBBoxes;
prim.primWRTAssembly ← assem.coordSys;
prim.scalars ← assem.scalars;
prim.primWRTWorld ← assem.coordSys.wrtWorld;
prim.worldWRTPrim ← Matrix3d.Inverse[prim.primWRTWorld];
prim.hints will be filled in at preprocess time
prim.boundBox ← NIL; -- will be filled in at tree preprocess time
prim.boundHedron ← mo.class.getHedron[mo];
prim.inverted ← inverted;
prim.currentRay ← NIL;
prim.rayStepX ← NIL;
};