ElementBndBoxTree*& ebbTree = _ebbTree[ _elementType ];
if ( !ebbTree )
- ebbTree = new ElementBndBoxTree( *_mesh, _elementType );
+ ebbTree = new ElementBndBoxTree( *_mesh, _elementType, _meshPartIt );
gp_XYZ p = point.XYZ();
ElementBndBoxTree* ebbLeaf = ebbTree->getLeafAtPoint( p );
- const Bnd_B3d* box = ebbLeaf->getBox();
+ const Bnd_B3d* box = ebbLeaf ? ebbLeaf->getBox() : ebbTree->getBox();
double radius = ( box->CornerMax() - box->CornerMin() ).Modulus();
ElementBndBoxTree::TElemSeq elems;
const double t11 = T22, t12 = -T12, t21 = -T21, t22 = T11;
// vector
const double r11 = p.X()-t2.X(), r12 = p.Y()-t2.Y();
- // barycentric coordinates: mutiply matrix by vector
+ // barycentric coordinates: multiply matrix by vector
bc0 = (t11 * r11 + t12 * r12)/Tdet;
bc1 = (t21 * r11 + t22 * r12)/Tdet;
}