| 163 | } |
| 164 | } |
| 165 | void run_test_section() |
| 166 | { |
| 167 | auto model = |
| 168 | geode::load_section( absl::StrCat( geode::DATA_PATH, "quad.og_sctn" ) ); |
| 169 | |
| 170 | for( const auto& surface : model.surfaces() ) |
| 171 | { |
| 172 | const auto& surface_mesh = surface.mesh(); |
| 173 | for( const auto& line : model.lines() ) |
| 174 | { |
| 175 | if( !model.is_boundary( line, surface ) |
| 176 | && !model.is_internal( line, surface ) ) |
| 177 | { |
| 178 | continue; |
| 179 | } |
| 180 | const auto& line_mesh = line.mesh(); |
| 181 | for( const auto edge_id : geode::Range{ line_mesh.nb_edges() } ) |
| 182 | { |
| 183 | const auto surface_edge_vertices = |
| 184 | geode::surface_vertices_from_line_edge( |
| 185 | model, surface, line, edge_id ); |
| 186 | const auto oriented_surface_edge_vertices = |
| 187 | geode::oriented_surface_vertices_from_line_edge( |
| 188 | model, surface, line, edge_id ); |
| 189 | geode::OpenGeodeModelException::test( |
| 190 | surface_edge_vertices.size() |
| 191 | == oriented_surface_edge_vertices.nb_edges(), |
| 192 | "Different number of polygons for " |
| 193 | "surface_vertices_from_line_edge and " |
| 194 | "oriented_surface_vertices_from_line_edge functions." ); |
| 195 | if( model.is_boundary( line, surface ) ) |
| 196 | { |
| 197 | geode::OpenGeodeModelException::test( |
| 198 | surface_edge_vertices.size() == 1, "", |
| 199 | surface_edge_vertices.size(), |
| 200 | " polygons were found from boundary line edge." ); |
| 201 | } |
| 202 | else if( model.is_internal( line, surface ) ) |
| 203 | { |
| 204 | geode::OpenGeodeModelException::test( |
| 205 | surface_edge_vertices.size() == 2, "", |
| 206 | surface_edge_vertices.size(), |
| 207 | " polygons were found from internal line edge." ); |
| 208 | } |
| 209 | for( const auto edge_vertex_id : geode::LRange{ 2 } ) |
| 210 | { |
| 211 | geode::OpenGeodeModelException::test( |
| 212 | line_mesh |
| 213 | .point( line_mesh.edge_vertex( |
| 214 | { edge_id, edge_vertex_id } ) ) |
| 215 | .inexact_equal( |
| 216 | surface_mesh.point( surface_edge_vertices[0] |
| 217 | .vertices[edge_vertex_id] ) ), |
| 218 | "Points on the edge and on the surface have " |
| 219 | "different positions." ); |
| 220 | } |
| 221 | } |
| 222 | } |
no test coverage detected