mymesh.utils.Project2Surface#

mymesh.utils.Project2Surface(Points, Normals, NodeCoords, SurfConn, tol=inf, Octree='generate')[source]#

Projects a node along its normal vector onto a surface. Returns the index of the element (elemID) that contains the projected node and the barycentric coordinates (alpha, beta, gamma) of that projection within that element.

Parameters:
  • Point (list or np.ndarray) – Coordinates of the point to be projected on to the surface.

  • Normal (list or np.ndarray) – Vector along which the point will be projected.

  • NodeCoords (list or np.ndarray) – Node coordinates list of the mesh that the point is being projected to.

  • SurfConn (list or np.ndarray) – Nodal connectivity of the surface mesh that the point is being projected to.

  • tol (float, optional) – Tolerance value, if the projection distance is greater than tol, the projection will be exculded, default is np.inf Octree : str (or octree.OctreeNode), optional octree options. An octree representation of the surface can significantly improve mapping speeds, by default ‘generate’. ‘generate’ - Will generate an octree for use in surface mapping. ‘none’ or None - Won’t generate an octree and will use a brute force approach. octree.OctreeNode - Provide a precompute octree structure corresponding to the surface mesh. Should be created by octree.Surface2Octree(NodeCoords,SurfConn)

Returns:

MappingMatrix – nx4 array consisting of the element ID (in SurfConn) and three barycentric coordinates (alpha, beta, gamma) for each point in Points

Return type:

np.ndarray