Incorrect mesh from 3D CSG

Issue #7 resolved
Marco Morandini created an issue

On my desktop I see the correct mesh for a (relatively small) box with a spherical hole (box1 of the testcase), but I miss the hole with a larger box (box2). Output attached below:

marco@pao:~/Projects/Specchio/Mirror/Magneto> python simple-csg-3D.py

Compact output of 3D geometry: (Box(<Point x = -1 y = -1 z = -0.4>, <Point x = 1 y = 1 z = 1>) - Sphere(<Point x = 0 y = 0 z = 0>, 0.3)) (Box(<Point x = -1 y = -1 z = -0.7>, <Point x = 1 y = 1 z = 1>) - Sphere(<Point x = 0 y = 0 z = 0>, 0.3)) Inserting protection balls... refine_balls = true min_balls_radius = 0 min_balls_weight = 0 insert_corners() done. Nb of points in triangulation: 8 insert_balls_on_edges() done. Nb of points in triangulation: 480 refine_balls() done. Nb of points in triangulation: 480

Start surface scan...end scan. [Bad facets:938]

Refining Surface... Legende of the following line: (#vertices,#steps,#facets to refine,#tets to refine) (5917,5436,0,0) (1365.8 vertices/s)))) Total refining surface time: 3.98s

Start volume scan...end scan. [Bad tets:16501]

Refining... Legende of the following line: (#vertices,#steps,#facets to refine,#tets to refine) (35896,31052,0,0) (7313.2 vertices/s))))) Total refining volume time: 4.246s Total refining time: 8.557s

Inserting protection balls... refine_balls = true min_balls_radius = 0 min_balls_weight = 0 insert_corners() done. Nb of points in triangulation: 8 insert_balls_on_edges() done. Nb of points in triangulation: 484 refine_balls() done. Nb of points in triangulation: 484

Start surface scan...end scan. [Bad facets:981]

Refining Surface... Legende of the following line: (#vertices,#steps,#facets to refine,#tets to refine) (5776,5291,0,0) (685.2 vertices/s))))) Total refining surface time: 7.722s

Start volume scan...end scan. [Bad tets:15498]

Refining... Legende of the following line: (#vertices,#steps,#facets to refine,#tets to refine) (38490,33723,0,0) (5572.2 vertices/s))))) Total refining volume time: 6.052s Total refining time: 14.398s


Comments (5)

  1. Benjamin Dam Kehlet

    This was a bit involved. In short the meshing process consists of build a coarse initial mesh and then refining it until some specified criterias are met. CGAL's classes did not guarantee that all disconnected parts in the polyhedron was represented in the initial mesh. I have rewritten the part that generates the initial surface points so that it is guaranteed to collect points from all disconnected parts.

  2. Log in to comment