2017-10-10 6 views
2

Je suis la fonction CGAL::Polygon_mesh_processing::corefine_and_compute_union(), pour calculer l'union de 2 mailles.CGAL union malentendu

Lorsque j'utilise le code du exemple du site (https://cgal.geometryfactory.com/CGAL/doc/master/Polygon_mesh_processing/Polygon_mesh_processing_2corefinement_mesh_union_8cpp-example.html) et les fichiers fournis hors blobby.off et eight.off, tout va bien.

Malheureusement, quand j'utiliser d'autres fichiers hors que je reçois et erreur je ne comprends pas:

CGAL error: assertion violation! 
Expression : it_poly_hedge!=edge_to_hedge.end() 
File  : /usr/local/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Visitor.h 
Line  : 1008 

Voici le code CONCERNES Visitor.h:

//WARNING: in few case this is needed if the marked edge is on the border 
    //to optimize it might be better to only use sorted pair. TAG_SLXX1 
    Node_id_pair opposite_pair(node_id_pair.second,node_id_pair.first); 
    it_poly_hedge=edge_to_hedge.find(opposite_pair); 
    CGAL_assertion(it_poly_hedge!=edge_to_hedge.end()); 

Vous pouvez trouver les fichiers que j'utilise ici: https://pool234.seedbox.fr/files/index.php/s/H87xL0Ema9HC44P (pwd: share)

Nous vous remercions de votre aide.

+0

'mesh2.off' est pas une maille d'entrée valide (auto-intersections dues aux bords doubles). Si vous le corrigez pour la première fois en appelant ['CGAL :: Polygon_mesh_processing :: stitch_borders()'] (https://doc.cgal.org/latest/Polygon_mesh_processing/group__PMP__repairing__grp.html#ga15f047f56af2fee3e491120db4dc69a3), vous obtiendrez votre résultat. – sloriot

+0

Cela a fait l'affaire, merci beaucoup. –

+0

Ces commentaires devraient être transformés en une réponse. –

Répondre

0

Voici le aswner de sloriot:

mesh2.off est pas une maille d'entrée valide (auto-intersections en raison de bords doubles). Si vous résolvez le problème en appelant CGAL :: Polygon_mesh_processing :: stitch_borders(), vous obtiendrez votre résultat.

Thx