@@ -15,6 +15,23 @@ class Vector3F;
1515
1616using Polygon = std::vector<Point2F>;
1717
18+ /* *
19+ * \brief Projects a 2D stroke polygon onto a 3D mesh and returns the resulting 2D polygons in UV space.
20+ * \param stroke_polygon The 2D stroke polygon to project.
21+ * \param mesh_vertices The coordinates of the 3D vertices of the mesh.
22+ * \param mesh_indices The mesh faces as indices into the vertex array, which may be empty of the mesh doesn't have indices.
23+ * \param mesh_uv The UV coordinates for each mesh vertex.
24+ * \param mesh_faces_connectivity For each face of the mesh, contains the 3 indices of the adjacent faces, or -1 is edge is not connected.
25+ * \param texture_width The width of the texture in pixels.
26+ * \param texture_height The height of the texture in pixels.
27+ * \param camera_projection_matrix The camera projection matrix.
28+ * \param is_camera_perspective True if the camera uses perspective projection, false for orthographic.
29+ * \param viewport_width The width of the viewport in pixels.
30+ * \param viewport_height The height of the viewport in pixels.
31+ * \param camera_normal The normal vector of the camera.
32+ * \param face_id The ID of the initial face to project onto, other will be propagated using connectivity information.
33+ * \return A vector of polygons in UV space resulting from the projection.
34+ */
1835std::vector<Polygon> project (
1936 const std::span<Point2F>& stroke_polygon,
2037 const std::span<Point3F>& mesh_vertices,
0 commit comments