| 18 | { |
| 19 | |
| 20 | void addBaseToPlanarMesh( Mesh& mesh, float zOffset ) |
| 21 | { |
| 22 | MR_TIMER; |
| 23 | mesh.pack(); // for some hard fonts with duplicated points (if triangulated contours have same points, duplicates are not used) |
| 24 | // it's important to have all vertices valid: |
| 25 | // first half is upper points of text and second half is lower points of text |
| 26 | |
| 27 | Mesh mesh2 = mesh; |
| 28 | for ( auto& p : mesh2.points ) |
| 29 | p.z += zOffset; |
| 30 | |
| 31 | mesh2.topology.flipOrientation(); |
| 32 | |
| 33 | mesh.addMesh( mesh2 ); |
| 34 | |
| 35 | auto edges = mesh.topology.findHoleRepresentiveEdges(); |
| 36 | for ( int bi = 0; bi < edges.size() / 2; ++bi ) |
| 37 | { |
| 38 | StitchHolesParams stitchParams; |
| 39 | stitchParams.metric = getVerticalStitchMetric( mesh, Vector3f::plusZ() ); |
| 40 | stitchHoles( mesh, edges[bi], edges[edges.size() / 2 + bi], stitchParams ); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | Expected<Mesh> alignContoursToMesh( const Mesh& mesh, const Contours2f& contours, const ContoursMeshAlignParams& params ) |
| 45 | { |
no test coverage detected