| 1295 | } |
| 1296 | |
| 1297 | EdgeId makeBridgeEdge( MeshTopology & topology, EdgeId a, EdgeId b ) |
| 1298 | { |
| 1299 | assert( !topology.left( a ) ); |
| 1300 | assert( !topology.left( b ) ); |
| 1301 | if ( topology.fromSameOriginRing( a, b ) ) |
| 1302 | { |
| 1303 | // org(a) and org(b) is the same vertex, so we cannot create a loop edge |
| 1304 | return {}; |
| 1305 | } |
| 1306 | |
| 1307 | const auto bOrg = topology.org( b ); |
| 1308 | for ( auto e : orgRing( topology, a ) ) |
| 1309 | { |
| 1310 | if ( topology.dest( e ) == bOrg ) |
| 1311 | { |
| 1312 | // there is an edge between org(a) and org(b), so if create another one, then multiple edges appear |
| 1313 | return {}; |
| 1314 | } |
| 1315 | } |
| 1316 | |
| 1317 | auto res = topology.makeEdge(); |
| 1318 | topology.splice( a, res ); |
| 1319 | topology.splice( b, res.sym() ); |
| 1320 | return res; |
| 1321 | } |
| 1322 | |
| 1323 | } //namespace MR |