![]() ![]() The type should be adaptable to a 2-vector array of floats. vectors is the array of vectors at vertices.SurfaceMesh :: addVertexIntrinsicVectorQuantity ( std :: string name, const T & vectors, int nSym = 1 )Īdd a tangent vector quantity defined at the vertices of the mesh. In these function names, intrinsic vector is a fancy synonym for tangent vector, which indicates that the vectors lie in the surface itself, not the containing 3D space. Note: As always for functions that take 3D vector inputs, there is a setFaceTangentBasisX2D with the same signature, which expects vector 2D inputs. The length should be the number of faces in the mesh. The type should be adaptable to a 3-vector array of floats. vectors is an array of one 3D vector at each face.Specify the tangent coordinates at faces, by giving the direction of the x-axis of the basis. void SurfaceMesh :: setFaceTangentBasisX ( const T & vectors ) Note: As always for functions that take 3D vector inputs, there is a setVertexTangentBasisX2D with the same signature, which expects 2D vector inputs. The length should be the number of vertices in the mesh. vectors is an array of one 3D vector at each vertex.Specify the tangent coordinates at vertices, by giving the direction of the x-axis of the basis. void SurfaceMesh :: setVertexTangentBasisX ( const T & vectors ) To do so, pass an array of the x-axis vectors (in 3D) for mesh element. Before adding any tangent vector quantities, you probably need to tell Polyscope what this coordinate frame looks like. Tangent vectors are defined with respect to a coordinate frame at each vertex (resp., face). #include "polyscope/polyscope.h" #include "polyscope/surface_mesh.h" polyscope :: init () // Load mesh std :: unique_ptr mesh std :: unique_ptr geometry std :: tie ( mesh, geometry ) = loadMesh ( filename ) // Register the mesh with polyscope psMesh = polyscope :: registerSurfaceMesh ( "mesh", geometry -> inputVertexPositions, mesh -> getFaceVertexList (), polyscopePermutations ( * mesh )) // Set vertex tangent spaces geometry -> requireVertexTangentBasis () VertexData vBasisX ( * mesh ) for ( Vertex v : mesh -> vertices ()) polyscope :: getSurfaceMesh ( "mesh" ) -> setVertexTangentBasisX ( vBasisX ) // Make a vector field VertexData vecField = /* some field */ // Register the field polyscope :: getSurfaceMesh ( "mesh" ) -> addVertexIntrinsicVectorQuantity ( "great vectors", vecField ) polyscope :: show () Specifying the tangent basis They are expressed as 2D vectors with X-Y coordinates in some basis frame at each mesh element.Įxample: visualizing tangent vectors with geometry-central Tangent vectors lie flat against the surface of the mesh. If you want to add 2D vectors (usually to a 2D mesh), addFaceVectorQuantity2D exists with the same signature. Note: the inner vector type of the input must be 3D dimensional, or you risk compiler errors, segfaults, or worse. vectors is the array of vectors at faces.SurfaceMesh :: addFaceVectorQuantity ( std :: string name, const T & vectors )Īdd a vector quantity defined at the faces of the mesh. If you want to add 2D vectors (usually to a 2D mesh), addVertexVectorQuantity2D exists with the same signature. Passing VectorType::AMBIENT ensures vectors have the proper world-space length. The default setting is as a freely-scaled value, which will be automatically scaled to be visible. vectorType indicates how to interpret vector data. ![]() SurfaceMesh :: addVertexVectorQuantity ( std :: string name, const T & vectors )Īdd a vector quantity defined at the vertices of the mesh. Ambient vectorsĪmbient vectors are “standard” vectors, which have X-Y-Z vector coordinates in world space. Visualize vector-valued data at the elements of a surface mesh. ![]()
0 Comments
Leave a Reply. |