MantisBT - Community
View Issue Details
0024019Community[OCCT] OCCT:Visualizationpublic2013-06-07 02:082013-12-19 13:56
Pawel 
Pawel 
normalminor 
closedfixed 
ALL
[OCCT] 6.6.0 
[OCCT] 6.7.0[OCCT] 6.7.0 
bugs vis bug24019
0024019: Voxel_FastConverter: filling problem
There seems to be a problem with voxelizing shapes in locations where many vertical faces overlap in Z-direction.

I guess the problem might be in Voxel_FastConverter::FillInVolume.

For the moment some pictures to document the problem.
//Code after integration of 23894
TopoDS_Shape shape;
BRep_Builder aBuilder;
BRepTools::Read(shape,"boxes5.brep",aBuilder/*, anIndicator*/);

TopoDS_Shape shape1 = BRepPrimAPI_MakeSphere(gp_Pnt(20,25,35), 7);

Standard_Real deflection = 0.005;
Standard_Integer nbThreads = 1;
Standard_Integer nbx = 200, nby = 200, nbz = 200;
Voxel_BoolDS theVoxels(0,0,0, 50, 50, 50, nbx, nby, nbz);
Voxel_BoolDS theVoxels1(0,0,0, 50, 50, 50, nbx, nby, nbz);

Voxel_FastConverter fcp(shape, theVoxels, deflection, nbx, nby, nbz, nbThreads);
fcp.ConvertUsingSAT(progress, 1);
fcp.FillInVolume(1);

Voxel_FastConverter fcp1(shape1, theVoxels1, deflection, nbx, nby, nbz, nbThreads);
progress = 0;
fcp1.ConvertUsingSAT(progress, 1);
fcp1.FillInVolume(1);

Voxel_BooleanOperation op;
Standard_Boolean result = op.Cut(theVoxels1, theVoxels);
No tags attached.
png Pic01.png (391,095) 2013-06-07 02:08
https://tracker.dev.opencascade.org/
png Pic02.png (308,166) 2013-06-07 02:08
https://tracker.dev.opencascade.org/
png boxes4.png (30,368) 2013-06-07 12:13
https://tracker.dev.opencascade.org/
png boxes5.png (13,768) 2013-06-07 12:13
https://tracker.dev.opencascade.org/
? boxes4.brep (8,750) 2013-06-07 12:14
https://tracker.dev.opencascade.org/
? boxes5.brep (143,213) 2013-06-07 12:14
https://tracker.dev.opencascade.org/
png vertical_line_problem.png (9,427) 2013-06-27 12:16
https://tracker.dev.opencascade.org/
Issue History
2013-06-07 02:08PawelNew Issue
2013-06-07 02:08PawelAssigned To => Pawel
2013-06-07 02:08PawelFile Added: Pic01.png
2013-06-07 02:08PawelFile Added: Pic02.png
2013-06-07 12:13PawelFile Added: boxes4.png
2013-06-07 12:13PawelFile Added: boxes5.png
2013-06-07 12:14PawelFile Added: boxes4.brep
2013-06-07 12:14PawelFile Added: boxes5.brep
2013-06-07 12:14PawelNote Added: 0024690
2013-06-07 12:20PawelSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=5489#r5489
2013-06-27 12:16PawelFile Added: vertical_line_problem.png
2013-06-27 12:39PawelNote Added: 0024901
2013-06-27 15:42PawelNote Added: 0024903
2013-06-27 15:42PawelStatusnew => resolved
2013-06-27 15:42PawelAssigned ToPawel => vro
2013-07-01 10:32vroNote Added: 0024921
2013-07-01 10:32vroStatusresolved => reviewed
2013-07-01 11:59mkvAssigned Tovro => apn
2013-07-03 10:53apnNote Added: 0024950
2013-07-03 10:53apnTest case number => bugs vis bug24019
2013-07-03 10:53apnAssigned Toapn => bugmaster
2013-07-03 10:53apnStatusreviewed => tested
2013-07-05 11:57PawelChangeset attached => occt master 4bee43a9
2013-07-05 11:57PawelAssigned Tobugmaster => Pawel
2013-07-05 11:57PawelStatustested => verified
2013-07-05 11:57PawelResolutionopen => fixed
2013-12-19 13:53bugmasterStatusverified => closed
2013-12-19 13:56bugmasterFixed in Version => 6.7.0

Notes
(0024690)
Pawel   
2013-06-07 12:14   
Added sample data and pictures visualizing the problem during filling.
(0024901)
Pawel   
2013-06-27 12:39   
'vertical_line_problem.png' describes the problem of filling shapes when encountering vertical faces. Basically, when checking Z-coordinates it is not possible to tell whether getting into or out of the material. For this purpose, it is necessary to verify the points against the shape topology.
(0024903)
Pawel   
2013-06-27 15:42   
Branch CR24019 pushed and ready for review.

I have implemented a new filling method that takes shape's topology into consideration when filling voxels with positive values.

The implemented method can handle vertical faces and though it uses BRepClass3d_SolidClassifier the performance is acceptable, I guess (BRepClass3d_SolidClassifier is only used where the transition from a vertical edge occurs).

There is one case where this method will fail though: a shape having internal face or in other words two shapes connected by face. At the moment the user must provide valid data to avoid problems in this case.
(0024921)
vro   
2013-07-01 10:32   
Well done!
(0024950)
apn   
2013-07-03 10:53   
Dear BugMaster,

Branch CR24019 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 7e2e911f197505066b150c01b47952d1b46248e2

Number of compiler warnings:

occt component :
Linux: 2 (2 on master)
Windows: 7 (7 on master)

products component :
Linux: 0 (0 on master)
Windows: 63 (63 on master)

Regressions:
No regressions

Improvements:
No improvements

Testing cases:
bugs vis bug24019 - OK

Testing on Linux:
Total MEMORY difference: 366345200 / 366301468
Total CPU difference: 44071.23000000135 / 43407.12000000102

Testing on Windows:
Total MEMORY difference: 422230228 / 423892192
Total CPU difference: 42908.0 / 44235.125

There are not differences in images found by testdiff.