compute surface path between given edge points
| 114 | |
| 115 | // compute surface path between given edge points |
| 116 | void addSurfacePath( std::vector<GCommand>& gcode, const Mesh& mesh, const MeshEdgePoint& start, const MeshEdgePoint& end ) |
| 117 | { |
| 118 | const auto sp = computeSurfacePath( mesh, start, end ); |
| 119 | if ( !sp.has_value() || sp->empty() ) |
| 120 | { |
| 121 | const auto p = mesh.edgePoint( end ); |
| 122 | gcode.push_back( { .x = p.x, .y = p.y, .z = p.z } ); |
| 123 | return; |
| 124 | } |
| 125 | |
| 126 | if ( sp->size() == 1 ) |
| 127 | { |
| 128 | const auto p = mesh.edgePoint( sp->front() ); |
| 129 | gcode.push_back( { .x = p.x, .y = p.y, .z = p.z } ); |
| 130 | } |
| 131 | else |
| 132 | { |
| 133 | Polyline3 transit; |
| 134 | transit.addFromSurfacePath( mesh, *sp ); |
| 135 | const auto transitContours = transit.contours().front(); |
| 136 | for ( const auto& p : transitContours ) |
| 137 | gcode.push_back( { .x = p.x, .y = p.y, .z = p.z } ); |
| 138 | } |
| 139 | |
| 140 | const auto p = mesh.edgePoint( end ); |
| 141 | gcode.push_back( { .x = p.x, .y = p.y, .z = p.z } ); |
| 142 | } |
| 143 | |
| 144 | // computes all sections of modified mesh along the given axis |
| 145 | // if a selected area is specified in the original mesh, then only points projected on it will be taken into consideration |
no test coverage detected