1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00
emv 13c0e40223 0030145: Modeling Algorithms - Boolean Operations on open solids
Provide possibility to perform Boolean operations on open solids.

Implementation of the new method *BOPAlgo_Builder::BuildBOP* performing the construction of the result shape for the given type of Boolean operation.
This approach does not rely on the splits of solid to be correct and looks for the faces with necessary state relatively opposite solids to build the result solid.
The call to this method is performed from BOP algorithm in case there were open solids in the arguments.

Implementation of the draw command *buildbop* performing a call to the method above.
2018-10-03 19:21:14 +03:00

35 lines
801 B
Plaintext

box b1 10 2 2
box b2 5 0 0 5 5 5
box b3 6 0 0 1 1 1
bclearobjects
bcleartools
baddobjects b1
baddtools b2 b3
bfillds
bbuild r
buildbop r0 -o b1 -t b2 b3 -op common
buildbop r1 -o b1 -t b2 b3 -op fuse
buildbop r2 -o b1 -t b2 b3 -op cut
buildbop r3 -o b1 -t b2 b3 -op tuc
foreach r {r0 r1 r2 r3} {
checkshape $r
if {![regexp "OK" [bopcheck $r]]} {
puts "Error: shape is self-interfered"
}
}
checkprops r0 -s 56 -v 20
checknbshapes r0 -vertex 16 -edge 25 -wire 12 -face 12 -shell 2 -solid 2
checkprops r1 -s 190 -v 145
checknbshapes r1 -vertex 24 -edge 38 -wire 16 -face 16 -shell 1 -solid 1
checkprops r2 -s 48 -v 20
checknbshapes r2 -vertex 8 -edge 12 -wire 6 -face 6 -shell 1 -solid 1
checkprops r3 -s 142 -v 105
checknbshapes r3 -vertex 12 -edge 18 -wire 8 -face 8 -shell 1 -solid 1