From 1f328536a9ba6755aff6b0c9c5b148f483ac9619 Mon Sep 17 00:00:00 2001 From: "franck.ledoux" Date: Sat, 7 Sep 2024 19:42:02 +0200 Subject: [PATCH] - fix cut error (#421) --- mctsblock/src/Blocking.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mctsblock/src/Blocking.cpp b/mctsblock/src/Blocking.cpp index 8f3cc513c..cb3393b6b 100644 --- a/mctsblock/src/Blocking.cpp +++ b/mctsblock/src/Blocking.cpp @@ -404,8 +404,16 @@ Blocking::get_nodes_of_edge(const Blocking::Edge AE) std::vector nodes; nodes.resize(2); Dart3 d = AE->dart(); - nodes[0] = m_gmap.attribute<0>(d); - nodes[1] = m_gmap.attribute<0>(m_gmap.alpha<0>(d)); + auto d_node = m_gmap.attribute<0>(d); + auto d0_node = m_gmap.attribute<0>(m_gmap.alpha<0>(d)); + if(d_node->info().topo_id< d0_node->info().topo_id) { + nodes[0] = d_node; + nodes[1] = d0_node; + } + else{ + nodes[0] = d0_node; + nodes[1] = d_node; + } return nodes; } @@ -1138,8 +1146,8 @@ void Blocking::cut_sheet(const Edge AE, const double AParam) { assert(AParam > 0 && AParam < 1); - // Note: the parameterization starts from the first node of AE, which is the one containing AE->dart(). - // As a consequence, our orientation is consistent in the algorithm. + // Note: the parameterization starts from the first node of AE, which is the one having the node + // of lowest topo id // We get a dart per sheet edge std::vector sheet_darts;