]> OCCT Git - occt-copy.git/commitdiff
0026917: 3D Offset algorithm produces incorrect result
authoremv <emv@opencascade.com>
Tue, 8 Nov 2016 15:04:28 +0000 (18:04 +0300)
committerapn <apn@opencascade.com>
Tue, 8 Nov 2016 15:05:05 +0000 (18:05 +0300)
Extension on the 3D Offset algorithm (Mode="Complete", Join Type = "Intersection")
for colliding cases to add support for new configurations of the shapes.
In the previous approach the result of the offset operation was build from
the offset faces using MakerVolume algorithm, without checking of the validity of these faces.
The new extension is based on this approach, but now the offset faces are being checked
on invalidity and rebuild in case of any. This allows (in case of successful rebuilding) to avoid creation
of the unforeseen parts such as dangling parts, spikes, inverted faces in the result of offset operation.
The main criteria for the validity of the faces is the coincidence of the normal
direction of the offset face with the normal direction of the original face.
Check for removal of invalid faces has been removed as obsolete.

BRepOffset_Inter2D: Avoid excess trimming of the edges due to coincidence with other edges.
BRepOffset_Inter3D: Careful treatment of the intersection of the faces connected only through vertices.

Eliminating the compiler warning.

Small corrections of test cases for issue CR26917

572 files changed:
src/BOPAlgo/BOPAlgo_Builder_4.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx
src/BOPTools/BOPTools_AlgoTools_2.cxx
src/BRepOffset/BRepOffset_Inter2d.cxx
src/BRepOffset/BRepOffset_Inter2d.hxx
src/BRepOffset/BRepOffset_Inter3d.cxx
src/BRepOffset/BRepOffset_MakeOffset.cxx
src/BRepOffset/BRepOffset_MakeOffset.hxx
src/BRepOffset/BRepOffset_MakeOffset_1.cxx [new file with mode: 0644]
src/BRepOffset/FILES
src/BRepTest/BRepTest_FeatureCommands.cxx
tests/bugs/modalg_6/bug27540_1
tests/bugs/modalg_6/bug27540_2
tests/bugs/modalg_6/bug27540_3
tests/offset/end
tests/offset/shape_type_i_c/A1
tests/offset/shape_type_i_c/A2
tests/offset/shape_type_i_c/A3
tests/offset/shape_type_i_c/A4
tests/offset/shape_type_i_c/A5
tests/offset/shape_type_i_c/A6
tests/offset/shape_type_i_c/A7
tests/offset/shape_type_i_c/A8
tests/offset/shape_type_i_c/A9
tests/offset/shape_type_i_c/B1
tests/offset/shape_type_i_c/B2
tests/offset/shape_type_i_c/B3
tests/offset/shape_type_i_c/B4
tests/offset/shape_type_i_c/B5
tests/offset/shape_type_i_c/B6
tests/offset/shape_type_i_c/B7
tests/offset/shape_type_i_c/B8
tests/offset/shape_type_i_c/B9
tests/offset/shape_type_i_c/C1
tests/offset/shape_type_i_c/C2
tests/offset/shape_type_i_c/C3
tests/offset/shape_type_i_c/C4
tests/offset/shape_type_i_c/C5
tests/offset/shape_type_i_c/C6
tests/offset/shape_type_i_c/C7
tests/offset/shape_type_i_c/C8
tests/offset/shape_type_i_c/C9
tests/offset/shape_type_i_c/D1
tests/offset/shape_type_i_c/D2
tests/offset/shape_type_i_c/D3
tests/offset/shape_type_i_c/D4
tests/offset/shape_type_i_c/D5
tests/offset/shape_type_i_c/D6
tests/offset/shape_type_i_c/D7
tests/offset/shape_type_i_c/D8
tests/offset/shape_type_i_c/D9
tests/offset/shape_type_i_c/E1
tests/offset/shape_type_i_c/E2
tests/offset/shape_type_i_c/E3
tests/offset/shape_type_i_c/E4
tests/offset/shape_type_i_c/E5
tests/offset/shape_type_i_c/E6
tests/offset/shape_type_i_c/E7
tests/offset/shape_type_i_c/E8
tests/offset/shape_type_i_c/E9
tests/offset/shape_type_i_c/F1
tests/offset/shape_type_i_c/F2
tests/offset/shape_type_i_c/F3
tests/offset/shape_type_i_c/F4
tests/offset/shape_type_i_c/F5
tests/offset/shape_type_i_c/F6
tests/offset/shape_type_i_c/F7
tests/offset/shape_type_i_c/F8
tests/offset/shape_type_i_c/F9
tests/offset/shape_type_i_c/G1
tests/offset/shape_type_i_c/G2
tests/offset/shape_type_i_c/G3
tests/offset/shape_type_i_c/G4
tests/offset/shape_type_i_c/G5
tests/offset/shape_type_i_c/G6
tests/offset/shape_type_i_c/G7
tests/offset/shape_type_i_c/G8
tests/offset/shape_type_i_c/G9
tests/offset/shape_type_i_c/H1
tests/offset/shape_type_i_c/H2
tests/offset/shape_type_i_c/H3
tests/offset/shape_type_i_c/H4
tests/offset/shape_type_i_c/H5
tests/offset/shape_type_i_c/H6
tests/offset/shape_type_i_c/H7
tests/offset/shape_type_i_c/H8
tests/offset/shape_type_i_c/H9
tests/offset/shape_type_i_c/I1
tests/offset/shape_type_i_c/I2
tests/offset/shape_type_i_c/I3
tests/offset/shape_type_i_c/I4
tests/offset/shape_type_i_c/I5
tests/offset/shape_type_i_c/I6
tests/offset/shape_type_i_c/I7
tests/offset/shape_type_i_c/I8
tests/offset/shape_type_i_c/I9
tests/offset/shape_type_i_c/J1 [new file with mode: 0644]
tests/offset/shape_type_i_c/J2
tests/offset/shape_type_i_c/J3
tests/offset/shape_type_i_c/J4
tests/offset/shape_type_i_c/J5
tests/offset/shape_type_i_c/J6
tests/offset/shape_type_i_c/J7
tests/offset/shape_type_i_c/J8
tests/offset/shape_type_i_c/J9
tests/offset/shape_type_i_c/K1
tests/offset/shape_type_i_c/K2
tests/offset/shape_type_i_c/K3
tests/offset/shape_type_i_c/K4
tests/offset/shape_type_i_c/K5
tests/offset/shape_type_i_c/K6
tests/offset/shape_type_i_c/K7
tests/offset/shape_type_i_c/K8
tests/offset/shape_type_i_c/K9
tests/offset/shape_type_i_c/L1
tests/offset/shape_type_i_c/L2
tests/offset/shape_type_i_c/L3
tests/offset/shape_type_i_c/L4
tests/offset/shape_type_i_c/L5
tests/offset/shape_type_i_c/L6
tests/offset/shape_type_i_c/L7
tests/offset/shape_type_i_c/L8
tests/offset/shape_type_i_c/L9
tests/offset/shape_type_i_c/M1
tests/offset/shape_type_i_c/M2
tests/offset/shape_type_i_c/M3
tests/offset/shape_type_i_c/M4
tests/offset/shape_type_i_c/M5
tests/offset/shape_type_i_c/M6
tests/offset/shape_type_i_c/M7
tests/offset/shape_type_i_c/M8
tests/offset/shape_type_i_c/M9
tests/offset/shape_type_i_c/N1
tests/offset/shape_type_i_c/N2
tests/offset/shape_type_i_c/N3
tests/offset/shape_type_i_c/N4
tests/offset/shape_type_i_c/N5
tests/offset/shape_type_i_c/N6
tests/offset/shape_type_i_c/N7
tests/offset/shape_type_i_c/N8
tests/offset/shape_type_i_c/N9
tests/offset/shape_type_i_c/O1
tests/offset/shape_type_i_c/O2
tests/offset/shape_type_i_c/O3
tests/offset/shape_type_i_c/O4
tests/offset/shape_type_i_c/O5
tests/offset/shape_type_i_c/O6
tests/offset/shape_type_i_c/O7
tests/offset/shape_type_i_c/O8
tests/offset/shape_type_i_c/O9
tests/offset/shape_type_i_c/P1
tests/offset/shape_type_i_c/P2
tests/offset/shape_type_i_c/P3
tests/offset/shape_type_i_c/P4
tests/offset/shape_type_i_c/P5
tests/offset/shape_type_i_c/P6
tests/offset/shape_type_i_c/P7
tests/offset/shape_type_i_c/P8 [new file with mode: 0644]
tests/offset/shape_type_i_c/P9 [new file with mode: 0644]
tests/offset/shape_type_i_c/Q1 [new file with mode: 0644]
tests/offset/shape_type_i_c/Q2 [new file with mode: 0644]
tests/offset/shape_type_i_c/Q3 [new file with mode: 0644]
tests/offset/shape_type_i_c/Q4 [new file with mode: 0644]
tests/offset/shape_type_i_c/Q5 [new file with mode: 0644]
tests/offset/shape_type_i_c/Q6 [new file with mode: 0644]
tests/offset/shape_type_i_c/Q7 [new file with mode: 0644]
tests/offset/shape_type_i_c/Q8 [new file with mode: 0644]
tests/offset/shape_type_i_c/Q9 [new file with mode: 0755]
tests/offset/shape_type_i_c/R1 [new file with mode: 0644]
tests/offset/shape_type_i_c/R2 [new file with mode: 0644]
tests/offset/shape_type_i_c/R3 [new file with mode: 0644]
tests/offset/shape_type_i_c/R4 [new file with mode: 0644]
tests/offset/shape_type_i_c/R5 [new file with mode: 0644]
tests/offset/shape_type_i_c/R6 [new file with mode: 0644]
tests/offset/shape_type_i_c/R7 [new file with mode: 0644]
tests/offset/shape_type_i_c/R8 [new file with mode: 0644]
tests/offset/shape_type_i_c/R9 [new file with mode: 0644]
tests/offset/shape_type_i_c/S1 [new file with mode: 0644]
tests/offset/shape_type_i_c/S2 [new file with mode: 0644]
tests/offset/shape_type_i_c/S3 [new file with mode: 0644]
tests/offset/shape_type_i_c/S4 [new file with mode: 0644]
tests/offset/shape_type_i_c/S5 [new file with mode: 0644]
tests/offset/shape_type_i_c/S6 [new file with mode: 0644]
tests/offset/shape_type_i_c/S7 [new file with mode: 0644]
tests/offset/shape_type_i_c/S8 [new file with mode: 0644]
tests/offset/shape_type_i_c/S9 [new file with mode: 0644]
tests/offset/shape_type_i_c/T1 [new file with mode: 0644]
tests/offset/shape_type_i_c/T2 [new file with mode: 0644]
tests/offset/shape_type_i_c/T3 [new file with mode: 0644]
tests/offset/shape_type_i_c/T4 [new file with mode: 0644]
tests/offset/shape_type_i_c/T5 [new file with mode: 0644]
tests/offset/shape_type_i_c/T6 [new file with mode: 0644]
tests/offset/shape_type_i_c/T7 [new file with mode: 0644]
tests/offset/shape_type_i_c/T8 [new file with mode: 0644]
tests/offset/shape_type_i_c/T9 [new file with mode: 0644]
tests/offset/shape_type_i_c/U1 [new file with mode: 0644]
tests/offset/shape_type_i_c/U2 [new file with mode: 0644]
tests/offset/shape_type_i_c/U3 [new file with mode: 0644]
tests/offset/shape_type_i_c/U4 [new file with mode: 0644]
tests/offset/shape_type_i_c/U5 [new file with mode: 0644]
tests/offset/shape_type_i_c/U6 [new file with mode: 0755]
tests/offset/shape_type_i_c/U7 [new file with mode: 0644]
tests/offset/shape_type_i_c/U8 [new file with mode: 0644]
tests/offset/shape_type_i_c/U9 [new file with mode: 0644]
tests/offset/shape_type_i_c/V1 [new file with mode: 0644]
tests/offset/shape_type_i_c/V2 [new file with mode: 0644]
tests/offset/shape_type_i_c/V3 [new file with mode: 0644]
tests/offset/shape_type_i_c/V4 [new file with mode: 0644]
tests/offset/shape_type_i_c/V5 [new file with mode: 0644]
tests/offset/shape_type_i_c/V6 [new file with mode: 0644]
tests/offset/shape_type_i_c/V7 [new file with mode: 0644]
tests/offset/shape_type_i_c/V8 [new file with mode: 0644]
tests/offset/shape_type_i_c/V9 [new file with mode: 0644]
tests/offset/shape_type_i_c/W1 [new file with mode: 0644]
tests/offset/shape_type_i_c/W2 [new file with mode: 0644]
tests/offset/shape_type_i_c/W3 [new file with mode: 0644]
tests/offset/shape_type_i_c/W4 [new file with mode: 0644]
tests/offset/shape_type_i_c/W5 [new file with mode: 0644]
tests/offset/shape_type_i_c/W6 [new file with mode: 0644]
tests/offset/shape_type_i_c/W7 [new file with mode: 0644]
tests/offset/shape_type_i_c/W8 [new file with mode: 0644]
tests/offset/shape_type_i_c/W9 [new file with mode: 0644]
tests/offset/shape_type_i_c/X1
tests/offset/shape_type_i_c/X2
tests/offset/shape_type_i_c/X3
tests/offset/shape_type_i_c/X4
tests/offset/shape_type_i_c/X5
tests/offset/shape_type_i_c/X6
tests/offset/shape_type_i_c/XA1 [new file with mode: 0644]
tests/offset/shape_type_i_c/XA2 [new file with mode: 0644]
tests/offset/shape_type_i_c/XA3 [new file with mode: 0644]
tests/offset/shape_type_i_c/XA4 [new file with mode: 0644]
tests/offset/shape_type_i_c/XA5 [new file with mode: 0644]
tests/offset/shape_type_i_c/XA6 [new file with mode: 0644]
tests/offset/shape_type_i_c/XA7 [new file with mode: 0644]
tests/offset/shape_type_i_c/XA8 [new file with mode: 0644]
tests/offset/shape_type_i_c/XA9 [new file with mode: 0644]
tests/offset/shape_type_i_c/XB1 [new file with mode: 0644]
tests/offset/shape_type_i_c/XB2 [new file with mode: 0644]
tests/offset/shape_type_i_c/XB3 [new file with mode: 0644]
tests/offset/shape_type_i_c/XB4 [new file with mode: 0644]
tests/offset/shape_type_i_c/XB5 [new file with mode: 0644]
tests/offset/shape_type_i_c/XB6 [new file with mode: 0644]
tests/offset/shape_type_i_c/XB7 [new file with mode: 0644]
tests/offset/shape_type_i_c/XB8 [new file with mode: 0644]
tests/offset/shape_type_i_c/XB9 [new file with mode: 0644]
tests/offset/shape_type_i_c/XC1 [new file with mode: 0644]
tests/offset/shape_type_i_c/XC2 [new file with mode: 0755]
tests/offset/shape_type_i_c/XC3 [new file with mode: 0644]
tests/offset/shape_type_i_c/XC4 [new file with mode: 0644]
tests/offset/shape_type_i_c/XC5 [new file with mode: 0644]
tests/offset/shape_type_i_c/XC6 [new file with mode: 0644]
tests/offset/shape_type_i_c/XC7 [new file with mode: 0644]
tests/offset/shape_type_i_c/XC8 [new file with mode: 0644]
tests/offset/shape_type_i_c/XC9 [new file with mode: 0644]
tests/offset/shape_type_i_c/XD1 [new file with mode: 0644]
tests/offset/shape_type_i_c/XD2 [new file with mode: 0644]
tests/offset/shape_type_i_c/XD3 [new file with mode: 0755]
tests/offset/shape_type_i_c/XD4 [new file with mode: 0644]
tests/offset/shape_type_i_c/XD5 [new file with mode: 0644]
tests/offset/shape_type_i_c/XD6 [new file with mode: 0644]
tests/offset/shape_type_i_c/XD7 [new file with mode: 0644]
tests/offset/shape_type_i_c/XD8 [new file with mode: 0644]
tests/offset/shape_type_i_c/XD9 [new file with mode: 0644]
tests/offset/shape_type_i_c/XE1 [new file with mode: 0644]
tests/offset/shape_type_i_c/XE2 [new file with mode: 0644]
tests/offset/shape_type_i_c/XE3 [new file with mode: 0644]
tests/offset/shape_type_i_c/XE4 [new file with mode: 0644]
tests/offset/shape_type_i_c/XE5 [new file with mode: 0644]
tests/offset/shape_type_i_c/XE6 [new file with mode: 0644]
tests/offset/shape_type_i_c/XE7 [new file with mode: 0644]
tests/offset/shape_type_i_c/XE8 [new file with mode: 0644]
tests/offset/shape_type_i_c/XE9 [new file with mode: 0644]
tests/offset/shape_type_i_c/XF1 [new file with mode: 0644]
tests/offset/shape_type_i_c/XF2 [new file with mode: 0644]
tests/offset/shape_type_i_c/XF3 [new file with mode: 0644]
tests/offset/shape_type_i_c/XF4 [new file with mode: 0644]
tests/offset/shape_type_i_c/XF5 [new file with mode: 0644]
tests/offset/shape_type_i_c/XF6 [new file with mode: 0644]
tests/offset/shape_type_i_c/XF7 [new file with mode: 0644]
tests/offset/shape_type_i_c/XF8 [new file with mode: 0644]
tests/offset/shape_type_i_c/XF9 [new file with mode: 0644]
tests/offset/shape_type_i_c/XG1 [new file with mode: 0644]
tests/offset/shape_type_i_c/XG2 [new file with mode: 0644]
tests/offset/shape_type_i_c/XG3 [new file with mode: 0644]
tests/offset/shape_type_i_c/XG4 [new file with mode: 0644]
tests/offset/shape_type_i_c/XG5 [new file with mode: 0644]
tests/offset/shape_type_i_c/XG6 [new file with mode: 0644]
tests/offset/shape_type_i_c/XG7 [new file with mode: 0644]
tests/offset/shape_type_i_c/XG8 [new file with mode: 0644]
tests/offset/shape_type_i_c/XG9 [new file with mode: 0644]
tests/offset/shape_type_i_c/XH1 [new file with mode: 0644]
tests/offset/shape_type_i_c/XH2 [new file with mode: 0644]
tests/offset/shape_type_i_c/XH3 [new file with mode: 0644]
tests/offset/shape_type_i_c/XH4 [new file with mode: 0644]
tests/offset/shape_type_i_c/XH5 [new file with mode: 0644]
tests/offset/shape_type_i_c/XH6 [new file with mode: 0644]
tests/offset/shape_type_i_c/XH7 [new file with mode: 0644]
tests/offset/shape_type_i_c/XH8 [new file with mode: 0644]
tests/offset/shape_type_i_c/XH9 [new file with mode: 0644]
tests/offset/shape_type_i_c/XI1 [new file with mode: 0644]
tests/offset/shape_type_i_c/XI2 [new file with mode: 0644]
tests/offset/shape_type_i_c/XI3 [new file with mode: 0644]
tests/offset/shape_type_i_c/XI4 [new file with mode: 0755]
tests/offset/shape_type_i_c/XI5 [new file with mode: 0644]
tests/offset/shape_type_i_c/XI6 [new file with mode: 0644]
tests/offset/shape_type_i_c/XI7 [new file with mode: 0644]
tests/offset/shape_type_i_c/XI8 [new file with mode: 0644]
tests/offset/shape_type_i_c/XI9 [new file with mode: 0644]
tests/offset/shape_type_i_c/XJ1 [new file with mode: 0644]
tests/offset/shape_type_i_c/XJ2 [new file with mode: 0755]
tests/offset/shape_type_i_c/XJ3 [new file with mode: 0644]
tests/offset/shape_type_i_c/XJ4 [new file with mode: 0644]
tests/offset/shape_type_i_c/XJ5 [new file with mode: 0644]
tests/offset/shape_type_i_c/XJ6 [new file with mode: 0644]
tests/offset/shape_type_i_c/XJ7 [new file with mode: 0644]
tests/offset/shape_type_i_c/XJ8 [new file with mode: 0644]
tests/offset/shape_type_i_c/XJ9 [new file with mode: 0644]
tests/offset/shape_type_i_c/XK1 [new file with mode: 0644]
tests/offset/shape_type_i_c/XK2 [new file with mode: 0644]
tests/offset/shape_type_i_c/Y1 [new file with mode: 0644]
tests/offset/shape_type_i_c/Y2 [new file with mode: 0644]
tests/offset/shape_type_i_c/Y3 [new file with mode: 0644]
tests/offset/shape_type_i_c/Y4 [new file with mode: 0644]
tests/offset/shape_type_i_c/Y5 [new file with mode: 0644]
tests/offset/shape_type_i_c/Y6 [new file with mode: 0644]
tests/offset/shape_type_i_c/Y7 [new file with mode: 0644]
tests/offset/shape_type_i_c/Y8 [new file with mode: 0644]
tests/offset/shape_type_i_c/Y9 [new file with mode: 0644]
tests/offset/shape_type_i_c/Z1 [new file with mode: 0644]
tests/offset/shape_type_i_c/Z2 [new file with mode: 0644]
tests/offset/shape_type_i_c/Z3 [new file with mode: 0644]
tests/offset/shape_type_i_c/Z4 [new file with mode: 0644]
tests/offset/shape_type_i_c/Z5 [new file with mode: 0644]
tests/offset/shape_type_i_c/Z6 [new file with mode: 0644]
tests/offset/shape_type_i_c/Z7 [new file with mode: 0644]
tests/offset/shape_type_i_c/Z8 [new file with mode: 0644]
tests/offset/shape_type_i_c/Z9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZA1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZA2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZA3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZA4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZA5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZA6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZA7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZA8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZA9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZB1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZB2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZB3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZB4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZB5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZB6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZB7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZB8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZB9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZC1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZC2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZC3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZC4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZC5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZC6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZC7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZC8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZC9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZD1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZD2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZD3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZD4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZD5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZD6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZD7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZD8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZD9 [new file with mode: 0755]
tests/offset/shape_type_i_c/ZE1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZE2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZE3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZE4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZE5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZE6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZE7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZE8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZE9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZF1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZF2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZF3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZF4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZF5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZF6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZF7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZF8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZF9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZG1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZG2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZG3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZG4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZG5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZG6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZG7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZG8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZG9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZH1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZH2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZH3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZH4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZH5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZH6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZH7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZH8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZH9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZI1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZI2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZI3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZI4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZI5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZI6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZI7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZI8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZI9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZJ1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZJ2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZJ3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZJ4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZJ5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZJ6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZJ7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZJ8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZJ9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZK1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZK2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZK3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZK4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZK5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZK6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZK7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZK8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZK9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZL1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZL2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZL3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZL4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZL5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZL6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZL7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZL8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZL9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZM1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZM2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZM3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZM4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZM5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZM6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZM7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZM8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZM9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZN1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZN2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZN3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZN4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZN5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZN6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZN7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZN8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZN9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZO1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZO2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZO3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZO4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZO5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZO6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZO7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZO8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZO9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZP1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZP2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZP3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZP4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZP5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZP6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZP7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZP8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZP9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZQ1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZQ2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZQ3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZQ4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZQ5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZQ6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZQ7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZQ8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZQ9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZR1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZR2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZR3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZR4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZR5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZR6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZR7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZR8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZR9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZS1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZS2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZS3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZS4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZS5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZS6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZS7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZS8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZS9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZT1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZT2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZT3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZT4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZT5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZT6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZT7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZT8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZT9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZU1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZU2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZU3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZU4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZU5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZU6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZU7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZU8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZU9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZV1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZV2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZV3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZV4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZV5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZV6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZV7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZV8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZV9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZW1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZW2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZW3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZW4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZW5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZW6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZW7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZW8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZW9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZX1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZX2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZX3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZX4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZX5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZX6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZX7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZX8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZX9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZY1 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZY2 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZY3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZY4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZY5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZY6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZY7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZY8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZY9 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZZ1 [new file with mode: 0755]
tests/offset/shape_type_i_c/ZZ2 [new file with mode: 0755]
tests/offset/shape_type_i_c/ZZ3 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZZ4 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZZ5 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZZ6 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZZ7 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZZ8 [new file with mode: 0644]
tests/offset/shape_type_i_c/ZZ9 [new file with mode: 0644]

index 7d07bbcf3a21e15ee35bcdbf9983884740b21a47..bf88a8b77227ef6689887b0e4a17fe89dc486b03 100644 (file)
@@ -176,7 +176,11 @@ void BOPAlgo_Builder::PrepareHistory()
   aItM.Initialize(aMS);
   for (; aItM.More(); aItM.Next()) {
     const TopoDS_Shape& aSx=aItM.Key();
-    aType=aSx.ShapeType();
+    aType = aSx.ShapeType();
+    if (!(aType == TopAbs_VERTEX || aType == TopAbs_EDGE || 
+          aType == TopAbs_FACE   || aType == TopAbs_SOLID)) {
+      continue;
+    }
     //
     // 4.1 .myImagesResult
     bHasImage=myImages.IsBound(aSx); 
index 591dd30c5d76dfda3db598ca131f31fa3f88bbd0..38b7be516ce96c3aa1a6028fb170ad7d60fb077d 100644 (file)
@@ -228,7 +228,6 @@ void BOPAlgo_PaveFiller::PerformFF()
       //
       bToIntersect = CheckPlanes(nF1, nF2);
       if (!bToIntersect) {
-        myDS->AddInterf(nF1, nF2);
         BOPDS_InterfFF& aFF=aFFs.Append1();
         aFF.SetIndices(nF1, nF2);
         aFF.Init(0, 0);
index 8dd871629ba2361042be4a70d89924bc5c942a7b..6aee96cc1c4e01ae775cfec1e30328a8ac388bb7 100644 (file)
@@ -150,8 +150,12 @@ void BOPTools_AlgoTools::MakeSplitEdge(const TopoDS_Edge&   aE,
   E.EmptyCopy();
   //
   BRep_Builder BB;
-  BB.Add  (E, aV1);
-  BB.Add  (E, aV2);
+  if (!aV1.IsNull()) {
+    BB.Add  (E, aV1);
+  }
+  if (!aV2.IsNull()) {
+    BB.Add  (E, aV2);
+  }
   BB.Range(E, aP1, aP2);
   BB.UpdateEdge(E, aTol);
   aNewEdge=E;
index 016e09f3af2ec2e1ca04cfb613511090d108a503..778e7d97bd4c4f0a69004bd120e6a268e52d53a2 100644 (file)
@@ -115,84 +115,115 @@ static TopoDS_Vertex CommonVertex(TopoDS_Edge& E1,
 
 //=======================================================================
 //function : Store
-//purpose  : The vertices are added despite of the coincidence with
+//purpose  : Store the vertices <theLV> into AsDes for the edge <theEdge>.
+//           The vertices are added despite of the coincidence with
 //           already added vertices. When all vertices for all edges
 //           are added the coinciding chains of vertices should be fused
 //           using FuseVertices() method.
 //=======================================================================
-static void  Store (const TopoDS_Edge&     E1,
-                    const TopoDS_Edge&     E2,
-                    const TopTools_ListOfShape&  LV1,
-                    const TopTools_ListOfShape&  LV2,
-                    Handle(BRepAlgo_AsDes) AsDes,
-                    Standard_Real          Tol,
-                    TopTools_IndexedDataMapOfShapeListOfShape& aDMVV)
+static void Store(const TopoDS_Edge& theEdge,
+                  const TopTools_ListOfShape& theLV,
+                  const Standard_Real theTol,
+                  const Standard_Boolean IsToUpdate,
+                  Handle(BRepAlgo_AsDes) theAsDes2d,
+                  TopTools_IndexedDataMapOfShapeListOfShape& theDMVV)
 {
-  BRep_Builder aBB;
-  for (Standard_Integer i = 0; i < 2; ++i) {
-    const TopoDS_Edge& aE = !i ? E1 : E2;
-    const TopTools_ListOfShape& aLV = !i ? LV1 : LV2;
-    const TopTools_ListOfShape& aLVEx = AsDes->Descendant(aE);
-    if (aLVEx.IsEmpty()) {
-      if (aLV.Extent()) AsDes->Add(aE, aLV);
+  const TopTools_ListOfShape& aLVEx = theAsDes2d->Descendant(theEdge);
+  if (!IsToUpdate && aLVEx.IsEmpty()) {
+    if (theLV.Extent()) theAsDes2d->Add(theEdge, theLV);
+    return;
+  }
+  //
+  GeomAPI_ProjectPointOnCurve aProjPC;
+  if (IsToUpdate) {
+    Standard_Real aT1, aT2;
+    const Handle(Geom_Curve)& aC = BRep_Tool::Curve(theEdge, aT1, aT2);
+    aProjPC.Init(aC, aT1, aT2);
+  }
+  //
+  TopTools_MapOfShape aMV;
+  TopTools_ListIteratorOfListOfShape aIt(theLV);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Vertex& aV = TopoDS::Vertex(aIt.Value());
+    if (!aMV.Add(aV)) {
       continue;
     }
     //
-    TopTools_MapOfShape aMV;
-    TopTools_ListIteratorOfListOfShape aIt(aLV);
-    for (; aIt.More(); aIt.Next()) {
-      const TopoDS_Vertex& aV = TopoDS::Vertex(aIt.Value());
-      if (!aMV.Add(aV)) {
-        continue;
+    const gp_Pnt& aP = BRep_Tool::Pnt(aV);
+    //
+    TopTools_ListOfShape aLVC;
+    TopTools_ListIteratorOfListOfShape aItEx(aLVEx);
+    for (; aItEx.More(); aItEx.Next()) {
+      const TopoDS_Vertex& aVEx = TopoDS::Vertex(aItEx.Value());
+      if (aV.IsSame(aVEx)) {
+        break;
       }
-      gp_Pnt aP = BRep_Tool::Pnt(aV);
-      //
-      TopTools_ListOfShape aLVC;
-      TopTools_ListIteratorOfListOfShape aItEx(aLVEx);
-      for (; aItEx.More(); aItEx.Next()) {
-        const TopoDS_Vertex& aVEx = TopoDS::Vertex(aItEx.Value());
-        if (aV.IsSame(aVEx)) {
-          break;
-        }
-        gp_Pnt aPEx = BRep_Tool::Pnt(aVEx);
-        //
-        if (aP.IsEqual(aPEx, Tol)) {
-          aLVC.Append(aVEx);
-        }
+      const gp_Pnt& aPEx = BRep_Tool::Pnt(aVEx);
+      if (aP.IsEqual(aPEx, theTol)) {
+        aLVC.Append(aVEx);
+      }
+    }
+    //
+    if (aItEx.More()) {
+      continue;
+    }
+    //
+    if (IsToUpdate) {
+      // get parameter of the vertex on the edge
+      aProjPC.Perform(aP);
+      if (!aProjPC.NbPoints()) {
+        continue;
       }
       //
-      if (aItEx.More()) {
+      if (aProjPC.LowerDistance() > theTol) {
         continue;
       }
       //
-      if (aLVC.Extent()) {
-        TopTools_ListOfShape aLVN;
-        aLVN.Append(aV);
-        //
-        TopTools_ListIteratorOfListOfShape aItLV(aLVC);
-        for (; aItLV.More(); aItLV.Next()) {
-          const TopoDS_Shape& aVC = aItLV.Value();
-          TopTools_ListOfShape* pLV = aDMVV.ChangeSeek(aVC);
-          if (!pLV) {
-            aDMVV.Add(aVC, aLVN);
-          }
-          else {
-            pLV->Append(aV);
-          }
-        }
-        //
-        TopTools_ListOfShape* pLV = aDMVV.ChangeSeek(aV);
+      Standard_Real aT = aProjPC.LowerDistanceParameter();
+      TopoDS_Shape aLocalShape = aV.Oriented(TopAbs_INTERNAL);
+      BRep_Builder().UpdateVertex(TopoDS::Vertex(aLocalShape), aT, theEdge, theTol);
+    }
+    else {
+      BRep_Builder().UpdateVertex(aV, theTol);
+    }
+    //
+    if (aLVC.Extent()) {
+      TopTools_ListIteratorOfListOfShape aItLV(aLVC);
+      for (; aItLV.More(); aItLV.Next()) {
+        const TopoDS_Shape& aVC = aItLV.Value();
+        TopTools_ListOfShape* pLV = theDMVV.ChangeSeek(aVC);
         if (!pLV) {
-          aDMVV.Add(aV, aLVC);
-        }
-        else {
-          pLV->Append(aLVC);
+          pLV = &theDMVV(theDMVV.Add(aVC, TopTools_ListOfShape()));
         }
+        pLV->Append(aV);
       }
       //
-      aBB.UpdateVertex(aV, Tol);
-      AsDes->Add(aE, aV);
+      TopTools_ListOfShape* pLV = theDMVV.ChangeSeek(aV);
+      if (!pLV) {
+        pLV = &theDMVV(theDMVV.Add(aV, TopTools_ListOfShape()));
+      }
+      pLV->Append(aLVC);
     }
+    theAsDes2d->Add(theEdge, aV);
+  }
+}
+
+//=======================================================================
+//function : Store
+//purpose  : Store the intersection vertices between two edges into AsDes
+//=======================================================================
+static void  Store (const TopoDS_Edge& theE1,
+                    const TopoDS_Edge& theE2,
+                    const TopTools_ListOfShape& theLV1,
+                    const TopTools_ListOfShape& theLV2,
+                    const Standard_Real theTol,
+                    Handle(BRepAlgo_AsDes) theAsDes2d,
+                    TopTools_IndexedDataMapOfShapeListOfShape& theDMVV)
+{
+  for (Standard_Integer i = 0; i < 2; ++i) {
+    const TopoDS_Edge& aE = !i ? theE1 : theE2;
+    const TopTools_ListOfShape& aLV = !i ? theLV1 : theLV2;
+    Store(aE, aLV, theTol, Standard_False, theAsDes2d, theDMVV);
   }
 }
 
@@ -453,7 +484,7 @@ static void EdgeInter(const TopoDS_Face&              F,
     //---------------------------------
     Standard_Real TolStore = BRep_Tool::Tolerance(E1) + BRep_Tool::Tolerance(E2);
     TolStore = Max(TolStore, 10.*Tol);
-    Store (E1,E2,LV1,LV2,AsDes,TolStore, aDMVV);
+    Store (E1,E2,LV1,LV2,TolStore,AsDes, aDMVV);
   }
 }
 //=======================================================================
@@ -469,7 +500,8 @@ static void RefEdgeInter(const TopoDS_Face&              F,
                          Standard_Real                   Tol,
                          Standard_Boolean                WithOri,
                          gp_Pnt&                         Pref,
-                         TopTools_IndexedDataMapOfShapeListOfShape& aDMVV)
+                         TopTools_IndexedDataMapOfShapeListOfShape& aDMVV,
+                         Standard_Boolean&               theCoincide)
 {
 #ifdef DRAW
   if (Inter2dAffichInt2d) {
@@ -480,7 +512,9 @@ static void RefEdgeInter(const TopoDS_Face&              F,
     DBRep::Set(name,E2);
   }
 #endif
-
+  //
+  theCoincide = Standard_False;
+  //
   if (E1.IsSame(E2))
     return;
 
@@ -531,6 +565,14 @@ static void RefEdgeInter(const TopoDS_Face&              F,
   Geom2dAdaptor_Curve GAC1(pcurve1, f[1], l[1]);
   Geom2dAdaptor_Curve GAC2(pcurve2, f[2], l[2]);
   Geom2dInt_GInter Inter2d( GAC1, GAC2, TolDub, TolDub );
+  //
+  if (!Inter2d.IsDone() || !Inter2d.NbPoints()) {
+    theCoincide = (Inter2d.NbSegments() &&
+                  (GAC1.GetType() == GeomAbs_Line) &&
+                  (GAC2.GetType() == GeomAbs_Line));
+    return;
+  }
+  //
   for (i = 1; i <= Inter2d.NbPoints(); i++)
     {
       gp_Pnt P3d;
@@ -723,7 +765,7 @@ static void RefEdgeInter(const TopoDS_Face&              F,
 ////-----------------------------------------------------
     Standard_Real TolStore = BRep_Tool::Tolerance(E1) + BRep_Tool::Tolerance(E2);
     TolStore = Max(TolStore, 10.*Tol);
-    Store (E1,E2,LV1,LV2,AsDes,TolStore, aDMVV);
+    Store (E1,E2,LV1,LV2,TolStore,AsDes, aDMVV);
   }
 }
 
@@ -848,7 +890,7 @@ static Standard_Boolean ExtendPCurve(const Handle(Geom2d_Curve)& aPCurve,
 
 //  Modified by skv - Fri Dec 26 17:00:55 2003 OCC4455 Begin
 //static void ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE) 
-static void ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const Standard_Real theOffset)
+void BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const Standard_Real theOffset)
 {
   //BRepLib::BuildCurve3d(E);
 
@@ -1380,20 +1422,16 @@ void BRepOffset_Inter2d::Compute (const Handle(BRepAlgo_AsDes)&     AsDes,
 //function : ConnexIntByInt
 //purpose  : 
 //=======================================================================
-
-//  Modified by skv - Fri Dec 26 16:53:16 2003 OCC4455 Begin
-//  Add another parameter: offset value.
 void BRepOffset_Inter2d::ConnexIntByInt
-(const TopoDS_Face&            FI,
- BRepOffset_Offset&            OFI,
- TopTools_DataMapOfShapeShape& MES,
- const TopTools_DataMapOfShapeShape& Build,
- const Handle(BRepAlgo_AsDes)& AsDes,
- const Handle(BRepAlgo_AsDes)& AsDes2d,
- const Standard_Real           Offset,
- const Standard_Real           Tol,
- TopTools_IndexedDataMapOfShapeListOfShape& theDMVV)
-//  Modified by skv - Fri Dec 26 16:53:18 2003 OCC4455 End
+ (const TopoDS_Face&            FI,
+  BRepOffset_Offset&            OFI,
+  TopTools_DataMapOfShapeShape& MES,
+  const TopTools_DataMapOfShapeShape& Build,
+  const Handle(BRepAlgo_AsDes)& AsDes2d,
+  const Standard_Real           Offset,
+  const Standard_Real           Tol,
+  TopTools_IndexedMapOfShape&   FacesWithVerts,
+  TopTools_IndexedDataMapOfShapeListOfShape& theDMVV)
 {  
 
   TopTools_DataMapOfShapeListOfShape MVE;
@@ -1417,12 +1455,8 @@ void BRepOffset_Inter2d::ConnexIntByInt
         const TopoDS_Edge& EI = TopoDS::Edge(itL.Value());
         TopoDS_Shape aLocalShape = OFI.Generated(EI);
         const TopoDS_Edge& OE = TopoDS::Edge(aLocalShape);
-//        const TopoDS_Edge& OE = TopoDS::Edge(OFI.Generated(EI));
         if (!MES.IsBound(OE) && !Build.IsBound(EI)) {
-//  Modified by skv - Fri Dec 26 16:59:52 2003 OCC4455 Begin
-//          ExtentEdge(OE,NE);
           ExtentEdge(OE,NE, Offset);
-//  Modified by skv - Fri Dec 26 16:59:54 2003 OCC4455 End
           MES.Bind  (OE,NE);
         }
       }
@@ -1432,14 +1466,6 @@ void BRepOffset_Inter2d::ConnexIntByInt
   TopoDS_Face           FIO = TopoDS::Face(OFI.Face());
   if (MES.IsBound(FIO)) FIO = TopoDS::Face(MES(FIO));
   //
-  TopTools_MapOfShape aME;
-  const TopTools_ListOfShape& aLE = AsDes->Descendant(FIO);
-  TopTools_ListIteratorOfListOfShape aItLE(aLE);
-  for (; aItLE.More(); aItLE.Next()) {
-    const TopoDS_Shape& aE = aItLE.Value();
-    aME.Add(aE);
-  }
-  //
   BRepAdaptor_Surface BAsurf(FIO);
   
   TopExp_Explorer exp(FI.Oriented(TopAbs_FORWARD),TopAbs_WIRE);
@@ -1454,8 +1480,6 @@ void BRepOffset_Inter2d::ConnexIntByInt
     wexp.Init(TopoDS::Wire(aLocalWire),TopoDS::Face(aLocalFace));
     if (!wexp.More())
       continue; // Protection from case when explorer does not contain edges.
-//    wexp.Init(TopoDS::Wire(W .Oriented(TopAbs_FORWARD)),
-//              TopoDS::Face(FI.Oriented(TopAbs_FORWARD)));
     CurE = FirstE  = wexp.Current(); 
     while (!end) {
       wexp.Next();
@@ -1467,17 +1491,13 @@ void BRepOffset_Inter2d::ConnexIntByInt
       }
       if (CurE.IsSame(NextE)) continue;
 
-      //IFV------------
       TopoDS_Vertex Vref = CommonVertex(CurE, NextE); 
       gp_Pnt Pref = BRep_Tool::Pnt(Vref);
-      //IFV------------
 
       TopoDS_Shape aLocalShape = OFI.Generated(CurE);
       TopoDS_Edge CEO = TopoDS::Edge(aLocalShape);
       aLocalShape = OFI.Generated(NextE);
       TopoDS_Edge NEO = TopoDS::Edge(aLocalShape);
-//      TopoDS_Edge CEO = TopoDS::Edge(OFI.Generated(CurE));
-//      TopoDS_Edge NEO = TopoDS::Edge(OFI.Generated(NextE));
       //------------------------------------------
       // Inter processing of images of CurE NextE.
       //------------------------------------------
@@ -1490,7 +1510,7 @@ void BRepOffset_Inter2d::ConnexIntByInt
         NE2 = Build(NextE);
       }
       else if (Build.IsBound(CurE) && MES.IsBound(NEO)) {
-         NE1 = Build(CurE);
+        NE1 = Build(CurE);
         NE2 = MES  (NEO);
       }
       else if (Build.IsBound(NextE) && MES.IsBound(CEO)) {
@@ -1504,43 +1524,31 @@ void BRepOffset_Inter2d::ConnexIntByInt
         //------------------------------------
         // NE1,NE2 can be a compound of Edges.
         //------------------------------------
-        TopExp_Explorer Exp1,Exp2;
-        for (Exp1.Init(NE1,TopAbs_EDGE) ; Exp1.More(); Exp1.Next()) {
-          for (Exp2.Init(NE2,TopAbs_EDGE) ; Exp2.More(); Exp2.Next()) {
-            RefEdgeInter(FIO,BAsurf,TopoDS::Edge(Exp1.Current()),TopoDS::Edge(Exp2.Current()),
-                      AsDes2d,Tol,Standard_True/*Standard_False*/, Pref, theDMVV);
+        Standard_Boolean bCoincide;
+        TopExp_Explorer Exp1, Exp2;
+        for (Exp1.Init(NE1, TopAbs_EDGE); Exp1.More(); Exp1.Next()) {
+          const TopoDS_Edge& aE1 = TopoDS::Edge(Exp1.Current());
+          for (Exp2.Init(NE2, TopAbs_EDGE); Exp2.More(); Exp2.Next()) {
+            const TopoDS_Edge& aE2 = TopoDS::Edge(Exp2.Current());
+            RefEdgeInter(FIO, BAsurf, aE1, aE2, AsDes2d,
+                         Tol, Standard_True, Pref, theDMVV, bCoincide);
           }
         }
         //
+        // check if some of the offset edges have been
+        // generated out of the common vertex
         if (Build.IsBound(Vref)) {
-          TopoDS_Shape NE3 = Build(Vref);
-          //
-          for (Exp2.Init(NE3,TopAbs_EDGE) ; Exp2.More(); Exp2.Next()) {
-            const TopoDS_Edge& aE3 = *(TopoDS_Edge*)&Exp2.Current();
-            if (!aME.Contains(aE3)) {
-              continue;
-            }
-            //
-            for (Exp1.Init(NE1,TopAbs_EDGE) ; Exp1.More(); Exp1.Next()) {
-              RefEdgeInter(FIO,BAsurf,TopoDS::Edge(Exp1.Current()),aE3,
-                           AsDes2d,Tol,Standard_True/*Standard_False*/, Pref, theDMVV);
-            }
-            //
-            for (Exp1.Init(NE2,TopAbs_EDGE) ; Exp1.More(); Exp1.Next()) {
-              RefEdgeInter(FIO,BAsurf,TopoDS::Edge(Exp1.Current()),aE3,
-                           AsDes2d,Tol,Standard_True/*Standard_False*/, Pref, theDMVV);
-            }
-          }
+          FacesWithVerts.Add(FI);
         }
       }
       else {
         if (MES.IsBound(CEO)) {
-          TopoDS_Vertex  V = CommonVertex(CEO,NEO); 
+          TopoDS_Vertex  V = CommonVertex(CEO,NEO);
           UpdateVertex  (V,CEO,TopoDS::Edge(MES(CEO)),Tol);
           AsDes2d->Add     (MES(CEO),V);
         }
         else if (MES.IsBound(NEO)) {
-          TopoDS_Vertex V = CommonVertex(CEO,NEO); 
+          TopoDS_Vertex V = CommonVertex(CEO,NEO);
           UpdateVertex (V,NEO,TopoDS::Edge(MES(NEO)),Tol);
           AsDes2d->Add    (MES(NEO),V);
         }
@@ -1550,6 +1558,143 @@ void BRepOffset_Inter2d::ConnexIntByInt
   }
 }
 
+//=======================================================================
+//function : ConnexIntByIntInVert
+//purpose  : Intersection of the edges generated out of vertices
+//=======================================================================
+void BRepOffset_Inter2d::ConnexIntByIntInVert
+ (const TopoDS_Face&            FI,
+  BRepOffset_Offset&            OFI,
+  TopTools_DataMapOfShapeShape& MES,
+  const TopTools_DataMapOfShapeShape& Build,
+  const Handle(BRepAlgo_AsDes)& AsDes,
+  const Handle(BRepAlgo_AsDes)& AsDes2d,
+  const Standard_Real           Tol,
+  TopTools_IndexedDataMapOfShapeListOfShape& theDMVV)
+{
+  TopoDS_Face           FIO = TopoDS::Face(OFI.Face());
+  if (MES.IsBound(FIO)) FIO = TopoDS::Face(MES(FIO));
+  //
+  TopTools_MapOfShape aME;
+  const TopTools_ListOfShape& aLE = AsDes->Descendant(FIO);
+  TopTools_ListIteratorOfListOfShape aItLE(aLE);
+  for (; aItLE.More(); aItLE.Next()) {
+    const TopoDS_Shape& aE = aItLE.Value();
+    aME.Add(aE);
+  }
+  //
+  BRepAdaptor_Surface BAsurf(FIO);
+  //
+  TopExp_Explorer exp(FI.Oriented(TopAbs_FORWARD),TopAbs_WIRE);
+  for (; exp.More(); exp.Next()) {
+    const TopoDS_Wire&     W = TopoDS::Wire(exp.Current());
+    //
+    BRepTools_WireExplorer wexp;
+    Standard_Boolean       end = Standard_False ;
+    TopoDS_Edge            FirstE,CurE,NextE;
+    //
+    TopoDS_Shape aLocalWire = W .Oriented(TopAbs_FORWARD);
+    TopoDS_Shape aLocalFace = FI.Oriented(TopAbs_FORWARD);
+    wexp.Init(TopoDS::Wire(aLocalWire),TopoDS::Face(aLocalFace));
+    if (!wexp.More())
+      continue; // Protection from case when explorer does not contain edges.
+    //
+    CurE = FirstE  = wexp.Current(); 
+    while (!end) {
+      wexp.Next();
+      if (wexp.More()) {
+        NextE = wexp.Current();
+      } 
+      else {
+        NextE = FirstE; end = Standard_True;
+      }
+      if (CurE.IsSame(NextE)) continue;
+      //
+      TopoDS_Vertex Vref = CommonVertex(CurE, NextE); 
+      gp_Pnt Pref = BRep_Tool::Pnt(Vref);
+      if (!Build.IsBound(Vref)) {
+        CurE = NextE;
+        continue;
+      }
+      //
+      TopoDS_Shape aLocalShape = OFI.Generated(CurE);
+      TopoDS_Edge CEO = TopoDS::Edge(aLocalShape);
+      aLocalShape = OFI.Generated(NextE);
+      TopoDS_Edge NEO = TopoDS::Edge(aLocalShape);
+      //
+      TopoDS_Shape         NE1,NE2;
+      
+      if (Build.IsBound(CurE) && Build.IsBound(NextE)) {
+        NE1 = Build(CurE );
+        NE2 = Build(NextE);
+      }
+      else if (Build.IsBound(CurE) && MES.IsBound(NEO)) {
+        NE1 = Build(CurE);
+        NE2 = MES  (NEO);
+      }
+      else if (Build.IsBound(NextE) && MES.IsBound(CEO)) {
+        NE1 = Build(NextE);
+        NE2 = MES(CEO);
+      }
+      else {
+        CurE = NextE;
+        continue;
+      }
+      //
+      TopExp_Explorer Exp1, Exp2;
+      Standard_Boolean bCoincide;
+      // intersect edges generated from vertex with the edges of the face
+      TopoDS_Shape NE3 = Build(Vref);
+      //
+      for (Exp2.Init(NE3, TopAbs_EDGE); Exp2.More(); Exp2.Next()) {
+        const TopoDS_Edge& aE3 = *(TopoDS_Edge*)&Exp2.Current();
+        if (!aME.Contains(aE3)) {
+          continue;
+        }
+        //
+        // intersection with first edge
+        for (Exp1.Init(NE1, TopAbs_EDGE); Exp1.More(); Exp1.Next()) {
+          const TopoDS_Edge& aE1 = TopoDS::Edge(Exp1.Current());
+          RefEdgeInter(FIO, BAsurf, aE1, aE3, AsDes2d,
+            Tol, Standard_True, Pref, theDMVV, bCoincide);
+          if (bCoincide) {
+            // in case of coincidence trim the edge E3 the same way as E1
+            Store(aE3, AsDes2d->Descendant(aE1), Tol, Standard_True, AsDes2d, theDMVV);
+          }
+        }
+        //
+        // intersection with second edge
+        for (Exp1.Init(NE2, TopAbs_EDGE); Exp1.More(); Exp1.Next()) {
+          const TopoDS_Edge& aE2 = TopoDS::Edge(Exp1.Current());
+          RefEdgeInter(FIO, BAsurf, aE2, aE3, AsDes2d,
+            Tol, Standard_True, Pref, theDMVV, bCoincide);
+          if (bCoincide) {
+            // in case of coincidence trim the edge E3 the same way as E2
+            Store(aE3, AsDes2d->Descendant(aE2), Tol, Standard_True, AsDes2d, theDMVV);
+          }
+        }
+        //
+        // intersection of the edges generated from vertex
+        // among themselves
+        for (Exp1.Init(NE3, TopAbs_EDGE); Exp1.More(); Exp1.Next()) {
+          if (aE3.IsSame(Exp1.Current())) {
+            break;
+          }
+        }
+        //
+        for (Exp1.Next(); Exp1.More(); Exp1.Next()) {
+          const TopoDS_Edge& aE3Next = TopoDS::Edge(Exp1.Current());
+          if (aME.Contains(aE3Next)) {
+            RefEdgeInter(FIO, BAsurf, aE3Next, aE3, AsDes2d,
+              Tol, Standard_True, Pref, theDMVV, bCoincide);
+          }
+        }
+      }
+      CurE = NextE;
+    }
+  }
+}
+
 //=======================================================================
 //function : MakeChain
 //purpose  : 
index 5254350863f6da5db6ed1ec29207fb68d3f0a371..4c0689027b520e209039d187eae29d75c6c3fd0b 100644 (file)
@@ -51,27 +51,45 @@ public:
                                        const Standard_Real Tol,
                                        TopTools_IndexedDataMapOfShapeListOfShape& theDMVV);
 
-  //! Computes the intersection between the offset edges
-  //! stored in AsDes as descendatnds on <F>. All intersection
-  //! vertices will be stored in AsDes2d. When all faces of the
-  //! shape are treated the intersection vertices have to be fused
-  //! using the FuseVertices method.
+  //! Computes the intersection between the offset edges of the <FI>.
+  //! All intersection vertices will be stored in AsDes2d.
+  //! When all faces of the shape are treated the intersection vertices
+  //! have to be fused using the FuseVertices method.
   //! theDMVV contains the vertices that should be fused.
-  Standard_EXPORT static void ConnexIntByInt (const TopoDS_Face& FI, 
-                                              BRepOffset_Offset& OFI, 
-                                              TopTools_DataMapOfShapeShape& MES, 
-                                              const TopTools_DataMapOfShapeShape& Build, 
-                                              const Handle(BRepAlgo_AsDes)& AsDes, 
-                                              const Handle(BRepAlgo_AsDes)& AsDes2d, 
-                                              const Standard_Real Offset, 
+  Standard_EXPORT static void ConnexIntByInt (const TopoDS_Face& FI,
+                                              BRepOffset_Offset& OFI,
+                                              TopTools_DataMapOfShapeShape& MES,
+                                              const TopTools_DataMapOfShapeShape& Build,
+                                              const Handle(BRepAlgo_AsDes)& AsDes2d,
+                                              const Standard_Real Offset,
                                               const Standard_Real Tol,
+                                              TopTools_IndexedMapOfShape& FacesWithVerts,
                                               TopTools_IndexedDataMapOfShapeListOfShape& theDMVV);
 
+  //! Computes the intersection between the offset edges generated
+  //! from vertices and stored into AsDes as descendants of the <FI>.
+  //! All intersection vertices will be stored in AsDes2d.
+  //! When all faces of the shape are treated the intersection vertices
+  //! have to be fused using the FuseVertices method.
+  //! theDMVV contains the vertices that should be fused.
+  Standard_EXPORT static void ConnexIntByIntInVert (const TopoDS_Face& FI,
+                                                    BRepOffset_Offset& OFI,
+                                                    TopTools_DataMapOfShapeShape& MES,
+                                                    const TopTools_DataMapOfShapeShape& Build,
+                                                    const Handle(BRepAlgo_AsDes)& AsDes,
+                                                    const Handle(BRepAlgo_AsDes)& AsDes2d,
+                                                    const Standard_Real Tol,
+                                                    TopTools_IndexedDataMapOfShapeListOfShape& theDMVV);
+
   //! Fuses the chains of vertices in the theDMVV
   //! and updates AsDes by replacing the old vertices
   //! with the new ones.
   Standard_EXPORT static void FuseVertices(const TopTools_IndexedDataMapOfShapeListOfShape& theDMVV,
                                            const Handle(BRepAlgo_AsDes)& theAsDes);
+  //! extents the edge
+  Standard_EXPORT static void ExtentEdge(const TopoDS_Edge& E,
+                                         TopoDS_Edge& NE,
+                                         const Standard_Real theOffset);
 
 protected:
 
index 02971539d28eb91aeb9bbb087f3d5d6e2630759b..56b539c10f1e598e33e27a4c8d43850e7fa36ba6 100644 (file)
@@ -45,6 +45,8 @@
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 #include <TopTools_MapIteratorOfMapOfShape.hxx>
 #include <TopTools_MapOfShape.hxx>
+//
+#include <BOPTools_AlgoTools.hxx>
 
 //=======================================================================
 //function : BRepOffset_Inter3d
@@ -444,51 +446,24 @@ void BRepOffset_Inter3d::ConnexIntByInt
     TopExp::MapShapesAndAncestors(SI, TopAbs_VERTEX, TopAbs_FACE, aMVF);
   }
   //
-  aNb = VEmap.Extent();
-  for (i = 1; i <= aNb; ++i) {
-    const TopoDS_Shape& aS = VEmap(i);
-    //
-    TopoDS_Edge E;
-    TopTools_ListOfShape aLF1, aLF2;
-    //
-    bEdge = (aS.ShapeType() == TopAbs_EDGE);
-    if (bEdge) {
-      // faces connected by the edge
-      E = *(TopoDS_Edge*)&aS;
-      //
-      const BRepOffset_ListOfInterval& L = Analyse.Type(E);
-      if (L.IsEmpty()) {
-        continue;
-      }
-      //
-      BRepOffset_Type    OT   = L.First().Type();
-      if (OT != BRepOffset_Convex && OT != BRepOffset_Concave) {
-        continue;
-      }
-      //
-      if (OT == BRepOffset_Concave) CurSide = TopAbs_IN;
-      else                          CurSide = TopAbs_OUT;
-      //-----------------------------------------------------------
-      // edge is of the proper type, return adjacent faces.
-      //-----------------------------------------------------------
-      const TopTools_ListOfShape& Anc = Analyse.Ancestors(E);
-      if (Anc.Extent() != 2) {
+  TopTools_DataMapOfShapeListOfShape aDMVLF1, aDMVLF2;
+  TopTools_IndexedDataMapOfShapeListOfShape aDMIntE, aDMIntFF;
+  //
+  if (bIsPlanar) {
+    aNb = VEmap.Extent();
+    for (i = 1; i <= aNb; ++i) {
+      const TopoDS_Shape& aS = VEmap(i);
+      if (aS.ShapeType() != TopAbs_VERTEX) {
         continue;
       }
       //
-      F1  = TopoDS::Face(Anc.First());
-      F2  = TopoDS::Face(Anc.Last ());
-      //
-      aLF1.Append(F1);
-      aLF2.Append(F2);
-    }
-    else {
       // faces connected by the vertex
       const TopTools_ListOfShape& aLF = aMVF.FindFromKey(aS);
       if (aLF.Extent() < 2) {
         continue;
       }
       //
+      TopTools_ListOfShape aLF1, aLF2;
       Standard_Boolean bVertexOnly = Standard_False;
       TopTools_MapOfShape aMFence;
       //
@@ -534,6 +509,57 @@ void BRepOffset_Inter3d::ConnexIntByInt
         continue;
       }
       //
+      aDMVLF1.Bind(aS, aLF1);
+      aDMVLF2.Bind(aS, aLF2);
+    }
+  }
+  //
+  aNb = VEmap.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aS = VEmap(i);
+    //
+    TopoDS_Edge E;
+    TopTools_ListOfShape aLF1, aLF2;
+    //
+    bEdge = (aS.ShapeType() == TopAbs_EDGE);
+    if (bEdge) {
+      // faces connected by the edge
+      E = *(TopoDS_Edge*)&aS;
+      //
+      const BRepOffset_ListOfInterval& L = Analyse.Type(E);
+      if (L.IsEmpty()) {
+        continue;
+      }
+      //
+      BRepOffset_Type    OT   = L.First().Type();
+      if (OT != BRepOffset_Convex && OT != BRepOffset_Concave) {
+        continue;
+      }
+      //
+      if (OT == BRepOffset_Concave) CurSide = TopAbs_IN;
+      else                          CurSide = TopAbs_OUT;
+      //-----------------------------------------------------------
+      // edge is of the proper type, return adjacent faces.
+      //-----------------------------------------------------------
+      const TopTools_ListOfShape& Anc = Analyse.Ancestors(E);
+      if (Anc.Extent() != 2) {
+        continue;
+      }
+      //
+      F1  = TopoDS::Face(Anc.First());
+      F2  = TopoDS::Face(Anc.Last ());
+      //
+      aLF1.Append(F1);
+      aLF2.Append(F2);
+    }
+    else {
+      if (!aDMVLF1.IsBound(aS)) {
+        continue;
+      }
+      //
+      aLF1 = aDMVLF1.Find(aS);
+      aLF2 = aDMVLF2.Find(aS);
+      //
       CurSide = mySide;
     }
     //
@@ -595,6 +621,24 @@ void BRepOffset_Inter3d::ConnexIntByInt
           for (; it.More(); it.Next()) {
             const TopoDS_Shape& aNE = it.Value();
             B.Add(C, aNE);
+            if (bEdge) {
+              TopoDS_Vertex aVO1, aVO2;
+              TopExp::Vertices(TopoDS::Edge(aS), aVO1, aVO2);
+              if (!aDMVLF1.IsBound(aVO1) && !aDMVLF1.IsBound(aVO2)) {
+                TopTools_ListOfShape *pListS = aDMIntE.ChangeSeek(aNE);
+                if (!pListS) {
+                  pListS = &aDMIntE.ChangeFromIndex(aDMIntE.Add(aNE, TopTools_ListOfShape()));
+                }
+                pListS->Append(aS);
+                //
+                if (!aDMIntFF.Contains(aNE)) {
+                  TopTools_ListOfShape aLFF;
+                  aLFF.Append(NF1);
+                  aLFF.Append(NF2);
+                  aDMIntFF.Add(aNE, aLFF);
+                }
+              }
+            }
           }
           //
           Build.Bind(aS,C);
@@ -620,14 +664,33 @@ void BRepOffset_Inter3d::ConnexIntByInt
             }
           }
           //
+          TopTools_ListOfShape aLENew;
           for (it.Initialize(aLInt1) ; it.More(); it.Next()) {
             const TopoDS_Shape &anE1 = it.Value();
             //
             for (it1.Initialize(aLInt2) ; it1.More(); it1.Next()) {
               const TopoDS_Shape &anE2 = it1.Value();
-              
-              if (anE1.IsSame(anE2))
+              if (anE1.IsSame(anE2)) {
                 B.Add(C, anE1);
+                if (bEdge) {
+                  TopoDS_Vertex aVO1, aVO2;
+                  TopExp::Vertices(TopoDS::Edge(aS), aVO1, aVO2);
+                  if (!aDMVLF1.IsBound(aVO1) && !aDMVLF1.IsBound(aVO2)) {
+                    TopTools_ListOfShape *pListS = aDMIntE.ChangeSeek(anE1);
+                    if (!pListS) {
+                      pListS = &aDMIntE.ChangeFromIndex(aDMIntE.Add(anE1, TopTools_ListOfShape()));
+                    }
+                    pListS->Append(aS);
+                    //
+                    if (!aDMIntFF.Contains(anE1)) {
+                      TopTools_ListOfShape aLFF;
+                      aLFF.Append(NF1);
+                      aLFF.Append(NF2);
+                      aDMIntFF.Add(anE1, aLFF);
+                    }
+                  }
+                }
+              }
             }
           }
           Build.Bind(aS,C);
@@ -639,6 +702,70 @@ void BRepOffset_Inter3d::ConnexIntByInt
     }
     //  Modified by skv - Fri Dec 26 12:20:14 2003 OCC4455 End
   }
+  //
+  aNb = aDMIntE.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopTools_ListOfShape& aLE = aDMIntE(i);
+    if (aLE.Extent() == 1) {
+      continue;
+    }
+    //
+    // make connexity blocks of edges
+    TopoDS_Compound aCE;
+    B.MakeCompound(aCE);
+    //
+    TopTools_ListIteratorOfListOfShape aItLE(aLE);
+    for (; aItLE.More(); aItLE.Next()) {
+      const TopoDS_Shape& aE = aItLE.Value();
+      B.Add(aCE, aE);
+    }
+    //
+    TopTools_ListOfShape aLCBE;
+    BOPTools_AlgoTools::MakeConnexityBlocks(aCE, TopAbs_VERTEX, TopAbs_EDGE, aLCBE);
+    if (aLCBE.Extent() == 1) {
+      continue;
+    }
+    //
+    const TopoDS_Edge& aE = TopoDS::Edge(aDMIntE.FindKey(i));
+    const TopTools_ListOfShape& aLFF = aDMIntFF.FindFromKey(aE);
+    const TopoDS_Shape& aF1 = aLFF.First();
+    const TopoDS_Shape& aF2 = aLFF.Last();
+    //
+    aItLE.Initialize(aLCBE);
+    for (aItLE.Next(); aItLE.More(); aItLE.Next()) {
+      // make new edge with different tedge instance
+      TopoDS_Edge aNewEdge;
+      TopoDS_Vertex aV1, aV2;
+      Standard_Real aT1, aT2;
+      //
+      TopExp::Vertices(aE, aV1, aV2);
+      BRep_Tool::Range(aE, aT1, aT2);
+      //
+      BOPTools_AlgoTools::MakeSplitEdge(aE, aV1, aT1, aV2, aT2, aNewEdge);
+      //
+      myAsDes->Add(aF1, aNewEdge);
+      myAsDes->Add(aF2, aNewEdge);
+      //
+      const TopoDS_Shape& aCB = aItLE.Value();
+      TopoDS_Iterator aItCB(aCB);
+      for (; aItCB.More(); aItCB.Next()) {
+        const TopoDS_Shape& aS = aItCB.Value();
+        TopoDS_Shape& aCI = Build.ChangeFind(aS);
+        //
+        TopoDS_Compound aNewCI;
+        B.MakeCompound(aNewCI);
+        TopExp_Explorer aExp(aCI, TopAbs_EDGE);
+        for (; aExp.More(); aExp.Next()) {
+          const TopoDS_Shape& aSx = aExp.Current();
+          if (!aSx.IsSame(aE)) {
+            B.Add(aNewCI, aSx);
+          }
+        }
+        B.Add(aNewCI, aNewEdge);
+        aCI = aNewCI;
+      }
+    }
+  }
 }
 
 //=======================================================================
index 8fa0fd15cc6c9633e5522666b9f0136827587cab..9fea562ab38caf7a5c4e5632cde4a9e1f7072a7e 100644 (file)
 #include <Geom_Line.hxx>
 #include <NCollection_Vector.hxx>
 //
-#include <BOPAlgo_PaveFiller.hxx>
-#include <BOPAlgo_Builder.hxx>
 #include <BOPAlgo_MakerVolume.hxx>
-#include <BOPCol_ListOfShape.hxx>
-#include <BOPCol_DataMapOfShapeShape.hxx>
-#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
-#include <BOPTools.hxx>
-#include <BOPTools_AlgoTools3D.hxx>
 #include <BOPTools_AlgoTools.hxx>
-#include <IntTools_Context.hxx>
-#include <IntTools_ShrunkRange.hxx>
-#include <CPnts_AbscissaPoint.hxx>
+#include <BOPCol_ListOfShape.hxx>
 
 #include <stdio.h>
 // POP for NT
@@ -253,43 +244,24 @@ static void DEBVerticesControl (const TopTools_IndexedMapOfShape& NewEdges,
 //=======================================================================
 // static methods
 //=======================================================================
-static 
-  void SortFaces(const TopTools_ListOfShape& theLIm, 
-                 TopTools_ListOfShape& theLFImages,
-                 const Standard_Boolean bKeepFirst);
-
-static 
-  Standard_Boolean FindShape(const TopoDS_Shape& theSWhat,
-                             const TopoDS_Shape& theSWhere,
-                             TopoDS_Shape& theRes);
-
-static 
-  void UpdateOrigins(TopTools_IndexedDataMapOfShapeListOfShape& theOrigins,
-                     BOPAlgo_Builder& theGF);
-
-static 
-  Standard_Boolean ProcessMicroEdge(const TopoDS_Edge& theEdge,
-                                    const Handle(IntTools_Context)& theCtx);
+static
+  void GetEnlargedFaces(const TopoDS_Shape& theShape,
+                        const BRepOffset_DataMapOfShapeOffset& theMapSF,
+                        const TopTools_DataMapOfShapeShape& theMES,
+                        TopTools_DataMapOfShapeShape& theFacesOrigins,
+                        BRepAlgo_Image& theImage,
+                        TopTools_ListOfShape& theLSF);
 
-static 
-  Standard_Boolean ComputeBiNormal(const TopoDS_Face& theF,
-                                   const TopoDS_Edge& theE,
-                                   gp_Dir& theDB);
-static 
-  Standard_Boolean CheckBiNormals(const TopoDS_Face& aFIm,
-                                  const TopoDS_Face& aFOr,
-                                  const TopTools_IndexedDataMapOfShapeListOfShape& theOrigins,
-                                  const TopTools_MapOfShape& theMFence,
-                                  Standard_Boolean& bKeep,
-                                  Standard_Boolean& bRem,
-                                  const Standard_Boolean RemoveInvalidFaces);
+static
+  Standard_Boolean BuildShellsCompleteInter(const BOPCol_ListOfShape& theLF,
+                                            const BOPCol_IndexedDataMapOfShapeListOfShape& theOrigins,
+                                            BRepAlgo_Image& theImage,
+                                            TopoDS_Shape& theShells);
 
-static 
-  void CheckBiNormals(TopTools_ListOfShape&  theLFImages,
-                      const TopoDS_Face& theF,
-                      const TopTools_IndexedDataMapOfShapeListOfShape& theOrigins,
-                      TopTools_ListOfShape& theLFKeep,
-                      const Standard_Boolean RemoveInvalidFaces);
+static
+  Standard_Boolean GetSubShapes(const TopoDS_Shape& theShape,
+                                const TopAbs_ShapeEnum theSSType,
+                                TopoDS_Shape& theResult);
 
 static 
   Standard_Boolean CheckNormals(const TopoDS_Face& theFIm,
@@ -316,6 +288,28 @@ static
 static
   Standard_Boolean IsPlanar(const TopoDS_Shape& theS);
 
+static
+  void TrimEdge(TopoDS_Edge&                  NE,
+                const Handle(BRepAlgo_AsDes)& AsDes2d,
+                Handle(BRepAlgo_AsDes)& AsDes,
+                TopTools_DataMapOfShapeShape& theETrimEInf);
+
+static 
+  void TrimEdges(const TopoDS_Shape& theShape,
+                 const Standard_Real theOffset,
+                 BRepOffset_DataMapOfShapeOffset& theMapSF,
+                 TopTools_DataMapOfShapeShape& theMES,
+                 TopTools_DataMapOfShapeShape& theBuild,
+                 Handle(BRepAlgo_AsDes)& theAsDes,
+                 Handle(BRepAlgo_AsDes)& theAsDes2d,
+                 TopTools_IndexedMapOfShape& theNewEdges,
+                 TopTools_DataMapOfShapeShape& theETrimEInf,
+                 TopTools_DataMapOfShapeListOfShape& theEdgesOrigins);
+
+static
+  void AppendToList(TopTools_ListOfShape& theL,
+                    const TopoDS_Shape& theS);
+
 static BRepOffset_Error checkSinglePoint(const Standard_Real theUParam,
                                          const Standard_Real theVParam,
                                          const Handle(Geom_Surface)& theSurf,
@@ -544,7 +538,6 @@ static void FillContours(const TopoDS_Shape& aShape,
     }
 }
 
-
 //
 //-----------------------------------------------------------------------
 //
@@ -572,8 +565,7 @@ BRepOffset_MakeOffset::BRepOffset_MakeOffset(const TopoDS_Shape&    S,
                                              const Standard_Boolean SelfInter, 
                                              const GeomAbs_JoinType Join,
                                              const Standard_Boolean Thickening,
-                                             const Standard_Boolean RemoveIntEdges,
-                                             const Standard_Boolean RemInvFaces)
+                                             const Standard_Boolean RemoveIntEdges)
 : 
 myOffset     (Offset),
 myTol        (Tol),
@@ -584,9 +576,7 @@ mySelfInter  (SelfInter),
 myJoin       (Join),
 myThickening    (Thickening),
 myRemoveIntEdges(RemoveIntEdges),
-myRemoveInvalidFaces(RemInvFaces),
 myDone     (Standard_False)
-
 {
   myAsDes = new BRepAlgo_AsDes();
   MakeOffsetShape();
@@ -606,8 +596,7 @@ void BRepOffset_MakeOffset::Initialize(const TopoDS_Shape&    S,
                                        const Standard_Boolean SelfInter,
                                        const GeomAbs_JoinType Join,
                                        const Standard_Boolean Thickening,
-                                       const Standard_Boolean RemoveIntEdges,
-                                       const Standard_Boolean RemInvFaces)
+                                       const Standard_Boolean RemoveIntEdges)
 {
   myOffset     = Offset;
   myShape      = S;
@@ -618,7 +607,6 @@ void BRepOffset_MakeOffset::Initialize(const TopoDS_Shape&    S,
   myJoin       = Join;
   myThickening     = Thickening;
   myRemoveIntEdges = RemoveIntEdges;
-  myRemoveInvalidFaces = RemInvFaces;
   myDone     = Standard_False;
   myIsPerformSewing = Standard_False;
   myIsPlanar = Standard_False;
@@ -847,6 +835,11 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
   // Construction of shells.
   //-------------------------
   MakeShells ();
+  if (myOffsetShape.IsNull()) {
+    // not done
+    myDone = Standard_False;
+    return;
+  }
   //--------------
   // Unwinding 3D.
   //--------------
@@ -1021,125 +1014,33 @@ const TopoDS_Shape&  BRepOffset_MakeOffset::Shape() const
 }
 
 //=======================================================================
-//function : TrimEdge
-//purpose  : Trim the edge of the largest of descendants in AsDes2d.
-//           Order in AsDes two vertices that have trimmed the edge.
+//function : MakeOffsetFaces
+//purpose  : 
 //=======================================================================
-void TrimEdge(TopoDS_Edge&                  NE,
-              const Handle(BRepAlgo_AsDes)& AsDes2d,
-              Handle(BRepAlgo_AsDes)& AsDes)
+void BRepOffset_MakeOffset::MakeOffsetFaces(BRepOffset_DataMapOfShapeOffset& theMapSF)
 {
-  Standard_Real aSameParTol = Precision::Confusion();
-  
-  TopoDS_Vertex V1,V2;
-  Standard_Real U = 0.;
-  Standard_Real UMin =  Precision::Infinite();
-  Standard_Real UMax = -UMin;
-
-  const TopTools_ListOfShape& LE = AsDes2d->Descendant(NE);
+  Standard_Real aCurOffset;
+  TopTools_ListOfShape aLF;
+  TopTools_DataMapOfShapeShape ShapeTgt;
+  TopTools_ListIteratorOfListOfShape aItLF;
   //
-  Standard_Boolean bTrim = Standard_False;
+  Standard_Boolean OffsetOutside = (myOffset > 0.);
   //
-  if (LE.Extent() > 1) {
-    TopTools_ListIteratorOfListOfShape it (LE);
-    for (; it.More(); it.Next()) {
-      TopoDS_Vertex V = TopoDS::Vertex(it.Value());
-      if (NE.Orientation() == TopAbs_REVERSED)
-        V.Reverse();
-      //V.Orientation(TopAbs_INTERNAL);
-      if (!FindParameter(V, NE, U)) {
-        Standard_Real f, l;
-        Handle(Geom_Curve) theCurve = BRep_Tool::Curve(NE, f, l);
-        gp_Pnt thePoint = BRep_Tool::Pnt(V);
-        GeomAPI_ProjectPointOnCurve Projector(thePoint, theCurve);
-        if (Projector.NbPoints() == 0)
-          Standard_ConstructionError::Raise("BRepOffset_MakeOffset::TrimEdge no projection");
-        U = Projector.LowerDistanceParameter();
-      }
-      if (U < UMin) {
-        UMin = U; V1   = V;
-      }
-      if (U > UMax) {
-        UMax = U; V2   = V;
-      }
-    }
-    //
-    if (V1.IsNull() || V2.IsNull()) {
-      Standard_ConstructionError::Raise("BRepOffset_MakeOffset::TrimEdge");
-    }
-    if (!V1.IsSame(V2)) {
-      NE.Free( Standard_True );
-      BRep_Builder B;
-      TopAbs_Orientation Or = NE.Orientation();
-      NE.Orientation(TopAbs_FORWARD);
-      TopoDS_Vertex VF,VL;
-      TopExp::Vertices (NE,VF,VL);
-      B.Remove(NE,VF);
-      B.Remove(NE,VL);
-      B.Add  (NE,V1.Oriented(TopAbs_FORWARD));
-      B.Add  (NE,V2.Oriented(TopAbs_REVERSED));
-      B.Range(NE,UMin,UMax);
-      NE.Orientation(Or);
-      AsDes->Add(NE,V1.Oriented(TopAbs_FORWARD));
-      AsDes->Add(NE,V2.Oriented(TopAbs_REVERSED));
-      BRepLib::SameParameter(NE, aSameParTol, Standard_True);
-      //
-      bTrim = Standard_True;
-    }
-  }
+  BRepLib::SortFaces(myShape, aLF);
   //
-  if (!bTrim) {
-    BRepAdaptor_Curve aBAC(NE);
-    if (aBAC.GetType() == GeomAbs_Line) {
-      if (AsDes->HasAscendant(NE)) {
-        AsDes->Remove(NE);
-      }
-    }
-  }
-}
-
-//=======================================================================
-//function : BuildOffsetByInter
-//purpose  : 
-//=======================================================================
-void BRepOffset_MakeOffset::BuildOffsetByInter()
-{
-#ifdef OCCT_DEBUG
-  if ( ChronBuild) {
-    cout << " CONSTRUCTION OF OFFSETS :" << endl;
-    Clock.Reset();
-    Clock.Start();
-  }
-#endif
-
-  BRepOffset_DataMapOfShapeOffset MapSF;
-  TopTools_MapOfShape             Done;
-  Standard_Boolean OffsetOutside = (myOffset > 0.)? Standard_True : Standard_False;
-  //--------------------------------------------------------
-  // Construction of faces parallel to initial faces
-  //--------------------------------------------------------
-  TopExp_Explorer Exp;
-  TopTools_ListOfShape LF;
-  TopTools_ListIteratorOfListOfShape itLF;
-
-  BRepLib::SortFaces(myShape,LF);
-
-  TopTools_DataMapOfShapeShape ShapeTgt;
-  for (itLF.Initialize(LF); itLF.More(); itLF.Next()) {
-    const TopoDS_Face&   F = TopoDS::Face(itLF.Value());
-    Standard_Real CurOffset = myOffset;
-    if (myFaceOffset.IsBound(F)) CurOffset = myFaceOffset(F);
-    BRepOffset_Offset    OF(F,CurOffset,ShapeTgt,OffsetOutside,myJoin);
+  aItLF.Initialize(aLF);
+  for (; aItLF.More(); aItLF.Next()) {
+    const TopoDS_Face& aF = TopoDS::Face(aItLF.Value());
+    aCurOffset = myFaceOffset.IsBound(aF) ? myFaceOffset(aF) : myOffset;
+    BRepOffset_Offset OF(aF, aCurOffset, ShapeTgt, OffsetOutside, myJoin);
     TopTools_ListOfShape Let;
-    myAnalyse.Edges(F,BRepOffset_Tangent,Let);
-    TopTools_ListIteratorOfListOfShape itl(Let);
-    
-    for ( ; itl.More(); itl.Next()) {
+    myAnalyse.Edges(aF,BRepOffset_Tangent,Let);
+    TopTools_ListIteratorOfListOfShape itl(Let);    
+    for (; itl.More(); itl.Next()) {
       const TopoDS_Edge& Cur = TopoDS::Edge(itl.Value());
       if ( !ShapeTgt.IsBound(Cur)) {
         TopoDS_Shape aLocalShape = OF.Generated(Cur);
         const TopoDS_Edge& OTE = TopoDS::Edge(aLocalShape);
-//        const TopoDS_Edge& OTE = TopoDS::Edge(OF.Generated(Cur));
         ShapeTgt.Bind(Cur,OF.Generated(Cur));
         TopoDS_Vertex V1,V2,OV1,OV2;
         TopExp::Vertices (Cur,V1,V2);
@@ -1160,8 +1061,32 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
         }
       }
     }
-    MapSF.Bind(F,OF);
+    theMapSF.Bind(aF,OF);
+  }
+}
+
+//=======================================================================
+//function : BuildOffsetByInter
+//purpose  : 
+//=======================================================================
+void BRepOffset_MakeOffset::BuildOffsetByInter()
+{
+#ifdef OCCT_DEBUG
+  if ( ChronBuild) {
+    cout << " CONSTRUCTION OF OFFSETS :" << endl;
+    Clock.Reset();
+    Clock.Start();
   }
+#endif
+
+  TopExp_Explorer Exp, Exp2, ExpC;
+  TopTools_ListIteratorOfListOfShape itLF;
+  
+  //--------------------------------------------------------
+  // Construction of faces parallel to initial faces
+  //--------------------------------------------------------
+  BRepOffset_DataMapOfShapeOffset MapSF;
+  MakeOffsetFaces(MapSF);
   //--------------------------------------------------------------------
   // MES   : Map of OffsetShape -> Extended Shapes.
   // Build : Map of Initial SS  -> OffsetShape build by Inter.
@@ -1189,148 +1114,29 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
   //---------------------------------------------------------------------------------
   // Extension of neighbor edges of new edges and intersection between neighbors.
   //--------------------------------------------------------------------------------
-  TopTools_IndexedDataMapOfShapeListOfShape aDMVV;
   Handle(BRepAlgo_AsDes) AsDes2d = new BRepAlgo_AsDes();
-  for (Exp.Init(myShape,TopAbs_FACE) ; Exp.More(); Exp.Next())
-  {
-    const TopoDS_Face& FI = TopoDS::Face(Exp.Current());
-    Standard_Real aCurrFaceTol = BRep_Tool::Tolerance(FI);
-    BRepOffset_Inter2d::ConnexIntByInt (FI, MapSF(FI), MES, Build, 
-                                        AsDes, AsDes2d, myOffset, aCurrFaceTol, aDMVV);
-  }
-  //
-  // fuse vertices on edges
-  BRepOffset_Inter2d::FuseVertices(aDMVV, AsDes2d);
+  IntersectEdges(myShape, MapSF, MES, Build, AsDes, AsDes2d);
   //-----------------------------------------------------------
   // Great restriction of new edges and update of AsDes.
   //------------------------------------------ ----------------
+  TopTools_DataMapOfShapeListOfShape anEdgesOrigins; // offset edge - initial edges
   TopTools_IndexedMapOfShape NewEdges;
-  TopExp_Explorer Exp2,ExpC;
-  TopoDS_Shape    NE;
-  TopoDS_Edge     TNE;
-  TopoDS_Face     NF;
-  TopTools_IndexedDataMapOfShapeListOfShape anOrigins;
-  
-  for (Exp.Init(myShape,TopAbs_FACE) ; Exp.More(); Exp.Next()) {
-    const TopoDS_Face& FI = TopoDS::Face(Exp.Current());
-    NF = MapSF(FI).Face();
-    if (MES.IsBound(NF)) {
-      NF = TopoDS::Face(MES(NF));
-    }
-    //
-    TopTools_MapOfShape View;
-    TopTools_IndexedMapOfShape VEmap;
-    Standard_Integer i, aNb;
-    //
-    TopExp::MapShapes(FI.Oriented(TopAbs_FORWARD), TopAbs_EDGE  , VEmap);
-    TopExp::MapShapes(FI.Oriented(TopAbs_FORWARD), TopAbs_VERTEX, VEmap);
-    //
-    aNb = VEmap.Extent();
-    for (i = 1; i <= aNb; ++i) {
-      const TopoDS_Shape& aS = VEmap(i);
-      if (!View.Add(aS)) {
-        continue;
-      }
-      //
-      if (Build.IsBound(aS)) {
-        NE = Build(aS);
-        if (NE.ShapeType() == TopAbs_EDGE) {
-          if (anOrigins.Contains(NE)) {
-            anOrigins.ChangeFromKey(NE).Append(aS);
-          }
-          else {
-            TopTools_ListOfShape aLSx;
-            aLSx.Append(aS);
-            anOrigins.Add(NE, aLSx);
-          }
-          //
-          if (NewEdges.Add(NE)) {
-            TrimEdge (TopoDS::Edge(NE),AsDes2d,AsDes);
-          }
-        }
-        else {
-          //------------------------------------------------------------
-          // The Intersections are on several edges.
-          // The pieces without intersections with neighbors  
-          // are removed from AsDes.
-          //------------------------------------------------------------
-          for (ExpC.Init(NE,TopAbs_EDGE); ExpC.More(); ExpC.Next()) {
-            TopoDS_Edge NEC = TopoDS::Edge(ExpC.Current());
-            if (NewEdges.Add(NEC)) {
-              NEC.Free(Standard_True);
-              if (anOrigins.Contains(NEC)) {
-                anOrigins.ChangeFromKey(NEC).Append(aS);
-              }
-              else {
-                TopTools_ListOfShape aLSx;
-                aLSx.Append(aS);
-                anOrigins.Add(NEC, aLSx);
-              }
-              //
-              if (!AsDes2d->Descendant(NEC).IsEmpty()) {
-                TrimEdge (NEC,AsDes2d,AsDes);
-              }
-              else {
-                if (AsDes->HasAscendant(NEC)) {
-                  AsDes->Remove(NEC);
-                }
-              }
-            }
-          }
-        }
-      }
-      else {
-        if (aS.ShapeType() != TopAbs_EDGE) {
-          continue;
-        }
-        //
-        NE = MapSF(FI).Generated(aS);
-        //// modified by jgv, 19.12.03 for OCC4455 ////
-        NE.Orientation(aS.Orientation());
-        if (anOrigins.Contains(NE)) {
-          anOrigins.ChangeFromKey(NE).Append(aS);
-        }
-        else {
-          TopTools_ListOfShape aLSx;
-          aLSx.Append(aS);
-          anOrigins.Add(NE, aLSx);
-        }
-        //
-        if (MES.IsBound(NE)) {
-          NE = MES(NE);
-          NE.Orientation(aS.Orientation());
-          if (NewEdges.Add(NE)) {TrimEdge (TopoDS::Edge(NE),AsDes2d,AsDes);} 
-        }
-        AsDes->Add(NF,NE);
-      } 
-    }
-  }
-  
+  TopTools_DataMapOfShapeShape aETrimEInf; // trimmed - not trimmed edges
+  //
+  //Map of edges obtained after FACE-FACE (offsetted) intersection.
+  //Key1 is edge trimmed by intersection points with other edges;
+  //Item is not-trimmed edge. 
+  TrimEdges(myShape, myOffset, MapSF, MES, Build, AsDes, AsDes2d, NewEdges, aETrimEInf, anEdgesOrigins);
+  //
   //--------------------------------- 
   // Intersection 2D on //
   //---------------------------------  
+  TopTools_IndexedDataMapOfShapeListOfShape aDMVV;
+  TopTools_DataMapOfShapeShape aFacesOrigins; // offset face - initial face
   TopTools_ListOfShape LFE; 
   BRepAlgo_Image     IMOE;
-  for (Exp.Init(myShape,TopAbs_FACE) ; Exp.More(); Exp.Next()) {
-    const TopoDS_Shape& FI  = Exp.Current();
-    const TopoDS_Shape& OFI = MapSF(FI).Face();
-    if (MES.IsBound(OFI)) {
-      const TopoDS_Face& aLocalFace = TopoDS::Face(MES(OFI));
-      LFE.Append(aLocalFace);
-      IMOE.SetRoot(aLocalFace);
-      //
-      if (anOrigins.Contains(aLocalFace)) {
-        anOrigins.ChangeFromKey(aLocalFace).Append(FI);
-      }
-      else {
-        TopTools_ListOfShape aLSx;
-        aLSx.Append(FI);
-        anOrigins.Add(aLocalFace, aLSx);
-      }
-    }
-  }
-  
-  aDMVV.Clear();
+  GetEnlargedFaces(myShape, MapSF, MES, aFacesOrigins, IMOE, LFE);
+  //
   TopTools_ListIteratorOfListOfShape itLFE(LFE);
   for (; itLFE.More(); itLFE.Next())
   {
@@ -1356,28 +1162,13 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
   //
   TopTools_MapOfShape aMFDone;
   //
-  if ((myJoin == GeomAbs_Intersection) && myInter) {
-    TopTools_ListOfShape aLFailed;
-    BuildSplitsOfFaces(LFE, AsDes, anOrigins, IMOE, aLFailed, Standard_False);
-    if (aLFailed.Extent()) {
-      myMakeLoops.Build(aLFailed, AsDes, IMOE);
-    }
+  if ((myJoin == GeomAbs_Intersection) && myInter && myIsPlanar) {
+    BuildSplitsOfExtendedFaces(LFE, AsDes, anEdgesOrigins, aFacesOrigins, aETrimEInf, IMOE);
     //
-    if (LFE.Extent() != aLFailed.Extent()) {
-      TopTools_MapOfShape aMFailed;
-      TopTools_ListIteratorOfListOfShape aItLF(aLFailed);
-      for (; aItLF.More(); aItLF.Next()) {
-        const TopoDS_Shape& aS = aItLF.Value();
-        aMFailed.Add(aS);
-      }
-      //
-      aItLF.Initialize(LFE);
-      for (; aItLF.More(); aItLF.Next()) {
-        const TopoDS_Shape& aS = aItLF.Value();
-        if (!aMFailed.Contains(aS)) {
-          aMFDone.Add(aS);
-        }
-      }
+    TopTools_ListIteratorOfListOfShape aItLF(LFE);
+    for (; aItLF.More(); aItLF.Next()) {
+      const TopoDS_Shape& aS = aItLF.Value();
+      aMFDone.Add(aS);
     }
   }
   else {
@@ -1578,7 +1369,7 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
 //  Modified by skv - Tue Mar 15 16:20:43 2005
 
   //---------------------------
-  // MAJ SD. for caps 
+  // MAJ SD. for caps
   //---------------------------
   //TopTools_MapOfShape View; 
   for (i = 1; i <= myFaces.Extent(); i++) {
@@ -1631,390 +1422,28 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
 }
 
 //=======================================================================
-//function : BuildSplitsOfFaces
+//function : BuildOffsetByArc
 //purpose  : 
 //=======================================================================
-void BRepOffset_MakeOffset::BuildSplitsOfFaces
-  (const TopTools_ListOfShape& theLF,
-   const Handle(BRepAlgo_AsDes)& theAsDes,
-   TopTools_IndexedDataMapOfShapeListOfShape& theOrigins,
-   BRepAlgo_Image& theImage,
-   TopTools_ListOfShape& theLFailed,
-   const Standard_Boolean bLimited)
+void BRepOffset_MakeOffset::BuildOffsetByArc()
 {
-  if (!myIsPlanar) {
-    theLFailed.Assign(theLF);
-    return;
-  }
-  //
-  BOPCol_ListOfShape aLS, aLF;
-  BOPCol_ListIteratorOfListOfShape aIt;
-  TopTools_ListIteratorOfListOfShape aItLF, aItLE, aItLE1;
-  TopTools_DataMapOfShapeListOfShape anEImages;
-  BRep_Builder aBB;
-  TopoDS_Compound aFaces;
-  //
-  aBB.MakeCompound(aFaces);
-  //
-  // firstly it is necessary to fuse all the edges
-  Handle(IntTools_Context) aCtx = new IntTools_Context();
-  //
-  aItLF.Initialize(theLF);
-  for (; aItLF.More(); aItLF.Next()) {
-    const TopoDS_Face& aF = *(TopoDS_Face*)&aItLF.Value();
-    //
-    const TopTools_ListOfShape& aLE = theAsDes->Descendant(aF);
-    aItLE.Initialize(aLE);
-    for (; aItLE.More(); aItLE.Next()) {
-      const TopoDS_Edge& aE = *(TopoDS_Edge*)&aItLE.Value();
-      if (BRep_Tool::Degenerated(aE)) {
-        continue;
-      }
-      //
-      if (ProcessMicroEdge(aE, aCtx)) {
-        continue;
-      }
-      //
-      aLS.Append(aE);
-    }
-  }
-  //
-  if (aLS.Extent() > 1) {
-    BOPAlgo_Builder aGFE;
-    //
-    aGFE.SetArguments(aLS);
-    aGFE.Perform();
-    if (aGFE.ErrorStatus() == 0) {
-      // fill map with edges images
-      aIt.Initialize(aLS);
-      for (; aIt.More(); aIt.Next()) {
-        const TopoDS_Shape& aE = aIt.Value();
-        //
-        const TopTools_ListOfShape& aLEIm = aGFE.Modified(aE);
-        if (aLEIm.Extent()) {
-          anEImages.Bind(aE, aLEIm);
-        }
-      }
-      //
-      UpdateOrigins(theOrigins, aGFE);
-    }
-  }
-  //
-  // now we can split the faces
-  aItLF.Initialize(theLF);
-  for (; aItLF.More(); aItLF.Next()) {
-    const TopoDS_Face& aF = *(TopoDS_Face*)&aItLF.Value();
-    //
-    // the offset face
-    aLS.Clear();
-    aLS.Append(aF.Oriented(TopAbs_FORWARD));
-    //
-    Standard_Integer iCountE = 0;
-    TopTools_MapOfShape aMFE;
-    TopExp_Explorer aExp(aF, TopAbs_EDGE);
-    for (; aExp.More(); aExp.Next()) {
-      const TopoDS_Shape& aE = aExp.Current();
-      if (anEImages.IsBound(aE)) {
-        const TopTools_ListOfShape& aLEIm = anEImages.Find(aE);
-        aItLE.Initialize(aLEIm);
-        for (; aItLE.More(); aItLE.Next()) {
-          const TopoDS_Shape& aEIm = aItLE.Value();
-          aMFE.Add(aEIm);
-        }
-      }
-      else {
-        aMFE.Add(aE);
-      }
-    }
-    //
-    // the edges by which the offset face should be split
-    const TopTools_ListOfShape& aLE = theAsDes->Descendant(aF);
-    aItLE.Initialize(aLE);
-    for (; aItLE.More(); aItLE.Next()) {
-      const TopoDS_Edge& aE = *(TopoDS_Edge*)&aItLE.Value();
-      if (BRep_Tool::Degenerated(aE)) {
-        continue;
-      }
-      //
-      if (anEImages.IsBound(aE)) {
-        const TopTools_ListOfShape& aLEIm = anEImages.Find(aE);
-        aItLE1.Initialize(aLEIm);
-        for (; aItLE1.More(); aItLE1.Next()) {
-          const TopoDS_Edge& aEIm = *(TopoDS_Edge*)&aItLE1.Value();
-          // check for micro edge
-          if (ProcessMicroEdge(aEIm, aCtx)) {
-            continue;
-          }
-          //
-          aLS.Append(aEIm);
-          if (!aMFE.Contains(aEIm)) {
-            ++iCountE;
-          }
-        }
-      }
-      else {
-        if (ProcessMicroEdge(aE, aCtx)) {
-          continue;
-        }
-        aLS.Append(aE);
-        if (!aMFE.Contains(aE)) {
-          ++iCountE;
-        }
-      }
-    }
-    //
-    TopTools_ListOfShape aLFImages;
-    //
-    // split the face by the edges
-    if (!iCountE) {
-      if (bLimited && !theImage.HasImage(aF)) {
-        aLFImages.Append(aF);
-        theImage.Bind(aF, aLFImages);
-        aBB.Add(aFaces, aF);
-      }
-      continue;
-    }
-    //
-    BOPAlgo_Builder aGF;
-    //
-    aGF.SetArguments(aLS);
-    aGF.Perform();
-    if (aGF.ErrorStatus()) {
-      theLFailed.Append(aF);
-      continue;
-    }
-    //
-    // splits of the offset shape
-    aLFImages = aGF.Modified(aF);
-    if (aLFImages.IsEmpty()) {
-      theLFailed.Append(aF);
-      continue;
-    }
-    //
-    TopTools_MapOfShape aME;
-    // collect images of Edges
-    aItLE.Initialize(aLE);
-    for (; aItLE.More(); aItLE.Next()) {
-      const TopoDS_Shape& aE = aItLE.Value();
-      if (anEImages.IsBound(aE)) {
-        TopTools_MapOfShape aMFence;
-        TopTools_ListOfShape aLEImNew;
-        Standard_Boolean bModif = Standard_False;
-        //
-        TopTools_ListOfShape& aLEIm = anEImages.ChangeFind(aE);
-        aItLE1.Initialize(aLEIm);
-        for (; aItLE1.More(); aItLE1.Next()) {
-          const TopoDS_Shape& aEIm = aItLE1.Value();
-          const TopTools_ListOfShape& aLEImIm = aGF.Modified(aEIm);
-          if (aLEImIm.Extent()) {
-            bModif = Standard_True;
-            TopTools_ListIteratorOfListOfShape aItLEIm(aLEImIm);
-            for (; aItLEIm.More(); aItLEIm.Next()) {
-              const TopoDS_Shape& aEImIm = aItLEIm.Value();
-              if (aMFence.Add(aEImIm)) {
-                aLEImNew.Append(aEImIm);
-                aME.Add(aEImIm);
-              }
-            }
-          }
-          else {
-            aLEImNew.Append(aEIm);
-            aME.Add(aEIm);
-          }
-        }
-        //
-        if (bModif) {
-          aLEIm.Assign(aLEImNew);
-        }
-      }
-      else {
-        const TopTools_ListOfShape& aLEIm = aGF.Modified(aE);
-        if (aLEIm.Extent()) {
-          anEImages.Bind(aE, aLEIm);
-          TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm);
-          for (; aItLEIm.More(); aItLEIm.Next()) {
-            const TopoDS_Shape& aEIm = aItLEIm.Value();
-            aME.Add(aEIm);
-          }
-        }
-        else {
-          aME.Add(aE);
-        }
-      }
-    }
-    //
-    if (!bLimited) {
-      //
-      // to overcome the often errors in trimming edges it is 
-      // better to remove first the faces containing the boundaries
-      // of the extended surfaces;
-      Standard_Boolean bKeep;
-      aItLE.Initialize(aLFImages);
-      for (; aItLE.More();) {
-        const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLE.Value();
-        //
-        aExp.Init(aFIm, TopAbs_EDGE);
-        for (bKeep = Standard_True; aExp.More() && bKeep; aExp.Next()) {
-          const TopoDS_Edge& aE = *(TopoDS_Edge*)&aExp.Current();
-          //
-          if (BRep_Tool::Degenerated(aE)) {
-            continue;
-          }
-          //
-          bKeep = aME.Contains(aE);
-        }
-        //
-        if (bKeep) {
-          aItLE.Next();
-        }
-        else {
-          aLFImages.Remove(aItLE);
-        }
-      }
-      //
-      UpdateOrigins(theOrigins, aGF);
-      //
-      if (aLFImages.Extent() >= 1) {
-        TopTools_ListOfShape aLFKeep;
-        //
-        // check offset faces on the coincidence of the 
-        // bi-normal directions with the original faces
-        CheckBiNormals(aLFImages, aF, theOrigins, aLFKeep, myRemoveInvalidFaces);
-        //
-        // limit the face
-        if (aLFImages.Extent() > 1) {
-          TopTools_ListOfShape aLFTmp = aLFImages;
-          aLFImages.Clear();
-          //
-          SortFaces(aLFTmp, aLFImages, Standard_True);
-        }
-        //
-        if (aLFKeep.Extent()) {
-          TopTools_MapOfShape aMFence;
-          aItLE.Initialize(aLFImages);
-          for (; aItLE.More(); aItLE.Next()) {
-            const TopoDS_Shape& aFIm = aItLE.Value();
-            aMFence.Add(aFIm);
-          }
-          //
-          aItLE.Initialize(aLFKeep);
-          for (; aItLE.More(); aItLE.Next()) {
-            const TopoDS_Shape& aFIm = aItLE.Value();
-            if (aMFence.Add(aFIm)) {
-              aLFImages.Append(aFIm);
-            }
-          }
-        }
-      }
-    }
-    //
-    // Fill history for faces
-    if (aLFImages.Extent()) {
-      if (theImage.HasImage(aF)) {
-        theImage.Add(aF, aLFImages);
-      }
-      else {
-        theImage.Bind(aF, aLFImages);
-      }
-    }
-    //
-    aItLE.Initialize(aLFImages);
-    for (; aItLE.More(); aItLE.Next()) {
-      const TopoDS_Shape& aFIm = aItLE.Value();
-      aBB.Add(aFaces, aFIm);
-    }
-  }
-  //
-  // fill history for edges
-  TopTools_IndexedMapOfShape aMFE;
-  TopExp::MapShapes(aFaces, TopAbs_EDGE, aMFE);
-  //
-  TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItEIm(anEImages);
-  for (; aItEIm.More(); aItEIm.Next()) {
-    const TopoDS_Shape& aE = aItEIm.Key();
-    const TopTools_ListOfShape& aLEIm = aItEIm.Value();
-    //
-    Standard_Boolean bHasImage = theImage.HasImage(aE);
-    aItLE.Initialize(aLEIm);
-    for (; aItLE.More(); aItLE.Next()) {
-      const TopoDS_Shape& aEIm = aItLE.Value();
-      if (aMFE.Contains(aEIm)) {
-        if (bHasImage) {
-          theImage.Add(aE, aEIm);
-        }
-        else {
-          theImage.Bind(aE, aEIm);
-          bHasImage = Standard_True;
-        }
-      }
-    }
-  }
-}
-
-//=======================================================================
-//function : BuildOffsetByArc
-//purpose  : 
-//=======================================================================
-void BRepOffset_MakeOffset::BuildOffsetByArc()
-{
-#ifdef OCCT_DEBUG
-  if ( ChronBuild) {
-    cout << " CONSTRUCTION OF OFFSETS :" << endl;
-    Clock.Reset();
-    Clock.Start();
+#ifdef OCCT_DEBUG
+  if ( ChronBuild) {
+    cout << " CONSTRUCTION OF OFFSETS :" << endl;
+    Clock.Reset();
+    Clock.Start();
   }
 #endif
 
-  BRepOffset_DataMapOfShapeOffset MapSF;
-  TopTools_MapOfShape             Done;
-  Standard_Boolean OffsetOutside = (myOffset > 0.)? Standard_True : Standard_False;
+  TopExp_Explorer Exp;
+  TopTools_ListIteratorOfListOfShape itLF;
+  TopTools_MapOfShape Done;
+  
   //--------------------------------------------------------
   // Construction of faces parallel to initial faces
   //--------------------------------------------------------
-  TopExp_Explorer Exp;
-  TopTools_ListOfShape LF;
-  TopTools_ListIteratorOfListOfShape itLF;
-
-  BRepLib::SortFaces(myShape,LF);
-
-  TopTools_DataMapOfShapeShape EdgeTgt;
-  for (itLF.Initialize(LF); itLF.More(); itLF.Next()) {
-    const TopoDS_Face&   F = TopoDS::Face(itLF.Value());
-    Standard_Real CurOffset = myOffset;
-    if (myFaceOffset.IsBound(F)) CurOffset = myFaceOffset(F);
-    BRepOffset_Offset    OF(F,CurOffset,EdgeTgt,OffsetOutside,myJoin);
-    TopTools_ListOfShape Let;
-    myAnalyse.Edges(F,BRepOffset_Tangent,Let);
-    TopTools_ListIteratorOfListOfShape itl(Let);
-    
-    for ( ; itl.More(); itl.Next()) {
-      const TopoDS_Edge& Cur = TopoDS::Edge(itl.Value());
-      if ( !EdgeTgt.IsBound(Cur)) {
-        TopoDS_Shape aLocalShape = OF.Generated(Cur);
-        const TopoDS_Edge& OTE = TopoDS::Edge(aLocalShape);
-//        const TopoDS_Edge& OTE = TopoDS::Edge(OF.Generated(Cur));
-        EdgeTgt.Bind(Cur,OF.Generated(Cur));
-        TopoDS_Vertex V1,V2,OV1,OV2;
-        TopExp::Vertices (Cur,V1,V2);
-        TopExp::Vertices (OTE,OV1,OV2);      
-        TopTools_ListOfShape LE;
-        if (!EdgeTgt.IsBound(V1)) {
-          myAnalyse.Edges(V1,BRepOffset_Tangent,LE);
-          const TopTools_ListOfShape& LA =myAnalyse.Ancestors(V1);
-          if (LE.Extent() == LA.Extent())
-            EdgeTgt.Bind(V1,OV1);
-        }
-        if (!EdgeTgt.IsBound(V2)) {
-          LE.Clear();
-          myAnalyse.Edges(V2,BRepOffset_Tangent,LE);
-          const TopTools_ListOfShape& LA =myAnalyse.Ancestors(V2);
-          if (LE.Extent() == LA.Extent())
-              EdgeTgt.Bind(V2,OV2);
-        }
-      }
-    }
-    MapSF.Bind(F,OF);
-  }
+  BRepOffset_DataMapOfShapeOffset MapSF;
+  MakeOffsetFaces(MapSF);
   //--------------------------------------------------------
   // Construction of tubes on edge.
   //--------------------------------------------------------
@@ -2958,13 +2387,8 @@ void BRepOffset_MakeOffset::MakeLoops(TopTools_IndexedMapOfShape& Modif)
       LF.Append(Modif(i));
   }
   //
-  if ((myJoin == GeomAbs_Intersection) && myInter) {
-    TopTools_ListOfShape aLFailed;
-    TopTools_IndexedDataMapOfShapeListOfShape anOr;
-    BuildSplitsOfFaces(LF, myAsDes, anOr, myImageOffset, aLFailed, Standard_True);
-    if (aLFailed.Extent()) {
-      myMakeLoops.Build(aLFailed, myAsDes, myImageOffset);
-    }
+  if ((myJoin == GeomAbs_Intersection) && myInter && myIsPlanar) {
+    BuildSplitsOfTrimmedFaces(LF, myAsDes, myImageOffset);
   }
   else {
     myMakeLoops.Build(LF,myAsDes,myImageOffset);
@@ -3013,13 +2437,8 @@ void BRepOffset_MakeOffset::MakeFaces(TopTools_IndexedMapOfShape& /*Modif*/)
     }
   }
   //
-  if ((myJoin == GeomAbs_Intersection) && myInter) {
-    TopTools_ListOfShape aLFailed;
-    TopTools_IndexedDataMapOfShapeListOfShape anOr;
-    BuildSplitsOfFaces(LOF, myAsDes, anOr, myImageOffset, aLFailed, Standard_True);
-    if (aLFailed.Extent()) {
-      myMakeLoops.BuildFaces(aLFailed, myAsDes, myImageOffset);
-    }
+  if ((myJoin == GeomAbs_Intersection) && myInter && myIsPlanar) {
+    BuildSplitsOfTrimmedFaces(LOF, myAsDes, myImageOffset);
   }
   else {
     myMakeLoops.BuildFaces(LOF,myAsDes,myImageOffset);
@@ -3515,21 +2934,20 @@ void BRepOffset_MakeOffset::MakeShells ()
   TopTools_ListIteratorOfListOfShape it(R);
   //
   for (; it.More(); it.Next()) {
+    const TopoDS_Shape& aF = it.Value();
+    //
     TopTools_ListOfShape Image;
-    myImageOffset.LastImage(it.Value(),Image);
+    myImageOffset.LastImage(aF,Image);
     TopTools_ListIteratorOfListOfShape it2(Image);
     for (; it2.More(); it2.Next()) {
-      const TopoDS_Shape& aF = it2.Value();
-      aLSF.Append(aF);
+      const TopoDS_Shape& aFIm = it2.Value();
+      aLSF.Append(aFIm);
       //
-      if (anOrigins.Contains(aF)) {
-        anOrigins.ChangeFromKey(aF).Append(it.Value());
-      }
-      else {
-        TopTools_ListOfShape aLOr;
-        aLOr.Append(it.Value());
-        anOrigins.Add(aF, aLOr);
+      TopTools_ListOfShape *pLOr = anOrigins.ChangeSeek(aFIm);
+      if (!pLOr) {
+        pLOr = &anOrigins(anOrigins.Add(aFIm, TopTools_ListOfShape()));
       }
+      pLOr->Append(aF);
     }
   }
   //
@@ -3547,141 +2965,27 @@ void BRepOffset_MakeOffset::MakeShells ()
     }
   }
   //
+  if (aLSF.IsEmpty()) {
+    return;
+  }
+  //
   Standard_Boolean bDone = Standard_False;
   if ((myJoin == GeomAbs_Intersection) && myInter &&
       !myThickening && myFaces.IsEmpty() &&
       IsSolid(myShape) && myIsPlanar) {
     //
-    // make shells using MakerVolume algorithm
-    Standard_Integer i, aNb;
-    TopTools_ListIteratorOfListOfShape aItLS, aItLS1;
-    BRep_Builder aBB;
-    //
-    BOPAlgo_MakerVolume aMV1;
-    aMV1.SetArguments(aLSF);
-    aMV1.SetIntersect(Standard_True);
-    aMV1.Perform();
-    //
-    bDone = (aMV1.ErrorStatus() == 0);
+    TopoDS_Shape aShells;
+    bDone = BuildShellsCompleteInter(aLSF, anOrigins, myImageOffset, aShells);
     if (bDone) {
-      UpdateHistory(aLSF, aMV1, myImageOffset);
-      //
-      TopoDS_Shape aResult = aMV1.Shape();
-      //
-      TopTools_IndexedMapOfShape aMFResult;
-      TopExp::MapShapes(aResult, TopAbs_FACE, aMFResult);
-      //
-      // check the result
-      Standard_Boolean bGood = Standard_True;
-      if (myRemoveInvalidFaces) {
-        BOPCol_ListIteratorOfListOfShape aItLSF(aLSF);
-        for (; aItLSF.More(); aItLSF.Next()) {
-          const TopoDS_Shape& aFx = aItLSF.Value();
-          if (!aMFResult.Contains(aFx)) {
-            const TopTools_ListOfShape& aLFMx = aMV1.Modified(aFx);
-            if (aLFMx.IsEmpty()) {
-              bGood = Standard_False;
-              break;
-            }
-          }
-        }
-      }
-      //
-      TopoDS_Compound aShells;
-      aBB.MakeCompound(aShells);
-      //
-      if (!bGood) {
-        myOffsetShape = aShells;
-      }
-      else {
-        if (aResult.ShapeType() == TopAbs_COMPOUND) {
-          // collect faces attached to only one solid
-          BOPCol_IndexedDataMapOfShapeListOfShape aMFS;
-          BOPCol_ListOfShape aLSF2;
-          //
-          BOPTools::MapShapesAndAncestors(aResult, TopAbs_FACE, TopAbs_SOLID, aMFS);
-          aNb = aMFS.Extent();
-          bDone = (aNb > 0);
-          //
-          if (bDone) {
-            for (i = 1; i <= aNb; ++i) {
-              const BOPCol_ListOfShape& aLSx = aMFS(i);
-              if (aLSx.Extent() == 1) {
-                const TopoDS_Shape& aFx = aMFS.FindKey(i);
-                aLSF2.Append(aFx);
-              }
-            }
-            //
-            // make solids from the new list
-            BOPAlgo_MakerVolume aMV2;
-            //
-            aMV2.SetArguments(aLSF2);
-            aMV2.SetIntersect(Standard_False);
-            //
-            aMV2.Perform();
-            bDone = (aMV2.ErrorStatus() == 0);
-            if (bDone) {
-              aResult = aMV2.Shape();
-              if (aResult.ShapeType() == TopAbs_COMPOUND) {
-                BOPCol_ListOfShape aLSF3;
-                //
-                TopExp_Explorer aExp(aResult, TopAbs_FACE);
-                for (; aExp.More(); aExp.Next()) {
-                  const TopoDS_Face& aF = *(TopoDS_Face*)&aExp.Current();
-                  //
-                  // check orientation
-                  if (!anOrigins.Contains(aF)) {
-                    aLSF3.Append(aF);
-                    continue;
-                  }
-                  //
-                  const TopTools_ListOfShape& aLFOr = anOrigins.FindFromKey(aF);
-                  aItLS.Initialize(aLFOr);
-                  for (; aItLS.More(); aItLS.Next()) {
-                    const TopoDS_Face& aFOr = *(TopoDS_Face*)&aItLS.Value();
-                    //
-                    if (CheckNormals(aF, aFOr)) {
-                      aLSF3.Append(aF);
-                      break;
-                    }
-                  }
-                }
-                //
-                // make solid containing most outer faces
-                BOPAlgo_MakerVolume aMV3;
-                //
-                aMV3.SetArguments(aLSF3);
-                aMV3.SetIntersect(Standard_False);
-                //
-                aMV3.Perform();
-                bDone = (aMV3.ErrorStatus() == 0);
-                if (bDone) {
-                  aResult = aMV3.Shape();
-                }
-              }
-            }
-          }
-        }
-        //
-        TopExp_Explorer aExp(aResult, TopAbs_SHELL);
-        bDone = aExp.More();
-        for (; aExp.More(); aExp.Next()) {
-          const TopoDS_Shell& aSh = *(TopoDS_Shell*)&aExp.Current();
-          aBB.Add(aShells, aSh);
-        }
-        myOffsetShape = aShells;
-      }
+      myOffsetShape = aShells;
     }
   }
   //
   if (!bDone) {
     BRepTools_Quilt Glue;
-    BOPCol_ListIteratorOfListOfShape aItLS;
-    //
-    aItLS.Initialize(aLSF);
+    BOPCol_ListIteratorOfListOfShape aItLS(aLSF);
     for (; aItLS.More(); aItLS.Next()) {
-      const TopoDS_Shape& aF = aItLS.Value();
-      Glue.Add(aF);
+      Glue.Add(aItLS.Value());
     }
     myOffsetShape = Glue.Shells();
   }
@@ -3698,7 +3002,7 @@ void BRepOffset_MakeOffset::MakeShells ()
         aS.Closed(Standard_True);
       }
     }
-  }               
+  }
 }
 
 //=======================================================================
@@ -3803,7 +3107,7 @@ void BRepOffset_MakeOffset::MakeSolid ()
 //=======================================================================
 
 void BRepOffset_MakeOffset::SelectShells ()
-{  
+{
   TopTools_MapOfShape FreeEdges;
   TopExp_Explorer exp(myShape,TopAbs_EDGE);
   //-------------------------------------------------------------
@@ -4132,6 +3436,9 @@ void CorrectSolid(TopoDS_Solid& theSol, TopTools_ListOfShape& theSolList)
     aVols.Append(aVProps.Mass());
   }
   //
+  if (Abs(anOuterVol) < Precision::Confusion()) {
+    return;
+  }
   if(anOuterVol < 0.)
   {
     anOuterShell.Reverse();
@@ -4433,466 +3740,439 @@ void RemoveShapes(TopoDS_Shape& theS,
 }
 
 //=======================================================================
-//function : SortFaces
-//purpose  : 
+//function : UpdateHistory
+//purpose  : Updates the history information
 //=======================================================================
-void SortFaces(const TopTools_ListOfShape& theLIm, 
-               TopTools_ListOfShape& theLFImages,
-               const Standard_Boolean bKeepFirst)
+void UpdateHistory(const TopTools_ListOfShape& theLF,
+                   BOPAlgo_Builder& theGF,
+                   BRepAlgo_Image& theImage)
 {
-  Standard_Integer bKeep; // 1 - keep; -1 - remove
-  Standard_Boolean bFlag, bProceeded;
-  TopTools_IndexedDataMapOfShapeListOfShape aDMELF;
-  TopTools_ListOfShape aLFKeep, aLFLeft, aLFTmp;
-  TopTools_MapOfShape aMV;
-  TopTools_ListIteratorOfListOfShape aItLF;
-  TopExp_Explorer aExp;
-  //
-  aLFLeft = theLIm;
-  //
-  bKeep = bKeepFirst ? 1 : -1;
-  for (;;) {
-    aLFTmp = aLFLeft;
-    //
-    aLFLeft.Clear();
-    aLFKeep.Clear();
-    aDMELF.Clear();
-    bProceeded = Standard_False;
-    //
-    // map list of images  edge - faces
-    aItLF.Initialize(aLFTmp);
-    for (; aItLF.More(); aItLF.Next()) {
-      const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value();
-      TopExp::MapShapesAndAncestors(aFIm, TopAbs_EDGE, TopAbs_FACE, aDMELF);
-    }
-    //
-    // find images that have edge attached to only one face
-    aItLF.Initialize(aLFTmp);
-    for (; aItLF.More(); aItLF.Next()) {
-      const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value();
-      aExp.Init(aFIm, TopAbs_EDGE);
-      for (bFlag = Standard_False; aExp.More(); aExp.Next()) {
-        const TopoDS_Edge& aE = *(TopoDS_Edge*)&aExp.Current();
-        const TopTools_ListOfShape& aLEF = aDMELF.FindFromKey(aE);
-        if (aLEF.Extent() == 1) {
-          TopoDS_Vertex aV1, aV2;
-          TopExp::Vertices(aE, aV1, aV2);
-          aMV.Add(aV1);
-          aMV.Add(aV2);
-          //
-          bFlag = Standard_True;
-        }
-      }
-      //
-      if (bFlag) {
-        aLFKeep.Append(aFIm);
-        bProceeded = Standard_True;
-      }
-      else {
-        aLFLeft.Append(aFIm);
-      }
-    }
-    //
-    // map shapes left for processing
-    aDMELF.Clear();
-    aLFTmp = aLFLeft;
-    aLFLeft.Clear();
-    //
-    aItLF.Initialize(aLFTmp);
-    for (; aItLF.More(); aItLF.Next()) {
-      const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value();
-      TopExp::MapShapesAndAncestors(aFIm, TopAbs_EDGE, TopAbs_FACE, aDMELF);
-    }
-    //
-    // find outer edges and check if they touch the first part of edges
-    aItLF.Initialize(aLFTmp);
-    for (; aItLF.More(); aItLF.Next()) {
-      const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value();
-      aExp.Init(aFIm, TopAbs_EDGE);
-      for (bFlag = Standard_False; aExp.More() && !bFlag; aExp.Next()) {
-        const TopoDS_Edge& aE = *(TopoDS_Edge*)&aExp.Current();
-        const TopTools_ListOfShape& aLEF = aDMELF.FindFromKey(aE);
-        if (aLEF.Extent() == 1) {
-          TopoDS_Vertex aV1, aV2;
-          TopExp::Vertices(aE, aV1, aV2);
-          //
-          bFlag = aMV.Contains(aV1) || aMV.Contains(aV2);
-        }
-      }
-      //
-      if (bFlag) {
-        aLFKeep.Append(aFIm);
-        bProceeded = Standard_True;
+  TopTools_ListIteratorOfListOfShape aIt(theLF);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aF = aIt.Value();
+    const TopTools_ListOfShape& aLFIm = theGF.Modified(aF);
+    if (aLFIm.Extent()) {
+      if (theImage.HasImage(aF)) {
+        theImage.Add(aF, aLFIm);
       }
       else {
-        aLFLeft.Append(aFIm);
-      }
-    }
-    //
-    if (bKeep == 1) {
-      // aLFKeep should be kept
-      // aLFLeft left for further processing
-      aItLF.Initialize(aLFKeep);
-      for (; aItLF.More(); aItLF.Next()) {
-        const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value();
-        theLFImages.Append(aFIm);
+        theImage.Bind(aF, aLFIm);
       }
     }
-    //
-    if (aLFLeft.IsEmpty()) {
-      break;
-    }
-    //
-    bKeep *= -1;
-    //
-    if (!bProceeded) {
-      break;
-    }
   }
 }
 
 //=======================================================================
-//function : FindShape
+//function : IntersectEdges
 //purpose  : 
 //=======================================================================
-Standard_Boolean FindShape(const TopoDS_Shape& theSWhat,
-                           const TopoDS_Shape& theSWhere,
-                           TopoDS_Shape& theRes)
+void BRepOffset_MakeOffset::IntersectEdges(const TopoDS_Shape& theShape,
+                                           BRepOffset_DataMapOfShapeOffset& theMapSF,
+                                           TopTools_DataMapOfShapeShape& theMES,
+                                           TopTools_DataMapOfShapeShape& theBuild,
+                                           Handle(BRepAlgo_AsDes)& theAsDes,
+                                           Handle(BRepAlgo_AsDes)& theAsDes2d)
 {
-  Standard_Boolean bFound = Standard_False;
-  TopAbs_ShapeEnum aType = theSWhat.ShapeType();
-  TopExp_Explorer aExp(theSWhere, aType);
+  Standard_Real aTolF;
+  TopTools_IndexedDataMapOfShapeListOfShape aDMVV;
+  TopExp_Explorer aExp(theShape, TopAbs_FACE);
+  // intersect edges created from edges
+  TopTools_IndexedMapOfShape aMFV;
   for (; aExp.More(); aExp.Next()) {
-    const TopoDS_Shape& aS = aExp.Current();
-    if (aS.IsSame(theSWhat)) {
-      theRes = aS;
-      bFound = Standard_True;
-      break;
-    }
+    const TopoDS_Face& aF = TopoDS::Face(aExp.Current());
+    aTolF = BRep_Tool::Tolerance(aF);
+    BRepOffset_Inter2d::ConnexIntByInt
+      (aF, theMapSF(aF), theMES, theBuild, theAsDes2d, myOffset, aTolF, aMFV, aDMVV);
   }
-  return bFound;
+  // intersect edges created from vertices
+  Standard_Integer i, aNbF = aMFV.Extent();
+  for (i = 1; i <= aNbF; ++i) {
+    const TopoDS_Face& aF = TopoDS::Face(aMFV(i));
+    aTolF = BRep_Tool::Tolerance(aF);
+    BRepOffset_Inter2d::ConnexIntByIntInVert
+      (aF, theMapSF(aF), theMES, theBuild, theAsDes, theAsDes2d, aTolF, aDMVV);
+  }
+  //
+  // fuse vertices on edges
+  BRepOffset_Inter2d::FuseVertices(aDMVV, theAsDes2d);
 }
 
 //=======================================================================
-//function : UpdateOrigins
+//function : TrimEdges
 //purpose  : 
 //=======================================================================
-void UpdateOrigins(TopTools_IndexedDataMapOfShapeListOfShape& theOrigins,
-                   BOPAlgo_Builder& theGF)
+void TrimEdges(const TopoDS_Shape& theShape,
+               const Standard_Real theOffset,
+               BRepOffset_DataMapOfShapeOffset& theMapSF,
+               TopTools_DataMapOfShapeShape& theMES,
+               TopTools_DataMapOfShapeShape& theBuild,
+               Handle(BRepAlgo_AsDes)& theAsDes,
+               Handle(BRepAlgo_AsDes)& theAsDes2d,
+               TopTools_IndexedMapOfShape& theNewEdges,
+               TopTools_DataMapOfShapeShape& theETrimEInf,
+               TopTools_DataMapOfShapeListOfShape& theEdgesOrigins)
 {
-  TopTools_ListOfShape aLSTmp;
-  TopTools_MapOfShape aMFence;
-  BOPCol_ListIteratorOfListOfShape aItA;
-  TopTools_ListIteratorOfListOfShape aIt, aIt1;
+  TopExp_Explorer Exp,Exp2,ExpC;
+  TopoDS_Shape    NE;
+  TopoDS_Edge     TNE;
+  TopoDS_Face     NF;
   //
-  const BOPCol_ListOfShape& aLSU = theGF.Arguments();
-  aItA.Initialize(aLSU);
-  for (; aItA.More(); aItA.Next()) {
-    const TopoDS_Shape& aS = aItA.Value();
-    //
-    if (!theOrigins.Contains(aS)) {
-      continue;
+  for (Exp.Init(theShape,TopAbs_FACE) ; Exp.More(); Exp.Next()) {
+    const TopoDS_Face& FI = TopoDS::Face(Exp.Current());
+    NF = theMapSF(FI).Face();
+    if (theMES.IsBound(NF)) {
+      NF = TopoDS::Face(theMES(NF));
     }
     //
-    const TopTools_ListOfShape& aLSIm = theGF.Modified(aS);
-    if (aLSIm.IsEmpty()) {
-      continue;
-    }
+    TopTools_MapOfShape View;
+    TopTools_IndexedMapOfShape VEmap;
+    Standard_Integer i, aNb;
     //
-    const TopTools_ListOfShape& aLS = theOrigins.FindFromKey(aS);
-    //      
-    aIt.Initialize(aLSIm);
-    for (; aIt.More(); aIt.Next()) {
-      const TopoDS_Shape& aSIm = aIt.Value();
-      //
-      if (!theOrigins.Contains(aSIm)) {
-        theOrigins.Add(aSIm, aLS);
+    TopExp::MapShapes(FI.Oriented(TopAbs_FORWARD), TopAbs_EDGE  , VEmap);
+    TopExp::MapShapes(FI.Oriented(TopAbs_FORWARD), TopAbs_VERTEX, VEmap);
+    //
+    aNb = VEmap.Extent();
+    for (i = 1; i <= aNb; ++i) {
+      const TopoDS_Shape& aS = VEmap(i);
+      if (!View.Add(aS)) {
         continue;
       }
       //
-      aMFence.Clear();
-      //
-      TopTools_ListOfShape& aLS1 = theOrigins.ChangeFromKey(aSIm);
-      aLSTmp.Assign(aLS1);
-      //
-      aLS1.Clear();
-      aIt1.Initialize(aLSTmp);
-      for (; aIt1.More(); aIt1.Next()) {
-        const TopoDS_Shape& aS1 = aIt1.Value();
-        if (aMFence.Add(aS1)) {
-          aLS1.Append(aS1);
+      if (theBuild.IsBound(aS)) {
+        NE = theBuild(aS);
+        // keep connection to original edges
+        ExpC.Init(NE, TopAbs_EDGE);
+        for (; ExpC.More(); ExpC.Next()) {
+          const TopoDS_Edge& NEC = TopoDS::Edge(ExpC.Current());
+          TopTools_ListOfShape* pLEOr = theEdgesOrigins.ChangeSeek(NEC);
+          if (!pLEOr) {
+            pLEOr = theEdgesOrigins.Bound(NEC, TopTools_ListOfShape());
+          }
+          AppendToList(*pLEOr, aS);
         }
-      }
-      //
-      aIt1.Initialize(aLS);
-      for (; aIt1.More(); aIt1.Next()) {
-        const TopoDS_Shape& aS1 = aIt1.Value();
-        if (aMFence.Add(aS1)) {
-          aLS1.Append(aS1);
+        // trim edges
+        if (NE.ShapeType() == TopAbs_EDGE) {
+          if (theNewEdges.Add(NE)) {
+            TrimEdge (TopoDS::Edge(NE),theAsDes2d,theAsDes, theETrimEInf);
+          }
+        }
+        else {
+          //------------------------------------------------------------
+          // The Intersections are on several edges.
+          // The pieces without intersections with neighbors  
+          // are removed from AsDes.
+          //------------------------------------------------------------
+          for (ExpC.Init(NE,TopAbs_EDGE); ExpC.More(); ExpC.Next()) {
+            TopoDS_Edge NEC = TopoDS::Edge(ExpC.Current());
+            if (theNewEdges.Add(NEC)) {
+              if (!theAsDes2d->Descendant(NEC).IsEmpty()) {
+                TrimEdge (NEC,theAsDes2d, theAsDes, theETrimEInf);
+              }
+              else {
+                if (theAsDes->HasAscendant(NEC)) {
+                  theAsDes->Remove(NEC);
+                }
+              }
+            }
+          }
         }
       }
+      else {
+        if (aS.ShapeType() != TopAbs_EDGE) {
+          continue;
+        }
+        //
+        NE = theMapSF(FI).Generated(aS);
+        //// modified by jgv, 19.12.03 for OCC4455 ////
+        NE.Orientation(aS.Orientation());
+        //
+        TopTools_ListOfShape* pLEOr = theEdgesOrigins.ChangeSeek(NE);
+        if (!pLEOr) {
+          pLEOr = theEdgesOrigins.Bound(NE, TopTools_ListOfShape());
+        }
+        AppendToList(*pLEOr, aS);
+        //
+        if (theMES.IsBound(NE)) {
+          NE = theMES(NE);
+          NE.Orientation(aS.Orientation());
+          if (theNewEdges.Add(NE)) {
+            TrimEdge (TopoDS::Edge(NE), theAsDes2d, theAsDes, theETrimEInf);
+          } 
+        }
+        else {
+          TopoDS_Edge& anEdge = TopoDS::Edge(NE);
+          BRepAdaptor_Curve aBAC(anEdge);
+          if (aBAC.GetType() == GeomAbs_Line) {
+            TopoDS_Edge aNewEdge;
+            BRepOffset_Inter2d::ExtentEdge(anEdge, aNewEdge, theOffset);
+            theETrimEInf.Bind(anEdge, aNewEdge);
+          }
+        }
+        theAsDes->Add(NF,NE);
+      } 
     }
   }
 }
 
 //=======================================================================
-//function : ProcessMicroEdge
-//purpose  : 
+//function : TrimEdge
+//purpose  : Trim the edge of the largest of descendants in AsDes2d.
+//           Order in AsDes two vertices that have trimmed the edge.
 //=======================================================================
-Standard_Boolean ProcessMicroEdge(const TopoDS_Edge& theEdge,
-                                  const Handle(IntTools_Context)& theCtx)
+void TrimEdge(TopoDS_Edge&                  NE,
+              const Handle(BRepAlgo_AsDes)& AsDes2d,
+              Handle(BRepAlgo_AsDes)& AsDes,
+              TopTools_DataMapOfShapeShape& theETrimEInf)
 {
-  TopoDS_Vertex aV1, aV2;
-  TopExp::Vertices(theEdge, aV1, aV2);
-  Standard_Boolean bNull = aV1.IsNull() || aV2.IsNull();
-  if (bNull) {
-    return Standard_False;
-  }
+  TopoDS_Edge aSourceEdge;
+  TopoDS_Vertex V1,V2;
+  Standard_Real aT1, aT2;
   //
-  Standard_Boolean bMicro;
-  bMicro = BOPTools_AlgoTools::IsMicroEdge(theEdge, theCtx);
-  if (bMicro) {
-    BRepAdaptor_Curve aBAC(theEdge);
-    if (aBAC.GetType() == GeomAbs_Line) {
-      BRep_Builder aBB;
-      Standard_Real aLen = CPnts_AbscissaPoint::Length(aBAC);
+  TopExp::Vertices(NE, V1, V2);
+  BRep_Tool::Range(NE, aT1, aT2);
+  //
+  BOPTools_AlgoTools::MakeSplitEdge(NE, V1, aT1, V2, aT2, aSourceEdge);
+  //
+  //
+  Standard_Real aSameParTol = Precision::Confusion();
+  
+  Standard_Real U = 0.;
+  Standard_Real UMin =  Precision::Infinite();
+  Standard_Real UMax = -UMin;
+
+  const TopTools_ListOfShape& LE = AsDes2d->Descendant(NE);
+  //
+  Standard_Boolean bTrim = Standard_False;
+  //
+  if (LE.Extent() > 1) {
+    TopTools_ListIteratorOfListOfShape it (LE);
+    for (; it.More(); it.Next()) {
+      TopoDS_Vertex V = TopoDS::Vertex(it.Value());
+      if (NE.Orientation() == TopAbs_REVERSED)
+        V.Reverse();
+      //V.Orientation(TopAbs_INTERNAL);
+      if (!FindParameter(V, NE, U)) {
+        Standard_Real f, l;
+        Handle(Geom_Curve) theCurve = BRep_Tool::Curve(NE, f, l);
+        gp_Pnt thePoint = BRep_Tool::Pnt(V);
+        GeomAPI_ProjectPointOnCurve Projector(thePoint, theCurve);
+        if (Projector.NbPoints() == 0)
+          Standard_ConstructionError::Raise("BRepOffset_MakeOffset::TrimEdge no projection");
+        U = Projector.LowerDistanceParameter();
+      }
+      if (U < UMin) {
+        UMin = U; V1   = V;
+      }
+      if (U > UMax) {
+        UMax = U; V2   = V;
+      }
+    }
+    //
+    if (V1.IsNull() || V2.IsNull()) {
+      Standard_ConstructionError::Raise("BRepOffset_MakeOffset::TrimEdge");
+    }
+    if (!V1.IsSame(V2)) {
+      NE.Free( Standard_True );
+      BRep_Builder B;
+      TopAbs_Orientation Or = NE.Orientation();
+      NE.Orientation(TopAbs_FORWARD);
+      TopoDS_Vertex VF,VL;
+      TopExp::Vertices (NE,VF,VL);
+      B.Remove(NE,VF);
+      B.Remove(NE,VL);
+      B.Add  (NE,V1.Oriented(TopAbs_FORWARD));
+      B.Add  (NE,V2.Oriented(TopAbs_REVERSED));
+      B.Range(NE,UMin,UMax);
+      NE.Orientation(Or);
+      AsDes->Add(NE,V1.Oriented(TopAbs_FORWARD));
+      AsDes->Add(NE,V2.Oriented(TopAbs_REVERSED));
+      BRepLib::SameParameter(NE, aSameParTol, Standard_True);
       //
-      aBB.UpdateVertex(aV1, aLen/2.);
-      aBB.UpdateVertex(aV2, aLen/2.);
+      bTrim = Standard_True;
     }
   }
   //
-  return bMicro;
+  if (!bTrim) {
+    BRepAdaptor_Curve aBAC(NE);
+    if (aBAC.GetType() == GeomAbs_Line) {
+      if (AsDes->HasAscendant(NE)) {
+        AsDes->Remove(NE);
+      }
+    }
+  }
+  else
+  {
+    if (!theETrimEInf.IsBound(NE)) {
+      theETrimEInf.Bind(NE, aSourceEdge);
+    }
+  }
 }
 
 //=======================================================================
-//function : ComputeBiNormal
+//function : GetEnlargedFaces
 //purpose  : 
 //=======================================================================
-Standard_Boolean ComputeBiNormal(const TopoDS_Face& theF,
-                                 const TopoDS_Edge& theE,
-                                 gp_Dir& theDB)
+void GetEnlargedFaces(const TopoDS_Shape& theShape,
+                      const BRepOffset_DataMapOfShapeOffset& theMapSF,
+                      const TopTools_DataMapOfShapeShape& theMES,
+                      TopTools_DataMapOfShapeShape& theFacesOrigins,
+                      BRepAlgo_Image& theImage,
+                      TopTools_ListOfShape& theLSF)
 {
-  Standard_Boolean bDone = Standard_False;
-  Standard_Real aT1, aT2, aTm;
+  TopExp_Explorer aExp(theShape, TopAbs_FACE);
+  for (; aExp.More(); aExp.Next()) {
+    const TopoDS_Shape& FI  = aExp.Current();
+    const TopoDS_Shape& OFI = theMapSF(FI).Face();
+    if (theMES.IsBound(OFI)) {
+      const TopoDS_Face& aLocalFace = TopoDS::Face(theMES(OFI));
+      theLSF.Append(aLocalFace);
+      theImage.SetRoot(aLocalFace);
+      //
+      theFacesOrigins.Bind(aLocalFace, FI);
+    }
+  }
+}
+
+//=======================================================================
+//function : BuildShellsCompleteInter
+//purpose  : Make the shells from list of faces using MakerVolume algorithm.
+//           In case there will be more than just one solid, it will be
+//           rebuilt using only outer faces.
+//=======================================================================
+Standard_Boolean BuildShellsCompleteInter(const BOPCol_ListOfShape& theLF,
+                                          const BOPCol_IndexedDataMapOfShapeListOfShape& theOrigins,
+                                          BRepAlgo_Image& theImage,
+                                          TopoDS_Shape& theShells)
+{
+  // make solids
+  BOPAlgo_MakerVolume aMV1;
+  aMV1.SetArguments(theLF);
+  // we need to intersect the faces to process the tangential faces
+  aMV1.SetIntersect(Standard_True);
+  aMV1.Perform();
   //
-  const Handle(Geom2d_Curve)& aC2d = 
-    BRep_Tool::CurveOnSurface(theE, theF, aT1, aT2);
-  if (aC2d.IsNull()) {
+  Standard_Boolean bDone = (aMV1.ErrorStatus() == 0);
+  if (!bDone) {
     return bDone;
   }
   //
-  gp_Pnt2d aP2dNear;
-  gp_Pnt aP, aPNear;
-  //
-  const Handle(Geom_Curve)& aC3d = 
-    BRep_Tool::Curve(theE, aT1, aT2);
+  UpdateHistory(theLF, aMV1, theImage);
   //
-  aTm = (aT1 + aT2) * 0.5;
-  aP = aC3d->Value(aTm);
+  const TopoDS_Shape& aResult1 = aMV1.Shape();
+  if (aResult1.ShapeType() == TopAbs_SOLID) {
+    // result is the alone solid, nothing to do
+    return GetSubShapes(aResult1, TopAbs_SHELL, theShells);
+  }
   //
-  BOPTools_AlgoTools3D::PointNearEdge(theE, theF, aTm, 1.e-5, aP2dNear, aPNear);
+  // it is necessary to rebuild the solids, avoiding internal faces
   //
-  gp_Vec aVB(aP, aPNear);
-  theDB = gp_Dir(aVB);
-  return !bDone;
-}
-
-//=======================================================================
-//function : CheckBiNormals
-//purpose  : 
-//=======================================================================
-Standard_Boolean CheckBiNormals
-  (const TopoDS_Face& aFIm,
-   const TopoDS_Face& aFOr,
-   const TopTools_IndexedDataMapOfShapeListOfShape& theOrigins,
-   const TopTools_MapOfShape& theMFence,
-   Standard_Boolean& bKeep,
-   Standard_Boolean& bRemove,
-   const Standard_Boolean RemoveInvalidFaces)
-{
-  bKeep = Standard_True;
-  bRemove = Standard_False;
-
-  Standard_Boolean bChecked;
-  Standard_Integer aNbEdgesChecked;
-  Standard_Real anAngle;
-  TopTools_IndexedMapOfShape aMEInv;
+  // map faces to solids
+  TopTools_IndexedDataMapOfShapeListOfShape aDMFS;
+  TopExp::MapShapesAndAncestors(aResult1, TopAbs_FACE, TopAbs_SOLID, aDMFS);
   //
-  aNbEdgesChecked = 0;
+  Standard_Integer i, aNb = aDMFS.Extent();
+  bDone = (aNb > 0);
+  if (!bDone) {
+    // unable to build any solid
+    return bDone;
+  }
   //
-  const TopoDS_Wire& aWIm = BRepTools::OuterWire(aFIm);
-  TopExp_Explorer aExp(aWIm, TopAbs_EDGE);
-  for (; aExp.More(); aExp.Next()) {
-    const TopoDS_Edge& aEIm = *(TopoDS_Edge*)&aExp.Current();
-    //
-    if (BRep_Tool::Degenerated(aEIm)) {
-      continue;
-    }
-    //
-    if (!theOrigins.Contains(aEIm)) {
-      continue;
-    }
-    //
-    const TopTools_ListOfShape& aLEOr = theOrigins.FindFromKey(aEIm);
-    const TopoDS_Shape& aSOr = aLEOr.First();
-    if (aSOr.ShapeType() != TopAbs_EDGE) {
-      continue;
-    }
-    //
-    if (aLEOr.Extent() > 1) {
-      TopTools_MapOfShape aME, aMV;
-      Standard_Integer aNbE, aNbV;
-      //
-      TopTools_ListIteratorOfListOfShape aItLS(aLEOr);
-      for (; aItLS.More(); aItLS.Next()) {
-        const TopoDS_Edge& aEOr = *(TopoDS_Edge*)&aItLS.Value();
-        aME.Add(aEOr);
-        //
-        TopExp_Explorer aExpE(aEOr, TopAbs_VERTEX);
-        for (; aExpE.More(); aExpE.Next()) {
-          const TopoDS_Shape& aV = aExpE.Current();
-          aMV.Add(aV);
-        }
-      }
-      //
-      aNbV = aMV.Extent();
-      aNbE = aME.Extent();
-      //
-      if ((aNbE > 1) && (aNbV == 2*aNbE)) {
-        continue;
-      }
-    }
-    //
-    if (!RemoveInvalidFaces) {
-      if (theMFence.Contains(aEIm)) {
-        bChecked = Standard_True;
-        bKeep = Standard_True;
-        bRemove = Standard_False;
-        return bChecked;
-      }
-    }
-    //
-    const TopoDS_Edge& aEOr = *(TopoDS_Edge*)&aLEOr.First();
-    //
-    TopoDS_Edge aEOrF;
-    if (!FindShape(aEOr, aFOr, aEOrF)) {
-      continue;
-    }
-    //
-    // compute bi-normal for face aFIm on the edge aEIm
-    gp_Dir aDB1;
-    if (!ComputeBiNormal(aFIm, aEIm, aDB1)) {
-      continue;
-    }
-    //
-    // compute bi-normal for face aFOr on the edge aEOrF
-    gp_Dir aDB2;
-    if (!ComputeBiNormal(aFOr, aEOrF, aDB2)) {
-      continue;
-    }
-    //
-    ++aNbEdgesChecked;
-    //
-    anAngle = aDB1.Angle(aDB2);
-    if (Abs(anAngle - M_PI) < 1.e-4) {
-      aMEInv.Add(aEIm);
+  // get faces attached to only one solid
+  BOPCol_ListOfShape aLF2;
+  for (i = 1; i <= aNb; ++i) {
+    const TopTools_ListOfShape& aLS = aDMFS(i);
+    if (aLS.Extent() == 1) {
+      const TopoDS_Shape& aF = aDMFS.FindKey(i);
+      aLF2.Append(aF);
     }
   }
   //
-  bChecked = (aNbEdgesChecked > 0);
-  if (!bChecked) {
-    return bChecked;
+  // make solids from the new list
+  BOPAlgo_MakerVolume aMV2;
+  aMV2.SetArguments(aLF2);
+  // no need to intersect this time
+  aMV2.SetIntersect(Standard_False);
+  aMV2.Perform();
+  bDone = (aMV2.ErrorStatus() == 0);
+  if (!bDone) {
+    return bDone;
   }
   //
-  // decide whether to remove the split face or not
-  //
-  Standard_Integer  aNb = aMEInv.Extent();
-  if (aNb == 0) {
-    return bChecked;
+  const TopoDS_Shape& aResult2 = aMV2.Shape();
+  if (aResult2.ShapeType() == TopAbs_SOLID) {
+    return GetSubShapes(aResult2, TopAbs_SHELL, theShells);
   }
   //
-  if (aNb == aNbEdgesChecked) {
-    bKeep = Standard_False;
-    bRemove = Standard_True;
+  TopExp_Explorer aExp(aResult2, TopAbs_FACE);
+  bDone = aExp.More();
+  if (!bDone) {
+    return bDone;
   }
   //
-  if (!bRemove) {
-    for (Standard_Integer i = 1; i <= aNb; ++i) {
-      const TopoDS_Shape& aE = aMEInv(i);
-      if (theMFence.Contains(aE)) {
-        bKeep = Standard_False;
-        bRemove = Standard_True;
+  // the result is non-manifold - resolve it comparing normals
+  // directions of the offset faces and original faces
+  BOPCol_ListOfShape aLF3;
+  for (; aExp.More(); aExp.Next()) {
+    const TopoDS_Face& aF = TopoDS::Face(aExp.Current());
+    //
+    // check orientation
+    if (!theOrigins.Contains(aF)) {
+      aLF3.Append(aF);
+      continue;
+    }
+    //
+    const TopTools_ListOfShape& aLFOr = theOrigins.FindFromKey(aF);
+    TopTools_ListIteratorOfListOfShape aItLF(aLFOr);
+    for (; aItLF.More(); aItLF.Next()) {
+      const TopoDS_Face& aFOr = TopoDS::Face(aItLF.Value());
+      if (CheckNormals(aF, aFOr)) {
+        aLF3.Append(aF);
         break;
       }
     }
   }
   //
-  return bChecked;
+  // make solid from most outer faces with correct normal direction
+  BOPAlgo_MakerVolume aMV3;
+  aMV3.SetArguments(aLF3);
+  aMV3.SetIntersect(Standard_False);
+  aMV3.Perform();
+  bDone = (aMV3.ErrorStatus() == 0);
+  if (!bDone) {
+    return bDone;
+  }
+  //
+  const TopoDS_Shape& aResult3 = aMV3.Shape();
+  return GetSubShapes(aResult3, TopAbs_SHELL, theShells);
 }
 
 //=======================================================================
-//function : CheckBiNormals
+//function : GetSubShapes
 //purpose  : 
 //=======================================================================
-void CheckBiNormals
-  (TopTools_ListOfShape&  theLFImages,
-   const TopoDS_Face& theF,
-   const TopTools_IndexedDataMapOfShapeListOfShape& theOrigins,
-   TopTools_ListOfShape& theLFKeep,
-   const Standard_Boolean RemoveInvalidFaces)
+Standard_Boolean GetSubShapes(const TopoDS_Shape& theShape,
+                              const TopAbs_ShapeEnum theSSType,
+                              TopoDS_Shape& theResult)
 {
-  Standard_Boolean bChecked, bKeep, bRem;
-  Standard_Integer i, aNb;
-  TopTools_ListOfShape aLFKeep;
-  TopTools_MapOfShape aMEToKeep;
-  TopTools_IndexedDataMapOfShapeListOfShape aDMELF;
-  TopTools_ListIteratorOfListOfShape aItLF;
-  //
-  // collect outer edges
-  aItLF.Initialize(theLFImages);
-  for (; aItLF.More(); aItLF.Next()) {
-    const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value();
-    TopExp::MapShapesAndAncestors(aFIm, TopAbs_EDGE, TopAbs_FACE, aDMELF);
-  }
-  //
-  aNb = aDMELF.Extent();
-  for (i = 1; i <= aNb; ++i) {
-    const TopTools_ListOfShape& aLF = aDMELF(i);
-    if (aLF.Extent() == 1) {
-      const TopoDS_Shape& aE = aDMELF.FindKey(i);
-      aMEToKeep.Add(aE);
-    }
+  TopExp_Explorer aExp(theShape, theSSType);
+  if (!aExp.More()) {
+    return Standard_False;
   }
   //
-  const TopoDS_Face& aFOr = *(TopoDS_Face*)&theOrigins.FindFromKey(theF).First();
+  TopoDS_Compound aResult;
+  BRep_Builder().MakeCompound(aResult);
   //
-  aItLF.Initialize(theLFImages);
-  for (; aItLF.More(); ) {
-    const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value();
-    //
-    bChecked = CheckBiNormals(aFIm, aFOr, theOrigins, aMEToKeep, bKeep, bRem, RemoveInvalidFaces);
-    //
-    if (bChecked) {
-      if (bRem) {
-        theLFImages.Remove(aItLF);
-      }
-      else {
-        if (bKeep) {
-          theLFKeep.Append(aFIm);
-        }
-        aItLF.Next();
-      }
-    }
-    else {
-      aItLF.Next();
-    }
+  for (; aExp.More(); aExp.Next()) {
+    const TopoDS_Shape& aSS = aExp.Current();
+    BRep_Builder().Add(aResult, aSS);
   }
+  theResult = aResult;
+  return Standard_True;
 }
 
 //=======================================================================
 //function : CheckNormals
-//purpose  : 
+//purpose  : Comparing normal directions of the faces
 //=======================================================================
 Standard_Boolean CheckNormals(const TopoDS_Face& theFIm,
                               const TopoDS_Face& theFOr)
@@ -4955,51 +4235,46 @@ Standard_Boolean CheckNormals(const TopoDS_Face& theFIm,
   return bIsCollinear;
 }
 
+//=======================================================================
+//function : IsPlanar
+//purpose  : Checks if all the faces of the shape are planes
+//=======================================================================
+Standard_Boolean IsPlanar(const TopoDS_Shape& theS)
+{
+  TopExp_Explorer aExp(theS, TopAbs_FACE);
+  for (; aExp.More(); aExp.Next()) {
+    const TopoDS_Face& aF = *(TopoDS_Face*)&aExp.Current();
+    BRepAdaptor_Surface aBAS(aF, Standard_False);
+    if (aBAS.GetType() != GeomAbs_Plane) {
+      break;
+    }
+  }
+  return !aExp.More();
+}
+
 //=======================================================================
 //function : IsSolid
-//purpose  : Check if the shape is solid
+//purpose  : Checks if the shape is solid
 //=======================================================================
 Standard_Boolean IsSolid(const TopoDS_Shape& theS)
 {
   TopExp_Explorer aExp(theS, TopAbs_SOLID);
   return aExp.More();
 }
+
 //=======================================================================
-//function : UpdateHistory
-//purpose  : Updates the history information
+//function : AppendToList
+//purpose  : Add to a list only unique elements
 //=======================================================================
-void UpdateHistory(const TopTools_ListOfShape& theLF,
-                   BOPAlgo_Builder& theGF,
-                   BRepAlgo_Image& theImage)
+void AppendToList(TopTools_ListOfShape& theList,
+                  const TopoDS_Shape& theShape)
 {
-  TopTools_ListIteratorOfListOfShape aIt(theLF);
+  TopTools_ListIteratorOfListOfShape aIt(theList);
   for (; aIt.More(); aIt.Next()) {
-    const TopoDS_Shape& aF = aIt.Value();
-    const TopTools_ListOfShape& aLFIm = theGF.Modified(aF);
-    if (aLFIm.Extent()) {
-      if (theImage.HasImage(aF)) {
-        theImage.Add(aF, aLFIm);
-      }
-      else {
-        theImage.Bind(aF, aLFIm);
-      }
+    const TopoDS_Shape& aS = aIt.Value();
+    if (aS.IsSame(theShape)) {
+      return;
     }
   }
-}
-
-//=======================================================================
-//function : IsPlanar
-//purpose  : 
-//=======================================================================
-Standard_Boolean IsPlanar(const TopoDS_Shape& theS)
-{
-  Standard_Boolean bRet;
-  TopExp_Explorer aExp(theS, TopAbs_FACE);
-  for (bRet = Standard_True; aExp.More() && bRet; aExp.Next()) {
-    const TopoDS_Face& aF = *(TopoDS_Face*)&aExp.Current();
-    BRepAdaptor_Surface aBAS(aF, Standard_False);
-    bRet = (aBAS.GetType() == GeomAbs_Plane);
-  }
-  return bRet;
+  theList.Append(theShape);
 }
index 4af6b24c05ec920b24ddf89756ad4389bff70636..1fca4d4a6234b79f0e353aa795ee67ce019ffd9b 100644 (file)
@@ -53,27 +53,25 @@ public:
   
   Standard_EXPORT BRepOffset_MakeOffset();
   
-  Standard_EXPORT BRepOffset_MakeOffset(const TopoDS_Shape& S, 
-                                        const Standard_Real Offset, 
-                                        const Standard_Real Tol, 
-                                        const BRepOffset_Mode Mode = BRepOffset_Skin, 
-                                        const Standard_Boolean Intersection = Standard_False, 
-                                        const Standard_Boolean SelfInter = Standard_False, 
-                                        const GeomAbs_JoinType Join = GeomAbs_Arc, 
+  Standard_EXPORT BRepOffset_MakeOffset(const TopoDS_Shape& S,
+                                        const Standard_Real Offset,
+                                        const Standard_Real Tol,
+                                        const BRepOffset_Mode Mode = BRepOffset_Skin,
+                                        const Standard_Boolean Intersection = Standard_False,
+                                        const Standard_Boolean SelfInter = Standard_False,
+                                        const GeomAbs_JoinType Join = GeomAbs_Arc,
                                         const Standard_Boolean Thickening = Standard_False,
-                                        const Standard_Boolean RemoveIntEdges = Standard_False,
-                                        const Standard_Boolean RemoveInvalidFaces = Standard_False);
-  
-  Standard_EXPORT void Initialize (const TopoDS_Shape& S, 
-                                   const Standard_Real Offset, 
-                                   const Standard_Real Tol, 
-                                   const BRepOffset_Mode Mode = BRepOffset_Skin, 
-                                   const Standard_Boolean Intersection = Standard_False, 
-                                   const Standard_Boolean SelfInter = Standard_False, 
-                                   const GeomAbs_JoinType Join = GeomAbs_Arc, 
+                                        const Standard_Boolean RemoveIntEdges = Standard_False);
+  
+  Standard_EXPORT void Initialize (const TopoDS_Shape& S,
+                                   const Standard_Real Offset,
+                                   const Standard_Real Tol,
+                                   const BRepOffset_Mode Mode = BRepOffset_Skin,
+                                   const Standard_Boolean Intersection = Standard_False,
+                                   const Standard_Boolean SelfInter = Standard_False,
+                                   const GeomAbs_JoinType Join = GeomAbs_Arc,
                                    const Standard_Boolean Thickening = Standard_False,
-                                   const Standard_Boolean RemoveIntEdges = Standard_False,
-                                   const Standard_Boolean RemoveInvalidFaces = Standard_False);
+                                   const Standard_Boolean RemoveIntEdges = Standard_False);
   
   Standard_EXPORT void Clear();
   
@@ -129,20 +127,13 @@ protected:
 
 private:
 
-  
   Standard_EXPORT void BuildOffsetByArc();
   
   Standard_EXPORT void BuildOffsetByInter();
 
-  //! Building splits of the offset faces by the section curves 
-  //! between the neighboring faces. 
-  Standard_EXPORT void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF,
-                                          const Handle(BRepAlgo_AsDes)& theAsDes,
-                                          TopTools_IndexedDataMapOfShapeListOfShape& theOrigins,
-                                          BRepAlgo_Image& theImage,
-                                          TopTools_ListOfShape& theLFailed,
-                                          const Standard_Boolean bLimited);
-  
+  //! Make Offset faces
+  Standard_EXPORT void MakeOffsetFaces(BRepOffset_DataMapOfShapeOffset& theMapSF);
+
   Standard_EXPORT void SelfInter (TopTools_MapOfShape& Modif);
   
   Standard_EXPORT void Intersection3D (BRepOffset_Inter3d& Inter);
@@ -177,7 +168,30 @@ private:
   //! Removes INTERNAL edges from the result
   Standard_EXPORT void RemoveInternalEdges();
 
-
+  //! Intersects edges
+  Standard_EXPORT void IntersectEdges (const TopoDS_Shape& theShape,
+                                       BRepOffset_DataMapOfShapeOffset& theMapSF,
+                                       TopTools_DataMapOfShapeShape& theMES,
+                                       TopTools_DataMapOfShapeShape& theBuild,
+                                       Handle(BRepAlgo_AsDes)& theAsDes,
+                                       Handle(BRepAlgo_AsDes)& theAsDes2d);
+
+  //! Building of the splits of the offset faces for mode Complete
+  //! and joint type Intersection. This method is an advanced alternative
+  //! for BRepOffset_MakeLoops::Build method.
+  //! Currently the Complete intersection mode is limited to work only on planar cases.
+  Standard_EXPORT void BuildSplitsOfExtendedFaces(const TopTools_ListOfShape& theLF,
+                                                  Handle(BRepAlgo_AsDes)& theAsDes,
+                                                  TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                                                  TopTools_DataMapOfShapeShape& theFacesOrigins,
+                                                  TopTools_DataMapOfShapeShape& theETrimEInf,
+                                                  BRepAlgo_Image& theImage);
+
+  //! Building of the splits of the already trimmed offset faces for mode Complete
+  //! and joint type Intersection.
+  Standard_EXPORT void BuildSplitsOfTrimmedFaces(const TopTools_ListOfShape& theLF,
+                                                 Handle(BRepAlgo_AsDes)& theAsDes,
+                                                 BRepAlgo_Image& theImage);
 
   Standard_Real myOffset;
   Standard_Real myTol;
@@ -188,7 +202,6 @@ private:
   GeomAbs_JoinType myJoin;
   Standard_Boolean myThickening;
   Standard_Boolean myRemoveIntEdges;
-  Standard_Boolean myRemoveInvalidFaces;
   TopTools_DataMapOfShapeReal myFaceOffset;
   TopTools_IndexedMapOfShape myFaces;
   BRepOffset_Analyse myAnalyse;
diff --git a/src/BRepOffset/BRepOffset_MakeOffset_1.cxx b/src/BRepOffset/BRepOffset_MakeOffset_1.cxx
new file mode 100644 (file)
index 0000000..68e9b0d
--- /dev/null
@@ -0,0 +1,5618 @@
+// Created on: 2016
+// Created by: Eugeny MALTCHIKOV
+// Copyright (c) 2016 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+
+// This is the implementation of the extension of the 3D offset algorithm
+// to work in mode Complete and Join Type Intersection.
+// Currently only the Planar cases are supported.
+
+
+#include <BRepOffset_MakeOffset.hxx>
+
+#include <Precision.hxx>
+#include <TopoDS.hxx>
+
+#include <BRepAlgo_AsDes.hxx>
+#include <BRepAlgo_Image.hxx>
+
+#include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
+
+#include <BRepTools.hxx>
+
+#include <BRepAdaptor_Curve.hxx>
+
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+
+#include <TopTools_DataMapOfShapeInteger.hxx>
+
+#include <BRepOffset_Tool.hxx>
+
+#include <BRepClass3d_SolidClassifier.hxx>
+
+#include <BOPDS_DS.hxx>
+
+#include <BOPAlgo_PaveFiller.hxx>
+#include <BOPAlgo_Builder.hxx>
+#include <BOPAlgo_Section.hxx>
+#include <BOPAlgo_MakerVolume.hxx>
+
+#include <BOPCol_ListOfShape.hxx>
+#include <BOPCol_DataMapOfShapeShape.hxx>
+#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
+
+#include <BOPTools.hxx>
+#include <BOPTools_AlgoTools3D.hxx>
+#include <BOPTools_AlgoTools.hxx>
+
+#include <IntTools_Context.hxx>
+#include <IntTools_ShrunkRange.hxx>
+
+
+static
+  void IntersectTrimmedEdges(const TopTools_ListOfShape& theLF,
+                             const Handle(BRepAlgo_AsDes)& theAsDes,
+                             TopTools_DataMapOfShapeListOfShape& theOEImages,
+                             TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                             TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                             Handle(IntTools_Context)& theCtx,
+                             TopTools_MapOfShape& theNewEdges,
+                             TopTools_DataMapOfShapeShape& theETrimEInf);
+
+static
+  Standard_Boolean GetEdges(const TopoDS_Face& theFace,
+                            const Handle(BRepAlgo_AsDes)& theAsDes,
+                            const TopTools_DataMapOfShapeListOfShape& theEImages,
+                            const TopTools_MapOfShape& theLastInvEdges,
+                            const TopTools_IndexedMapOfShape& theInvEdges,
+                            Handle(IntTools_Context)& theCtx,
+                            const TopTools_MapOfShape& theModifiedEdges,
+                            TopoDS_Shape& theEdges,
+                            TopTools_IndexedMapOfShape& theInv);
+
+static
+  void BuildSplitsOfFace(const TopoDS_Face& theFace,
+                         const TopoDS_Shape& theEdges,
+                         Standard_Boolean bTrimmed,
+                         TopTools_DataMapOfShapeShape& theOrigins,
+                         TopTools_ListOfShape& theLFImages);
+
+static
+  void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF,
+                          const TopTools_MapOfShape& theModifiedEdges,
+                          const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                          Handle(BRepAlgo_AsDes)& theAsDes,
+                          TopTools_DataMapOfShapeShape& theFacesOrigins,
+                          TopTools_DataMapOfShapeListOfShape& theOEImages,
+                          TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                          TopTools_MapOfShape& theLastInvEdges,
+                          TopTools_IndexedMapOfShape& theEdgesToAvoid,
+                          TopTools_IndexedMapOfShape& theInvEdges,
+                          TopTools_IndexedMapOfShape& theValidEdges,
+                          TopTools_MapOfShape& theInvertedEdges,
+                          TopTools_DataMapOfShapeInteger& theAlreadyInvFaces,
+                          TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                          TopTools_DataMapOfShapeShape& theArtInvFaces,
+                          TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                          TopoDS_Shape& theSolids,
+                          TopTools_DataMapOfShapeListOfShape& theSSInterfs);
+
+static 
+  void BuildSplitsOfInvFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, 
+                             const TopTools_MapOfShape& theModifiedEdges,
+                             TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                             TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                             TopTools_DataMapOfShapeShape& theFacesOrigins,
+                             TopTools_DataMapOfShapeListOfShape& theOEImages,
+                             TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                             TopTools_MapOfShape& theLastInvEdges,
+                             TopTools_IndexedMapOfShape& theEdgesToAvoid,
+                             TopTools_MapOfShape& theVertsToAvoid,
+                             TopTools_DataMapOfShapeInteger& theAlreadyInvFaces,
+                             TopTools_IndexedMapOfShape& theValidEdges,
+                             TopTools_DataMapOfShapeShape& theETrimEInf,
+                             Handle(BRepAlgo_AsDes)& theAsDes);
+
+static 
+  Standard_Boolean CheckIfArtificial(const TopoDS_Shape& theF,
+                                     const TopTools_ListOfShape& theLFImages,
+                                     const TopoDS_Shape& theCE,
+                                     const TopTools_IndexedMapOfShape& theMapEInv,
+                                     const TopTools_DataMapOfShapeListOfShape& theOEImages,
+                                     TopTools_MapOfShape& theMENInv,
+                                     Handle(BRepAlgo_AsDes)& theAsDes);
+
+static
+  void FindInvalidEdges(const TopoDS_Face& theF,
+                        const TopTools_ListOfShape& theLFImages,
+                        const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                        const TopTools_DataMapOfShapeShape& theFacesOrigins,
+                        const TopTools_DataMapOfShapeListOfShape& theOEImages,
+                        const TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                        TopTools_IndexedMapOfShape& theInvEdges,
+                        TopTools_IndexedMapOfShape& theValidEdges,
+                        TopTools_DataMapOfShapeListOfShape& theDMFLVE,
+                        TopTools_DataMapOfShapeListOfShape& theDMFLNE,
+                        TopTools_DataMapOfShapeListOfShape& theDMFLIE,
+                        TopTools_DataMapOfShapeListOfShape& theDMFLVIE,
+                        TopTools_MapOfShape& theMEInverted,
+                        TopTools_MapOfShape& theEdgesInvalidByVertex);
+
+static
+  void FindInvalidFaces(TopTools_ListOfShape& theLFImages,
+                        const TopTools_IndexedMapOfShape& theInvEdges,
+                        const TopTools_IndexedMapOfShape& theValidEdges,
+                        const TopTools_DataMapOfShapeListOfShape& theDMFLVE,
+                        const TopTools_DataMapOfShapeListOfShape& theDMFLIE,
+                        const TopTools_ListOfShape& theLENeutral,
+                        const TopTools_ListOfShape& theLEValInverted,
+                        const TopTools_MapOfShape& theMEInverted,
+                        const TopTools_MapOfShape& theEdgesInvalidByVertex,
+                        TopTools_ListOfShape& theInvFaces);
+
+static
+  gp_Vec GetAverageTangent(const TopoDS_Shape& theS,
+                           const Standard_Integer theNbP);
+
+static
+  Standard_Boolean CheckInverted(const TopoDS_Edge& theEIm,
+                                 const TopoDS_Face& theFOr,
+                                 const TopTools_DataMapOfShapeListOfShape& theOEImages,
+                                 const TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                                 const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                                 const TopTools_IndexedDataMapOfShapeListOfShape& theDMEF,
+                                 const TopTools_IndexedDataMapOfShapeListOfShape& theDMVE,
+                                 const TopTools_IndexedMapOfShape& theMEdges,
+                                 TopTools_MapOfShape& theMEInverted);
+
+
+static
+  void RemoveInvalidSplitsByInvertedEdges(const TopTools_MapOfShape& theMEInverted,
+                                          TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                                          TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                                          TopTools_IndexedMapOfShape& theMERemoved);
+
+static
+  void RemoveInvalidSplitsFromValid(const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                                    const TopTools_DataMapOfShapeShape& theArtInvFaces,
+                                    const TopTools_MapOfShape& theMEInverted,
+                                    TopTools_IndexedDataMapOfShapeListOfShape& theFImages);
+
+static
+  void RemoveInsideFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                         TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                         const TopTools_DataMapOfShapeShape& theArtInvFaces,
+                         const TopTools_IndexedMapOfShape& theInvEdges,
+                         const TopTools_IndexedMapOfShape& theMFToCheckInt,
+                         TopTools_DataMapOfShapeListOfShape& theSSInterfs,
+                         TopTools_IndexedMapOfShape& theMERemoved,
+                         TopoDS_Shape& theSolids);
+
+static
+  void ShapesConnections(const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                         const TopTools_IndexedMapOfShape& theInvEdges,
+                         const TopTools_DataMapOfShapeShape& theDMFOr,
+                         BOPAlgo_Builder& theBuilder,
+                         TopTools_DataMapOfShapeListOfShape& theSSInterfs);
+
+static
+  void RemoveValidSplits(const TopTools_MapOfShape& theSpRem,
+                         TopTools_IndexedDataMapOfShapeListOfShape& theImages,
+                         BOPAlgo_Builder& theGF,
+                         TopTools_IndexedMapOfShape& theMERemoved);
+
+static
+  void RemoveInvalidSplits(const TopTools_MapOfShape& theSpRem,
+                           const TopTools_DataMapOfShapeShape& theArtInvFaces,
+                           const TopTools_IndexedMapOfShape& theInvEdges,
+                           TopTools_IndexedDataMapOfShapeListOfShape& theImages,
+                           BOPAlgo_Builder& theGF,
+                           TopTools_IndexedMapOfShape& theMERemoved);
+
+static
+  void FilterEdgesImages(const TopoDS_Shape& theS,
+                         TopTools_DataMapOfShapeListOfShape& theOEImages,
+                         TopTools_DataMapOfShapeListOfShape& theOEOrigins);
+
+static
+  void FilterInvalidFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                          const TopTools_IndexedDataMapOfShapeListOfShape& theDMFE,
+                          TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                          TopTools_DataMapOfShapeShape& theArtInvFaces);
+
+static
+  void FilterInvalidEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                          const TopTools_DataMapOfShapeShape& theArtInvFaces,
+                          const TopTools_DataMapOfShapeListOfShape& theDMFLIE,
+                          const TopTools_IndexedMapOfShape& theMERemoved,
+                          TopTools_IndexedMapOfShape& theInvEdges);
+
+static 
+  void FindFacesToRebuild(const TopTools_IndexedDataMapOfShapeListOfShape&  theLFImages,
+                          const TopTools_IndexedMapOfShape& theInvEdges,
+                          const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                          const TopTools_DataMapOfShapeListOfShape& theSSInterfs,
+                          TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+                          TopTools_MapOfShape& theFSelfRebAvoid);
+
+static
+  void RebuildFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+                    const TopTools_MapOfShape& theFSelfRebAvoid,
+                    const TopoDS_Shape& theSolids,
+                    const TopTools_DataMapOfShapeListOfShape& theSSInterfs,
+                    TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                    TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                    TopTools_DataMapOfShapeShape& theFacesOrigins,
+                    TopTools_DataMapOfShapeListOfShape& theOEImages,
+                    TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                    TopTools_MapOfShape& theLastInvEdges,
+                    TopTools_IndexedMapOfShape& theEdgesToAvoid,
+                    TopTools_IndexedMapOfShape& theInvEdges,
+                    TopTools_IndexedMapOfShape& theValidEdges,
+                    const TopTools_MapOfShape& theInvertedEdges,
+                    TopTools_DataMapOfShapeInteger& theAlreadyInvFaces,
+                    TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                    const TopTools_DataMapOfShapeShape& theArtInvFaces,
+                    TopTools_MapOfShape& theVertsToAvoid,
+                    TopTools_DataMapOfShapeShape& theETrimEInf,
+                    Handle(BRepAlgo_AsDes)& theAsDes);
+
+static
+  void IntersectFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+                      const TopTools_MapOfShape& theFSelfRebAvoid,
+                      const TopoDS_Shape& theSolids,
+                      const TopTools_DataMapOfShapeListOfShape& theSSInterfs,
+                      TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                      TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                      TopTools_DataMapOfShapeListOfShape& theOEImages,
+                      TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                      TopTools_IndexedMapOfShape& theInvEdges,
+                      TopTools_IndexedMapOfShape& theValidEdges,
+                      const TopTools_MapOfShape& theInvertedEdges,
+                      TopTools_IndexedMapOfShape& theEdgesToAvoid,
+                      TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                      const TopTools_DataMapOfShapeShape& theArtInvFaces,
+                      TopTools_MapOfShape& theVertsToAvoid,
+                      TopTools_DataMapOfShapeShape& theETrimEInf,
+                      TopTools_MapOfShape& theModifiedEdges,
+                      Handle(BRepAlgo_AsDes)& theAsDes);
+
+static
+  void PrepareFacesForIntersection(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+                                   const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                                   const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                                   const TopTools_DataMapOfShapeShape& theArtInvFaces,
+                                   const Standard_Boolean bLookVertToAvoid,
+                                   TopTools_IndexedDataMapOfShapeListOfShape& theFLE,
+                                   TopTools_DataMapOfShapeListOfShape& theMDone,
+                                   TopTools_DataMapOfShapeListOfShape& theDMSF,
+                                   TopTools_DataMapOfShapeListOfShape& theMEInfETrim,
+                                   TopTools_DataMapOfShapeListOfShape& theDMVEFull,
+                                   TopTools_DataMapOfShapeShape& theETrimEInf,
+                                   TopTools_IndexedDataMapOfShapeListOfShape& theDMEFInv);
+
+static
+  void FindVerticesToAvoid(const TopTools_IndexedDataMapOfShapeListOfShape& theDMEFInv,
+                           const TopTools_IndexedMapOfShape& theInvEdges,
+                           const TopTools_IndexedMapOfShape& theValidEdges,
+                           TopTools_DataMapOfShapeListOfShape& theDMVEFull,
+                           TopTools_MapOfShape& theMVRInv);
+
+static
+  void FindFacesForIntersection(const TopoDS_Shape& theFInv,
+                                const TopTools_IndexedMapOfShape& theME,
+                                const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                                const TopTools_DataMapOfShapeListOfShape& theDMSF,
+                                const TopTools_MapOfShape& theMVInvAll,
+                                const TopTools_DataMapOfShapeShape& theArtInvFaces,
+                                const Standard_Boolean theArtCase,
+                                const TopTools_DataMapOfShapeListOfShape& theSSInterfs,
+                                TopTools_IndexedMapOfShape& theMFAvoid,
+                                TopTools_IndexedMapOfShape& theMFInt,
+                                TopTools_IndexedMapOfShape& theMFIntExt,
+                                TopTools_ListOfShape& theLFImInt);
+
+static
+  void ProcessCommonEdges(const TopTools_ListOfShape& theLEC,
+                          const TopTools_IndexedMapOfShape& theInvEdges,
+                          const TopTools_IndexedMapOfShape& theValidEdges,
+                          const TopTools_IndexedMapOfShape& theME,
+                          const TopTools_DataMapOfShapeShape& theETrimEInf,
+                          const TopTools_DataMapOfShapeListOfShape& theMEInfETrim,
+                          const TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                          const Standard_Boolean theForceUse,
+                          TopTools_IndexedMapOfShape& theMECV,
+                          TopTools_DataMapOfShapeListOfShape& theDMEETrim,
+                          TopTools_ListOfShape& theLFEi,
+                          TopTools_ListOfShape& theLFEj,
+                          TopTools_IndexedMapOfShape& theMEToInt);
+
+static
+  void UpdateIntersectedFaces(const TopoDS_Shape& theFInv,
+                              const TopoDS_Shape& theFi,
+                              const TopoDS_Shape& theFj,
+                              const TopTools_ListOfShape& theLFInv,
+                              const TopTools_ListOfShape& theLFImi,
+                              const TopTools_ListOfShape& theLFImj,
+                              const TopTools_ListOfShape& theLFEi,
+                              const TopTools_ListOfShape& theLFEj,
+                              TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                              TopTools_IndexedMapOfShape& theMEToInt);
+
+static
+  void IntersectFaces(const TopoDS_Shape& theFInv,
+                      const TopoDS_Shape& theFi,
+                      const TopoDS_Shape& theFj,
+                      const TopTools_ListOfShape& theLFInv,
+                      const TopTools_ListOfShape& theLFImi,
+                      const TopTools_ListOfShape& theLFImj,
+                      TopTools_ListOfShape& theLFEi,
+                      TopTools_ListOfShape& theLFEj,
+                      TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                      TopTools_IndexedMapOfShape& theMECV,
+                      TopTools_IndexedMapOfShape& theMEToInt);
+
+static 
+  void FindOrigins(const TopTools_ListOfShape& theLFIm1,
+                   const TopTools_ListOfShape& theLFIm2,
+                   const TopTools_IndexedMapOfShape& theME,
+                   const TopTools_DataMapOfShapeListOfShape& theOrigins,
+                   TopTools_ListOfShape& theLEOr);
+
+static
+  void IntersectAndTrimEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+                             const TopTools_IndexedMapOfShape& theMFInt,
+                             const TopTools_IndexedMapOfShape& theMEInt,
+                             const TopTools_DataMapOfShapeListOfShape& theDMEETrim,
+                             const TopTools_IndexedMapOfShape& theMSInv,
+                             const TopTools_IndexedMapOfShape& theMVE,
+                             const TopTools_MapOfShape& theVertsToAvoid,
+                             const TopTools_MapOfShape& theNewVertsToAvoid,
+                             TopTools_MapOfShape& theMVBounds,
+                             TopTools_DataMapOfShapeListOfShape& theEImages);
+
+static
+  void GetInvalidEdges(const TopTools_MapOfShape& theVertsToAvoid,
+                       const TopTools_MapOfShape& theMVBounds,
+                       BOPAlgo_Builder& theGF,
+                       TopTools_MapOfShape& theMEInv);
+
+static 
+  void UpdateValidEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+                        const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                        const TopTools_IndexedDataMapOfShapeListOfShape& theFLE,
+                        const TopTools_MapOfShape& theMVBounds,
+                        const TopoDS_Shape& theSolids,
+                        const TopTools_IndexedMapOfShape& theInvEdges,
+                        const TopTools_MapOfShape& theInvertedEdges,
+                        TopTools_IndexedMapOfShape& theEdgesToAvoid,
+                        TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                        TopTools_DataMapOfShapeListOfShape& theOEImages,
+                        TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                        TopTools_MapOfShape& theVertsToAvoid,
+                        TopTools_DataMapOfShapeShape& theETrimEInf,
+                        TopTools_DataMapOfShapeListOfShape& theEImages,
+                        TopTools_DataMapOfShapeListOfShape& theEETrim,
+                        TopTools_MapOfShape& theModifiedEdges,
+                        Handle(BRepAlgo_AsDes)& theAsDes);
+
+static
+  void TrimNewIntersectionEdges(const TopTools_ListOfShape& theLE,
+                                const TopTools_DataMapOfShapeListOfShape& theEETrim,
+                                const TopTools_MapOfShape& theMVBounds,
+                                TopTools_DataMapOfShapeListOfShape& theEImages,
+                                TopTools_MapOfShape& theMEB,
+                                TopTools_MapOfShape& theMVOld,
+                                TopTools_ListOfShape& theLENew,
+                                BOPCol_ListOfShape& theLA,
+                                TopTools_DataMapOfShapeListOfShape& theDMEOr);
+
+static
+  void IntersectEdges(const BOPCol_ListOfShape& theLA,
+                      const TopTools_ListOfShape& theLE,
+                      const TopTools_ListOfShape& theLENew,
+                      const TopTools_MapOfShape& theMVBounds,
+                      const TopTools_MapOfShape& theVertsToAvoid,
+                      TopTools_DataMapOfShapeListOfShape& theEImages,
+                      TopTools_MapOfShape& theModifiedEdges,
+                      TopTools_DataMapOfShapeListOfShape& theDMEOr,
+                      TopTools_MapOfShape& theMENew,
+                      TopoDS_Shape& theSplits);
+
+static
+  void GetBounds(const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                 const TopTools_MapOfShape& theMEB,
+                 TopoDS_Shape& theBounds);
+
+static
+  void GetBoundsToUpdate(const TopTools_ListOfShape& theLF,
+                         const TopTools_DataMapOfShapeListOfShape& theOEImages,
+                         const TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                         const TopTools_MapOfShape& theMEB,
+                         TopTools_ListOfShape& theLABounds,
+                         TopTools_ListOfShape& theLAValid,
+                         TopoDS_Shape& theBounds,
+                         Handle(BRepAlgo_AsDes)& theAsDes);
+
+static
+  void GetInvalidEdgesByBounds(const TopoDS_Shape& theSplits,
+                               const TopoDS_Shape& theBounds,
+                               const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+                               const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                               const TopoDS_Shape& theSolids,
+                               const TopTools_IndexedMapOfShape& theInvEdges,
+                               const TopTools_MapOfShape& theMVOld,
+                               const TopTools_MapOfShape& theMENew,
+                               const TopTools_DataMapOfShapeListOfShape& theDMEOr,
+                               const TopTools_DataMapOfShapeListOfShape& theEImages,
+                               TopTools_MapOfShape& theVertsToAvoid,
+                               TopTools_MapOfShape& theMEInv);
+
+static
+  void UpdateNewIntersectionEdges(const TopTools_ListOfShape& theLE,
+                                  const TopTools_DataMapOfShapeListOfShape& theMELF,
+                                  const TopTools_DataMapOfShapeListOfShape& theEImages,
+                                  const TopTools_IndexedMapOfShape& theInvEdges,
+                                  const TopTools_MapOfShape& theInvertedEdges,
+                                  TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                                  TopTools_DataMapOfShapeListOfShape& theOEImages,
+                                  TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                                  TopTools_DataMapOfShapeShape& theETrimEInf,
+                                  TopTools_DataMapOfShapeListOfShape& theEETrim,
+                                  TopTools_MapOfShape& theModifiedEdges,
+                                  Handle(BRepAlgo_AsDes)& theAsDes);
+
+static
+  void FillHistory(const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                   const TopTools_DataMapOfShapeListOfShape& theEImages,
+                   BRepAlgo_Image& theImage);
+
+static
+  void UpdateOrigins(const TopTools_ListOfShape& theLA,
+                     TopTools_DataMapOfShapeListOfShape& theOrigins,
+                     BOPAlgo_Builder& theGF);
+
+static
+  void UpdateImages(const TopTools_ListOfShape& theLA,
+                    TopTools_DataMapOfShapeListOfShape& theImages,
+                    BOPAlgo_Builder& theGF,
+                    TopTools_MapOfShape& theModified);
+
+static
+  void UpdateIntersectedEdges(const TopTools_ListOfShape& theLA,
+                              TopTools_DataMapOfShapeShape& theETrimEInf,
+                              BOPAlgo_Builder& theGF);
+
+static
+  Standard_Boolean ProcessMicroEdge(const TopoDS_Edge& theEdge,
+                                    const Handle(IntTools_Context)& theCtx);
+
+static
+  void FindCommonParts(const TopTools_ListOfShape& theLS1,
+                       const TopTools_ListOfShape& theLS2,
+                       TopTools_ListOfShape& theLSC,
+                       const TopAbs_ShapeEnum theType = TopAbs_EDGE);
+
+static
+  Standard_Integer NbPoints(const TopoDS_Edge& theE);
+
+static
+  Standard_Boolean FindShape(const TopoDS_Shape& theSWhat,
+                             const TopoDS_Shape& theSWhere,
+                             TopoDS_Shape& theRes);
+
+static
+  void AppendToList(TopTools_ListOfShape& theL,
+                    const TopoDS_Shape& theS);
+
+//=======================================================================
+//function : BuildSplitsOfTrimmedFaces
+//purpose  : Building splits of already trimmed faces
+//=======================================================================
+void BRepOffset_MakeOffset::BuildSplitsOfTrimmedFaces(const TopTools_ListOfShape& theLF,
+                                                      Handle(BRepAlgo_AsDes)& theAsDes,
+                                                      BRepAlgo_Image& theImage)
+{
+  TopTools_DataMapOfShapeListOfShape anEImages, anEOrigins;
+  TopTools_IndexedDataMapOfShapeListOfShape aDMFFIm;
+  TopTools_IndexedMapOfShape anEmptyIM;
+  TopTools_DataMapOfShapeListOfShape anEmptyDMSLS;
+  TopTools_DataMapOfShapeShape anEmptyDMSS;
+  TopTools_MapOfShape aNewEdges, anEmptyM;
+  //
+  // firstly it is necessary to fuse all the edges
+  Handle(IntTools_Context) aCtx = new IntTools_Context();
+  //
+  IntersectTrimmedEdges(theLF, theAsDes, anEImages, anEOrigins, anEmptyDMSLS, aCtx, aNewEdges, anEmptyDMSS);
+  //
+  TopTools_ListIteratorOfListOfShape aItLF(theLF);
+  for (; aItLF.More(); aItLF.Next()) {
+    const TopoDS_Face& aF = *(TopoDS_Face*)&aItLF.Value();
+    //
+    TopoDS_Shape aCE;
+    TopTools_ListOfShape aLFImages;
+    //
+    Standard_Boolean bFound = GetEdges(aF, theAsDes, anEImages, anEmptyM,
+                                       anEmptyIM, aCtx, aNewEdges, aCE, anEmptyIM);
+    // split the face by the edges
+    if (!bFound) {
+      if (!theImage.HasImage(aF)) {
+        aLFImages.Append(aF);
+        aDMFFIm.Add(aF, aLFImages);
+      }
+      continue;
+    }
+    //
+    BuildSplitsOfFace(aF, aCE, Standard_True, anEmptyDMSS, aLFImages);
+    aDMFFIm.Add(aF, aLFImages);
+  }
+  // Fill history for faces and edges
+  FillHistory(aDMFFIm, anEImages, theImage);
+}
+
+//=======================================================================
+//function : BuildSplitsOfExtendedFaces
+//purpose  : Building splits of not-trimmed offset faces.
+//           For the cases in which invalidity will be found,
+//           these invalidities will be rebuilt.
+//=======================================================================
+void BRepOffset_MakeOffset::BuildSplitsOfExtendedFaces(const TopTools_ListOfShape& theLF,
+                                                       Handle(BRepAlgo_AsDes)& theAsDes,
+                                                       TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                                                       TopTools_DataMapOfShapeShape& theFacesOrigins,
+                                                       TopTools_DataMapOfShapeShape& theETrimEInf,
+                                                       BRepAlgo_Image& theImage)
+{
+  Handle(IntTools_Context) aCtx = new IntTools_Context();
+  // images and origins for offset edges
+  TopTools_DataMapOfShapeListOfShape anOEImages, anOEOrigins;
+  TopTools_MapOfShape aNewEdges;
+  // fusing all trimmed offset edges to avoid self-intersections in the splits
+  IntersectTrimmedEdges(theLF, theAsDes, anOEImages, anOEOrigins,
+                        theEdgesOrigins, aCtx, aNewEdges, theETrimEInf);
+  //
+  // valid/invalid edges
+  TopTools_IndexedMapOfShape anInvEdges, aValidEdges, anEdgesToAvoid;
+  // inverted edges
+  TopTools_MapOfShape anInvertedEdges;
+  // splits of faces
+  TopTools_IndexedDataMapOfShapeListOfShape aFImages;
+  // found invalid faces
+  TopTools_IndexedDataMapOfShapeListOfShape anInvFaces;
+  // artificially invalid faces - it will be empty here,
+  // but may be filled on the following rebuilding steps
+  TopTools_DataMapOfShapeShape anArtInvFaces;
+  // shapes connections for using in rebuilding
+  TopTools_DataMapOfShapeListOfShape aSSInterfs;
+  // edges to avoid on second steps
+  TopTools_MapOfShape aLastInvEdges;
+  // keep information of already invalid faces to avoid
+  // infinite rebuilding of the same invalid face
+  TopTools_DataMapOfShapeInteger anAlreadyInvFaces;
+  // solid build from the new splits
+  TopoDS_Shape aSolids;
+  // now we can split the faces
+  BuildSplitsOfFaces(theLF, aNewEdges, theEdgesOrigins, theAsDes, theFacesOrigins,
+                     anOEImages, anOEOrigins, aLastInvEdges, anEdgesToAvoid, anInvEdges, aValidEdges,
+                     anInvertedEdges, anAlreadyInvFaces, anInvFaces, anArtInvFaces, aFImages, aSolids, aSSInterfs);
+  //
+  // Find faces to rebuild
+  if (anInvFaces.Extent()) {
+    TopTools_IndexedDataMapOfShapeListOfShape aFToRebuild;
+    TopTools_MapOfShape aFSelfRebAvoid;
+    FindFacesToRebuild(aFImages, anInvEdges, anInvFaces, aSSInterfs, aFToRebuild, aFSelfRebAvoid);
+    //
+    if (aFToRebuild.Extent()) {
+      // vertices to avoid
+      TopTools_MapOfShape aVAEmpty;
+      RebuildFaces(aFToRebuild, aFSelfRebAvoid, aSolids, aSSInterfs, aFImages, theEdgesOrigins, theFacesOrigins,
+                   anOEImages, anOEOrigins, aLastInvEdges, anEdgesToAvoid, anInvEdges, aValidEdges, anInvertedEdges,
+                   anAlreadyInvFaces, anInvFaces, anArtInvFaces, aVAEmpty, theETrimEInf, theAsDes);
+    }
+  }
+  // Fill history for faces and edges
+  FillHistory(aFImages, anOEImages, theImage);
+}
+
+//=======================================================================
+//function : BuildSplitsOfInvFaces
+//purpose  : Rebuilding splits of faces with new intersection edges
+//=======================================================================
+void BuildSplitsOfInvFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, 
+                           const TopTools_MapOfShape& theModifiedEdges,
+                           TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                           TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                           TopTools_DataMapOfShapeShape& theFacesOrigins,
+                           TopTools_DataMapOfShapeListOfShape& theOEImages,
+                           TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                           TopTools_MapOfShape& theLastInvEdges,
+                           TopTools_IndexedMapOfShape& theEdgesToAvoid,
+                           TopTools_MapOfShape& theVertsToAvoid,
+                           TopTools_DataMapOfShapeInteger& theAlreadyInvFaces,
+                           TopTools_IndexedMapOfShape& theValidEdges,
+                           TopTools_DataMapOfShapeShape& theETrimEInf, 
+                           Handle(BRepAlgo_AsDes)& theAsDes)
+{
+  Standard_Integer aNb = theFToRebuild.Extent();
+  if (!aNb) {
+    return;
+  }
+  //
+  TopTools_ListOfShape aLF;
+  aNb = theFImages.Extent();
+  for (Standard_Integer i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aF = theFImages.FindKey(i);
+    aLF.Append(aF);
+  }
+  //
+  // invalid faces
+  TopTools_IndexedDataMapOfShapeListOfShape anInvFaces;
+  // artificially invalid faces
+  TopTools_DataMapOfShapeShape anArtInvFaces;
+  // invalid edges
+  TopTools_IndexedMapOfShape anInvEdges;
+  // inverted edges
+  TopTools_MapOfShape anInvertedEdges;
+  // shapes connection for using in rebuilding process
+  TopTools_DataMapOfShapeListOfShape aSSInterfs;
+  //
+  TopoDS_Shape aSolids;
+  //
+  BuildSplitsOfFaces(aLF, theModifiedEdges, theEdgesOrigins, theAsDes, theFacesOrigins, 
+                     theOEImages, theOEOrigins, theLastInvEdges, theEdgesToAvoid, anInvEdges, theValidEdges, 
+                     anInvertedEdges, theAlreadyInvFaces, anInvFaces, anArtInvFaces, theFImages, aSolids, aSSInterfs);
+  //
+  if (anInvFaces.Extent()) {
+    TopTools_IndexedDataMapOfShapeListOfShape aFToRebuild;
+    TopTools_MapOfShape aFSelfRebAvoid;
+    FindFacesToRebuild(theFImages, anInvEdges, anInvFaces, aSSInterfs, aFToRebuild, aFSelfRebAvoid);
+    //
+    if (aFToRebuild.Extent()) {
+      RebuildFaces(aFToRebuild, aFSelfRebAvoid, aSolids, aSSInterfs, theFImages, theEdgesOrigins, theFacesOrigins,
+                   theOEImages, theOEOrigins, theLastInvEdges, theEdgesToAvoid, anInvEdges, theValidEdges, anInvertedEdges,
+                   theAlreadyInvFaces, anInvFaces, anArtInvFaces, theVertsToAvoid, theETrimEInf, theAsDes);
+    }
+  }
+}
+
+//=======================================================================
+//function : BuildSplitsOfFaces
+//purpose  : Building the splits of offset faces and
+//           looking for the invalid splits
+//=======================================================================
+void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF,
+                        const TopTools_MapOfShape& theModifiedEdges,
+                        const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                        Handle(BRepAlgo_AsDes)& theAsDes,
+                        TopTools_DataMapOfShapeShape& theFacesOrigins,
+                        TopTools_DataMapOfShapeListOfShape& theOEImages,
+                        TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                        TopTools_MapOfShape& theLastInvEdges,
+                        TopTools_IndexedMapOfShape& theEdgesToAvoid,
+                        TopTools_IndexedMapOfShape& theInvEdges,
+                        TopTools_IndexedMapOfShape& theValidEdges,
+                        TopTools_MapOfShape& theInvertedEdges,
+                        TopTools_DataMapOfShapeInteger& theAlreadyInvFaces,
+                        TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                        TopTools_DataMapOfShapeShape& theArtInvFaces,
+                        TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                        TopoDS_Shape& theSolids,
+                        TopTools_DataMapOfShapeListOfShape& theSSInterfs)
+{
+  if (theLF.IsEmpty()) {
+    return;
+  }
+  //
+  BRep_Builder aBB;
+  Standard_Integer i, aNb;
+  //
+  // processed faces
+  TopTools_ListOfShape aLFDone;
+  // extended face - list of neutral edges, i.e. in one splits - valid and in others - invalid
+  TopTools_DataMapOfShapeListOfShape aDMFLNE;
+  // list of valid edges for each face
+  TopTools_DataMapOfShapeListOfShape aDMFLVE;
+  // list of invalid edges for each face
+  TopTools_DataMapOfShapeListOfShape aDMFLIE;
+  // map of valid inverted edges for the face
+  TopTools_DataMapOfShapeListOfShape aDMFLVIE;
+  // map of splits to check for internals
+  TopTools_IndexedMapOfShape aMFToCheckInt;
+  // map of edges created from vertex and marked as invalid
+  TopTools_MapOfShape aMEdgeInvalidByVertex;
+  //
+  Handle(IntTools_Context) aCtx = new IntTools_Context;
+  // build splits of faces
+  TopTools_ListIteratorOfListOfShape aItLF(theLF);
+  for (; aItLF.More(); aItLF.Next()) {
+    const TopoDS_Face& aF = *(TopoDS_Face*)&aItLF.Value();
+    //
+    TopTools_ListOfShape* pLFIm = theFImages.ChangeSeek(aF);
+    if (pLFIm && pLFIm->IsEmpty()) {
+      continue;
+    }
+    // get edges by which the face should be split
+    TopoDS_Shape aCE;
+    TopTools_IndexedMapOfShape aMapEInv;
+    Standard_Boolean bFound =
+      GetEdges(aF, theAsDes, theOEImages, theLastInvEdges,
+               theEdgesToAvoid, aCtx, theModifiedEdges, aCE, aMapEInv);
+    if (!bFound) {
+      continue;
+    }
+    //
+    // build splits
+    TopTools_ListOfShape aLFImages;
+    BuildSplitsOfFace(aF, aCE, Standard_False, theFacesOrigins, aLFImages);
+    //
+    if (aMapEInv.Extent()) {
+      // check if all possible faces are built
+      TopTools_MapOfShape aMENInv;
+      Standard_Boolean bArtificialCase = aLFImages.IsEmpty() ||
+        CheckIfArtificial(aF, aLFImages, aCE, aMapEInv, theOEImages, aMENInv, theAsDes);
+      //
+      // try to build splits using invalid edges
+      TopoDS_Compound aCE1;
+      aBB.MakeCompound(aCE1);
+      aBB.Add(aCE1, aCE);
+      for (i = 1; i <= aMapEInv.Extent(); ++i) {
+        aBB.Add(aCE1, aMapEInv(i));
+      }
+      //
+      TopTools_ListOfShape aLFImages1;
+      BuildSplitsOfFace(aF, aCE1, Standard_False, theFacesOrigins, aLFImages1);
+      //
+      // additionally check if newly created faces are not the same
+      Standard_Boolean bAllInv = Standard_True;
+      TopTools_ListIteratorOfListOfShape aItLFIm(aLFImages1);
+      for (; aItLFIm.More();) {
+        const TopoDS_Shape& aFIm = aItLFIm.Value();
+        TopExp_Explorer aExpE(aFIm, TopAbs_EDGE);
+        for (; aExpE.More(); aExpE.Next()) {
+          const TopoDS_Shape& aE = aExpE.Current();
+          if (!aMapEInv.Contains(aE) && !aMENInv.Contains(aE)) {
+            break;
+          }
+          else if (bAllInv) {
+            bAllInv = aMapEInv.Contains(aE);
+          }
+        }
+        //
+        if (!aExpE.More()) {
+          if (bAllInv) {
+            aMFToCheckInt.Add(aFIm);
+          }
+          aLFImages1.Remove(aItLFIm);
+        }
+        else {
+          aItLFIm.Next();
+        }
+      }
+      //
+      if (bArtificialCase) {
+        if (aLFImages.Extent() == aLFImages1.Extent()) {
+          bArtificialCase = Standard_False;
+        }
+        else {
+          aLFImages = aLFImages1;
+        }
+      }
+      //
+      if (bArtificialCase) {
+        TopTools_ListOfShape aLEInv;
+        // make the face invalid
+        theArtInvFaces.Bind(aF, aCE);
+        //
+        *pLFIm = aLFImages;
+        TopTools_ListIteratorOfListOfShape aItLFIm(aLFImages);
+        for (; aItLFIm.More(); aItLFIm.Next()) {
+          const TopoDS_Shape& aFIm = aItLFIm.Value();
+          TopExp_Explorer aExpE(aFIm, TopAbs_EDGE);
+          for (; aExpE.More(); aExpE.Next()) {
+            const TopoDS_Shape& aE = aExpE.Current();
+            if (aMapEInv.Contains(aE)) {
+              theInvEdges.Add(aE);
+              AppendToList(aLEInv, aE);
+            }
+            else {
+              theValidEdges.Add(aE);
+            }
+          }
+        }
+        //
+        aDMFLIE.Bind(aF, aLEInv);
+        aLFDone.Append(aF);
+        //
+        continue;
+      }
+    }
+    //
+    // find invalid edges
+    FindInvalidEdges(aF, aLFImages, theEdgesOrigins, theFacesOrigins, theOEImages,
+                     theOEOrigins, theInvEdges, theValidEdges, aDMFLVE, aDMFLNE, aDMFLIE,
+                     aDMFLVIE, theInvertedEdges, aMEdgeInvalidByVertex);
+    //
+    // save the new splits
+    if (!pLFIm) {
+      pLFIm = &theFImages(theFImages.Add(aF, TopTools_ListOfShape()));
+    }
+    else {
+      pLFIm->Clear();
+    }
+    pLFIm->Append(aLFImages);
+    //
+    aLFDone.Append(aF);
+  }
+  //
+  if (theInvEdges.IsEmpty() && theArtInvFaces.IsEmpty()) {
+    return;
+  }
+  //
+#ifdef OFFSET_DEBUG
+  // show invalid edges
+  TopoDS_Compound aCEInv1;
+  BRep_Builder().MakeCompound(aCEInv1);
+  Standard_Integer aNbEInv = theInvEdges.Extent();
+  for (i = 1; i <= aNbEInv; ++i) {
+    const TopoDS_Shape& aE = theInvEdges(i);
+    BRep_Builder().Add(aCEInv1, aE);
+  }
+  //
+  TopoDS_Compound aCEVal1;
+  BRep_Builder().MakeCompound(aCEVal1);
+  aNbEInv = theValidEdges.Extent();
+  for (i = 1; i <= aNbEInv; ++i) {
+    const TopoDS_Shape& aE = theValidEdges(i);
+    BRep_Builder().Add(aCEVal1, aE);
+  }
+#endif
+  //
+  TopTools_ListOfShape anEmptyList;
+  // find invalid faces
+  // considering faces containing only invalid edges as invalid
+  aItLF.Initialize(aLFDone);
+  for (; aItLF.More(); aItLF.Next()) {
+    const TopoDS_Shape& aF = aItLF.Value();
+    TopTools_ListOfShape& aLFImages = theFImages.ChangeFromKey(aF);
+    //
+    TopTools_ListOfShape aLFInv;
+    Standard_Boolean bArtificialCase = theArtInvFaces.IsBound(aF);
+    if (bArtificialCase) {
+      aLFInv = aLFImages;
+    }
+    else {
+      // neutral edges
+      TopTools_ListOfShape* pLNE = aDMFLNE.ChangeSeek(aF);
+      if (!pLNE) {
+        pLNE = &anEmptyList;
+      }
+      // valid inverted edges
+      TopTools_ListOfShape* pLIVE = aDMFLVIE.ChangeSeek(aF);
+      if (!pLIVE) {
+        pLIVE = &anEmptyList;
+      }
+      //
+      FindInvalidFaces(aLFImages, theInvEdges, theValidEdges, aDMFLVE, aDMFLIE,
+                       *pLNE, *pLIVE, theInvertedEdges, aMEdgeInvalidByVertex, aLFInv);
+    }
+    //
+    if (aLFInv.Extent()) {
+      if (theAlreadyInvFaces.IsBound(aF)) {
+        if (theAlreadyInvFaces.Find(aF) > 2) {
+          if (aLFInv.Extent() == aLFImages.Extent() && !bArtificialCase) {
+            aLFImages.Clear();
+          }
+          //
+          aLFInv.Clear();
+        }
+      }
+      theInvFaces.Add(aF, aLFInv);
+    }
+  }
+  //
+  if (theInvFaces.IsEmpty()) {
+    theInvEdges.Clear();
+    return;
+  }
+  //
+#ifdef OFFSET_DEBUG
+  // show invalid faces
+  TopoDS_Compound aCFInv1;
+  BRep_Builder().MakeCompound(aCFInv1);
+  Standard_Integer aNbFInv = theInvFaces.Extent();
+  for (i = 1; i <= aNbFInv; ++i) {
+    const TopTools_ListOfShape& aLFInv = theInvFaces(i);
+    TopTools_ListIteratorOfListOfShape aItLFInv(aLFInv);
+    for (; aItLFInv.More(); aItLFInv.Next()) {
+      const TopoDS_Shape& aFIm = aItLFInv.Value();
+      BRep_Builder().Add(aCFInv1, aFIm);
+    }
+  }
+#endif
+  //
+  TopTools_IndexedMapOfShape aMERemoved;
+  // remove invalid splits of faces using inverted edges
+  RemoveInvalidSplitsByInvertedEdges(theInvertedEdges, theInvFaces, theFImages, aMERemoved);
+  if (theInvFaces.IsEmpty()) {
+    theInvEdges.Clear();
+    return;
+  }
+  //
+  // remove invalid splits from valid splits
+  RemoveInvalidSplitsFromValid(theInvFaces, theArtInvFaces, theInvertedEdges, theFImages);
+  //
+  // remove inside faces
+  RemoveInsideFaces(theFImages, theInvFaces, theArtInvFaces, 
+                    theInvEdges, aMFToCheckInt, theSSInterfs, aMERemoved, theSolids);
+  //
+  // make compound of valid splits
+  TopoDS_Compound aCFIm;
+  aBB.MakeCompound(aCFIm);
+  //
+  aNb = theFImages.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopTools_ListOfShape& aLFIm = theFImages(i);
+    aItLF.Initialize(aLFIm);
+    for (; aItLF.More(); aItLF.Next()) {
+      const TopoDS_Shape& aFIm = aItLF.Value();
+      aBB.Add(aCFIm, aFIm);
+    }
+  }
+  //
+  TopTools_IndexedDataMapOfShapeListOfShape aDMFE;
+  TopExp::MapShapesAndAncestors(aCFIm, TopAbs_EDGE, TopAbs_FACE, aDMFE);
+  //
+  // filter maps of images and origins
+  FilterEdgesImages(aCFIm, theOEImages, theOEOrigins);
+  //
+  // filter invalid faces
+  FilterInvalidFaces(theFImages, aDMFE, theInvFaces, theArtInvFaces);
+  aNb = theInvFaces.Extent();
+  if (!aNb) {
+    theInvEdges.Clear();
+    return;
+  }
+  //
+#ifdef OFFSET_DEBUG
+  // show invalid faces
+  TopoDS_Compound aCFInv;
+  BRep_Builder().MakeCompound(aCFInv);
+  aNbFInv = theInvFaces.Extent();
+  for (i = 1; i <= aNbFInv; ++i) {
+    const TopTools_ListOfShape& aLFInv = theInvFaces(i);
+    TopTools_ListIteratorOfListOfShape aItLFInv(aLFInv);
+    for (; aItLFInv.More(); aItLFInv.Next()) {
+      const TopoDS_Shape& aFIm = aItLFInv.Value();
+      BRep_Builder().Add(aCFInv, aFIm);
+    }
+  }
+#endif
+  //
+  // filter invalid edges
+  FilterInvalidEdges(theInvFaces, theArtInvFaces, aDMFLIE, aMERemoved, theInvEdges);
+  //
+#ifdef OFFSET_DEBUG
+  // show invalid edges
+  TopoDS_Compound aCEInv;
+  BRep_Builder().MakeCompound(aCEInv);
+  aNbEInv = theInvEdges.Extent();
+  for (i = 1; i <= aNbEInv; ++i) {
+    const TopoDS_Shape& aE = theInvEdges(i);
+    BRep_Builder().Add(aCEInv, aE);
+  }
+#endif
+  //
+  theLastInvEdges.Clear();
+  aNb = theInvEdges.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aE = theInvEdges(i);
+    theEdgesToAvoid.Add(aE);
+    theLastInvEdges.Add(aE);
+  }
+  //
+  aNb = theInvFaces.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aF = theInvFaces.FindKey(i);
+    if (theAlreadyInvFaces.IsBound(aF)) {
+      theAlreadyInvFaces.ChangeFind(aF)++;
+    }
+    else {
+      theAlreadyInvFaces.Bind(aF, 1);
+    }
+  }
+}
+
+//=======================================================================
+//function : IntersectTrimmedEdges
+//purpose  : Intersection of the trimmed edges among themselves
+//=======================================================================
+void IntersectTrimmedEdges(const TopTools_ListOfShape& theLF,
+                           const Handle(BRepAlgo_AsDes)& theAsDes,
+                           TopTools_DataMapOfShapeListOfShape& theOEImages,
+                           TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                           TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                           Handle(IntTools_Context)& theCtx,
+                           TopTools_MapOfShape& theNewEdges,
+                           TopTools_DataMapOfShapeShape& theETrimEInf)
+{
+  if (theLF.IsEmpty()) {
+    return;
+  }
+  //
+  // get edges to intersect from descendants of the offset faces
+  BOPCol_ListOfShape aLS;
+  //
+  TopTools_ListIteratorOfListOfShape aItLF(theLF);
+  for (; aItLF.More(); aItLF.Next()) {
+    const TopoDS_Face& aF = *(TopoDS_Face*)&aItLF.Value();
+    //
+    const TopTools_ListOfShape& aLE = theAsDes->Descendant(aF);
+    TopTools_ListIteratorOfListOfShape aItLE(aLE);
+    for (; aItLE.More(); aItLE.Next()) {
+      const TopoDS_Edge& aE = *(TopoDS_Edge*)&aItLE.Value();
+      //
+      if (ProcessMicroEdge(aE, theCtx)) {
+        continue;
+      }
+      //
+      if (theNewEdges.Add(aE)) {
+        aLS.Append(aE);
+      }
+    }
+  }
+  //
+  if (aLS.Extent() < 2) {
+    // nothing to intersect
+    return;
+  }
+  //
+  // perform intersection of the edges
+  BOPAlgo_Builder aGFE;
+  aGFE.SetArguments(aLS);
+  aGFE.Perform();
+  if (aGFE.ErrorStatus()) {
+    return;
+  }
+  //
+  TopTools_ListOfShape aLA;
+  // fill map with edges images
+  BOPCol_ListIteratorOfListOfShape aIt(aLS);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aE = aIt.Value();
+    const TopTools_ListOfShape& aLEIm = aGFE.Modified(aE);
+    if (aLEIm.IsEmpty()) {
+      continue;
+    }
+    //
+    aLA.Append(aE);
+    // save images
+    theOEImages.Bind(aE, aLEIm);
+    // save origins
+    TopTools_ListIteratorOfListOfShape aItLE(aLEIm);
+    for (; aItLE.More(); aItLE.Next()) {
+      const TopoDS_Shape& aEIm = aItLE.Value();
+      TopTools_ListOfShape* pLEOr = theOEOrigins.ChangeSeek(aEIm);
+      if (!pLEOr) {
+        pLEOr = theOEOrigins.Bound(aEIm, TopTools_ListOfShape());
+      }
+      AppendToList(*pLEOr, aE);
+    }
+  }
+  //
+  UpdateOrigins(aLA, theEdgesOrigins, aGFE);
+  UpdateIntersectedEdges(aLA, theETrimEInf, aGFE);
+}
+
+//=======================================================================
+//function : GetEdges
+//purpose  : Getting edges from AsDes map to build the splits of faces
+//=======================================================================
+Standard_Boolean GetEdges(const TopoDS_Face& theFace,
+                          const Handle(BRepAlgo_AsDes)& theAsDes,
+                          const TopTools_DataMapOfShapeListOfShape& theEImages,
+                          const TopTools_MapOfShape& theLastInvEdges,
+                          const TopTools_IndexedMapOfShape& theInvEdges,
+                          Handle(IntTools_Context)& theCtx,
+                          const TopTools_MapOfShape& theModifiedEdges,
+                          TopoDS_Shape& theEdges,
+                          TopTools_IndexedMapOfShape& theInv)
+{
+  // get boundary edges
+  TopTools_MapOfShape aMFBounds;
+  TopExp_Explorer aExp(theFace, TopAbs_EDGE);
+  for (; aExp.More(); aExp.Next()) {
+    const TopoDS_Shape& aE = aExp.Current();
+    const TopTools_ListOfShape* pLEIm = theEImages.Seek(aE);
+    if (!pLEIm) {
+      aMFBounds.Add(aE);
+    }
+    else {
+      TopTools_ListIteratorOfListOfShape aItLE(*pLEIm);
+      for (; aItLE.More(); aItLE.Next()) {
+        const TopoDS_Shape& aEIm = aItLE.Value();
+        aMFBounds.Add(aEIm);
+      }
+    }
+  }
+  //
+  BRep_Builder aBB;
+  Standard_Boolean bFound(Standard_False), bUpdate(Standard_False);
+  // the resulting edges
+  TopoDS_Compound anEdges;
+  aBB.MakeCompound(anEdges);
+  //
+  // the edges by which the offset face should be split
+  const TopTools_ListOfShape& aLE = theAsDes->Descendant(theFace);
+  TopTools_ListIteratorOfListOfShape aItLE(aLE);
+  for (; aItLE.More(); aItLE.Next()) {
+    const TopoDS_Edge& aE = TopoDS::Edge(aItLE.Value());
+    //
+    if (!bUpdate) {
+      bUpdate = theModifiedEdges.Contains(aE);
+    }
+    //
+    const TopTools_ListOfShape* pLEIm = theEImages.Seek(aE);
+    if (pLEIm) {
+      TopTools_ListIteratorOfListOfShape aItLEIm(*pLEIm);
+      for (; aItLEIm.More(); aItLEIm.Next()) {
+        const TopoDS_Edge& aEIm = TopoDS::Edge(aItLEIm.Value());
+        //
+        if (theInvEdges.Contains(aEIm)) {
+          theInv.Add(aEIm);
+          if (!bUpdate) {
+            bUpdate = theLastInvEdges.Contains(aEIm);
+          }
+          continue;
+        }
+        // check for micro edge
+        if (ProcessMicroEdge(aEIm, theCtx)) {
+          continue;
+        }
+        //
+        aBB.Add(anEdges, aEIm);
+        if (!bFound) {
+          bFound = !aMFBounds.Contains(aEIm);
+        }
+        //
+        if (!bUpdate) {
+          bUpdate = theModifiedEdges.Contains(aEIm);
+        }
+      }
+    }
+    else {
+      if (theInvEdges.Contains(aE)) {
+        theInv.Add(aE);
+        if (!bUpdate) {
+          bUpdate = theLastInvEdges.Contains(aE);
+        }
+        continue;
+      }
+      //
+      if (ProcessMicroEdge(aE, theCtx)) {
+        continue;
+      }
+      aBB.Add(anEdges, aE);
+      if (!bFound) {
+        bFound = !aMFBounds.Contains(aE);
+      }
+    }
+  }
+  //
+  theEdges = anEdges;
+  return bFound && bUpdate;
+}
+
+//=======================================================================
+//function : BuildSplitsOfFace
+//purpose  : Building the splits of offset face
+//=======================================================================
+void BuildSplitsOfFace(const TopoDS_Face& theFace,
+                       const TopoDS_Shape& theEdges,
+                       Standard_Boolean bTrimmed,
+                       TopTools_DataMapOfShapeShape& theFacesOrigins,
+                       TopTools_ListOfShape& theLFImages)
+{
+  BOPAlgo_Builder aGF;
+  //
+  aGF.AddArgument(theFace);
+  aGF.AddArgument(theEdges);
+  aGF.Perform();
+  if (aGF.ErrorStatus()) {
+    return;
+  }
+  //
+  // splits of the offset shape
+  theLFImages = aGF.Modified(theFace);
+  if (theLFImages.IsEmpty()) {
+    return;
+  }
+  //
+  if (!bTrimmed) {
+    // get the real splits of faces by removing the faces
+    // containing boundaries of the extended faces
+
+    // get edges to map
+    TopTools_IndexedMapOfShape aME;
+    TopExp::MapShapes(theEdges, TopAbs_EDGE, aME);
+    //
+    TopTools_ListIteratorOfListOfShape aItLE(theLFImages);
+    for (; aItLE.More();) {
+      const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLE.Value();
+      //
+      TopExp_Explorer aExp(aFIm, TopAbs_EDGE);
+      for (; aExp.More(); aExp.Next()) {
+        const TopoDS_Edge& aE = *(TopoDS_Edge*)&aExp.Current();
+        if (!aME.Contains(aE)) {
+          break;
+        }
+      }
+      //
+      if (!aExp.More()) {
+        aItLE.Next();
+      }
+      else {
+        theLFImages.Remove(aItLE);
+      }
+    }
+  }
+  // update origins
+  TopTools_ListIteratorOfListOfShape aIt(theLFImages);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aFIm = aIt.Value();
+    theFacesOrigins.Bind(aFIm, theFace);
+  }
+}
+
+//=======================================================================
+//function : CheckIfArtificial
+//purpose  : Checks if the face is artificially invalid
+//=======================================================================
+Standard_Boolean CheckIfArtificial(const TopoDS_Shape& theF,
+                                   const TopTools_ListOfShape& theLFImages,
+                                   const TopoDS_Shape& theCE,
+                                   const TopTools_IndexedMapOfShape& theMapEInv,
+                                   const TopTools_DataMapOfShapeListOfShape& theOEImages,
+                                   TopTools_MapOfShape& theMENInv,
+                                   Handle(BRepAlgo_AsDes)& theAsDes)
+{
+  // all boundary edges should be used
+  TopTools_IndexedMapOfShape aMEUsed;
+  TopTools_ListIteratorOfListOfShape aItLFIm(theLFImages);
+  for (; aItLFIm.More(); aItLFIm.Next()) {
+    const TopoDS_Shape& aFIm = aItLFIm.Value();
+    TopExp::MapShapes(aFIm, TopAbs_EDGE, aMEUsed);
+    TopExp::MapShapes(aFIm, TopAbs_VERTEX, aMEUsed);
+  }
+  //
+  TopTools_IndexedDataMapOfShapeListOfShape aMVE;
+  TopExp::MapShapesAndAncestors(theCE, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
+  //
+  Standard_Integer i, aNb = theMapEInv.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aEInv = theMapEInv(i);
+    TopExp_Explorer aExpV(aEInv, TopAbs_VERTEX);
+    for (; aExpV.More(); aExpV.Next()) {
+      const TopoDS_Shape& aVEInv = aExpV.Current();
+      if (!aMEUsed.Contains(aVEInv) && aMVE.Contains(aVEInv)) {
+        const TopTools_ListOfShape& aLENInv = aMVE.FindFromKey(aVEInv);
+        TopTools_ListIteratorOfListOfShape aItLEInv(aLENInv);
+        for (; aItLEInv.More(); aItLEInv.Next()) {
+          const TopoDS_Shape& aENInv = aItLEInv.Value();
+          theMENInv.Add(aENInv);
+        }
+      }
+    }
+  }
+  //
+  if (theMENInv.IsEmpty()) {
+    return Standard_False;
+  }
+  //
+  TopTools_IndexedMapOfShape aMEFound;
+  TopExp::MapShapes(theCE, TopAbs_EDGE, aMEFound);
+  //
+  const TopTools_ListOfShape& aLE = theAsDes->Descendant(theF);
+  TopTools_ListIteratorOfListOfShape aItLE(aLE);
+  for (; aItLE.More(); aItLE.Next()) {
+    const TopoDS_Edge& aE = TopoDS::Edge(aItLE.Value());
+    //
+    if (theOEImages.IsBound(aE)) {
+      Standard_Boolean bChecked = Standard_False;
+      const TopTools_ListOfShape& aLEIm = theOEImages.Find(aE);
+      TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm);
+      for (; aItLEIm.More(); aItLEIm.Next()) {
+        const TopoDS_Edge& aEIm = TopoDS::Edge(aItLEIm.Value());
+        if (!aMEFound.Contains(aEIm) || theMENInv.Contains(aEIm)) {
+          continue;
+        }
+        //
+        bChecked = Standard_True;
+        if (aMEUsed.Contains(aEIm)) {
+          break;
+        }
+      }
+      //
+      if (bChecked && !aItLEIm.More()) {
+        break;
+      }
+    }
+    else {
+      if (aMEFound.Contains(aE) && !theMENInv.Contains(aE) && !aMEUsed.Contains(aE)) {
+        break;
+      }
+    }
+  }
+  //
+  return aItLE.More();
+}
+
+//=======================================================================
+//function : FindInvalidEdges
+//purpose  : Looking for the invalid edges
+//=======================================================================
+void FindInvalidEdges(const TopoDS_Face& theF,
+                      const TopTools_ListOfShape& theLFImages,
+                      const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                      const TopTools_DataMapOfShapeShape& theFacesOrigins,
+                      const TopTools_DataMapOfShapeListOfShape& theOEImages,
+                      const TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                      TopTools_IndexedMapOfShape& theInvEdges,
+                      TopTools_IndexedMapOfShape& theValidEdges,
+                      TopTools_DataMapOfShapeListOfShape& theDMFLVE,
+                      TopTools_DataMapOfShapeListOfShape& theDMFLNE,
+                      TopTools_DataMapOfShapeListOfShape& theDMFLIE,
+                      TopTools_DataMapOfShapeListOfShape& theDMFLVIE,
+                      TopTools_MapOfShape& theMEInverted,
+                      TopTools_MapOfShape& theEdgesInvalidByVertex)
+{
+  // Edge is considered as invalid in the following cases:
+  // 1. Its orientation on the face has changed comparing to the originals edge and face;
+  // 2. The vertices of the edge have changed places comparing to the originals edge and face.
+  //
+  // The edges created from vertices, i.e. as intersection between two faces connected only
+  // by VERTEX, will also be checked on validity. For these edges the correct orientation will
+  // be defined by the edges on the original face adjacent to the connection vertex
+  //
+  const TopoDS_Face& aFOr = *(TopoDS_Face*)&theFacesOrigins.Find(theF);
+  // invald edges
+  TopTools_IndexedMapOfShape aMEInv;
+  // valid edges
+  TopTools_MapOfShape aMEVal;
+  // internal edges
+  TopTools_MapOfShape aMEInt;
+  //
+  // maps for checking the inverted edges
+  TopTools_IndexedDataMapOfShapeListOfShape aDMVE, aDMEF;
+  TopTools_IndexedMapOfShape aMEdges;
+  //
+  TopTools_ListIteratorOfListOfShape aItLF(theLFImages);
+  for (; aItLF.More(); aItLF.Next()) {
+    const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value();
+    //
+    TopExp_Explorer aExp(aFIm, TopAbs_EDGE);
+    for (; aExp.More(); aExp.Next()) {
+      const TopoDS_Shape& aE = aExp.Current();
+      // keep all edges
+      aMEdges.Add(aE);
+      //
+      // keep connection from edges to faces
+      TopTools_ListOfShape* pLF = aDMEF.ChangeSeek(aE);
+      if (!pLF) {
+        pLF = &aDMEF(aDMEF.Add(aE, TopTools_ListOfShape()));
+      }
+      AppendToList(*pLF, aFIm);
+      //
+      // keep connection from vertices to edges
+      TopoDS_Iterator aItV(aE);
+      for (; aItV.More(); aItV.Next()) {
+        const TopoDS_Shape& aV = aItV.Value();
+        //
+        TopTools_ListOfShape* pLE = aDMVE.ChangeSeek(aV);
+        if (!pLE) {
+          pLE = &aDMVE(aDMVE.Add(aV, TopTools_ListOfShape()));
+        }
+        AppendToList(*pLE, aE);
+      }
+    }
+  }
+  //
+  // the map will be used to find the edges on the original face
+  // adjacent to the same vertex. It will be filled at first necessity;
+  TopTools_IndexedDataMapOfShapeListOfShape aDMVEFOr;
+  //
+  aItLF.Initialize(theLFImages);
+  for (; aItLF.More(); aItLF.Next()) {
+    const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value();
+    //
+    // valid edges for this split
+    TopTools_ListOfShape aLVE;
+    // invalid edges for this split
+    TopTools_ListOfShape aLIE;
+    //
+    TopExp_Explorer aExp(aFIm, TopAbs_EDGE);
+    for (; aExp.More(); aExp.Next()) {
+      const TopoDS_Edge& aEIm = *(TopoDS_Edge*)&aExp.Current();
+      //
+      if (aEIm.Orientation() == TopAbs_INTERNAL) {
+        aMEInt.Add(aEIm);
+        continue;
+      }
+      //
+      if (!theEdgesOrigins.IsBound(aEIm)) {
+        continue;
+      }
+      //
+      const TopTools_ListOfShape& aLEOr = theEdgesOrigins.Find(aEIm);
+      if (aLEOr.IsEmpty()) {
+        continue;
+      }
+      //
+      Standard_Integer aNbVOr = 0;
+      TopTools_ListIteratorOfListOfShape aItLEO(aLEOr);
+      for (; aItLEO.More(); aItLEO.Next()) {
+        if (aItLEO.Value().ShapeType() == TopAbs_VERTEX) {
+          ++aNbVOr;
+        }
+      }
+      //
+      TopTools_MapOfShape aME, aMV;
+      Standard_Boolean bInvalid = Standard_False, bChecked = Standard_False;
+      Standard_Integer aNbP = NbPoints(aEIm);
+      aItLEO.Initialize(aLEOr);
+      for (; aItLEO.More(); aItLEO.Next()) {
+        const TopoDS_Shape& aSOr = aItLEO.Value();
+        Standard_Boolean bVertex = (aSOr.ShapeType() == TopAbs_VERTEX);
+        //
+        TopoDS_Shape aEOrF;
+        if (bVertex) {
+          // for some cases it is impossible to check the validity of the edge
+          if (aNbVOr > 1) {
+            continue;
+          }
+          //
+          if (aDMEF.FindFromKey(aEIm).Extent() > 1) {
+            continue;
+          }
+          //
+          if (theOEOrigins.IsBound(aEIm)) {
+            continue;
+          }
+          //
+          // find edges on the original face adjacent to this vertex
+          if (aDMVEFOr.IsEmpty()) {
+            // fill the map
+            TopExp::MapShapesAndAncestors(aFOr, TopAbs_VERTEX, TopAbs_EDGE, aDMVEFOr);
+          }
+          //
+          TopTools_ListOfShape *pLEFOr = aDMVEFOr.ChangeSeek(aSOr);
+          if (pLEFOr) {
+            TopoDS_Compound aCEOr;
+            BRep_Builder().MakeCompound(aCEOr);
+            TopTools_ListIteratorOfListOfShape aItLEFOr(*pLEFOr);
+            for (; aItLEFOr.More(); aItLEFOr.Next()) {
+              const TopoDS_Shape& aEOr = aItLEFOr.Value();
+              BRep_Builder().Add(aCEOr, aEOr);
+            }
+            aEOrF = aCEOr;
+          }
+        }
+        else {
+          FindShape(aSOr, aFOr, aEOrF);
+        }
+        //
+        if (aEOrF.IsNull()) {
+          // the edge has not been found
+          continue;
+        }
+        //
+        // Check orientations of the image edge and original edge.
+        // In case the 3d curves are having the same direction the orientations 
+        // must be the same. Otherwise the orientations should also be different.
+        //
+        // get average tangent vector for each curve taking into account
+        // the orientations of the edges, i.e. the edge is reversed
+        // the vector is reversed as well
+        gp_Vec aVSum1 = GetAverageTangent(aEIm, aNbP);
+        gp_Vec aVSum2 = GetAverageTangent(aEOrF, aNbP);
+        //
+        aVSum1.Normalize();
+        aVSum2.Normalize();
+        //
+        Standard_Real aCos = aVSum1.Dot(aVSum2);
+        if (!bVertex) {
+          if (Abs(aCos) < 0.9999) {
+            continue;
+          }
+          //
+          aME.Add(aEOrF);
+          TopExp_Explorer aExpE(aEOrF, TopAbs_VERTEX);
+          for (; aExpE.More(); aExpE.Next()) {
+            const TopoDS_Shape& aV = aExpE.Current();
+            aMV.Add(aV);
+          }
+        }
+        //
+        if (aCos < Precision::Confusion()) {
+          bInvalid = Standard_True;
+          if (bVertex) {
+            theEdgesInvalidByVertex.Add(aEIm);
+          }
+        }
+        bChecked = Standard_True;
+      }
+      //
+      if (!bChecked) {
+        continue;
+      }
+      //
+      Standard_Integer aNbE = aME.Extent(), aNbV = aMV.Extent();
+      if ((aNbE > 1) && (aNbV == 2*aNbE)) {
+        continue;
+      }
+      //
+      if (bInvalid) {
+        theInvEdges.Add(aEIm);
+        aLIE.Append(aEIm);
+        aMEInv.Add(aEIm);
+        continue;
+      }
+      //
+      // check if the edge has been inverted
+      Standard_Boolean bInverted = CheckInverted(aEIm, aFOr, theOEImages, theOEOrigins,
+        theEdgesOrigins, aDMEF, aDMVE, aMEdges, theMEInverted);
+      //
+      if (!bInverted || !aNbVOr) {
+        theValidEdges.Add(aEIm);
+        aLVE.Append(aEIm);
+        aMEVal.Add(aEIm);
+      }
+    }
+    //
+    // valid edges
+    if (aLVE.Extent()) {
+      theDMFLVE.Bind(aFIm, aLVE);
+    }
+    //
+    // invalid edges
+    if (aLIE.Extent()) {
+      theDMFLIE.Bind(aFIm, aLIE);
+    }
+  }
+  //
+  // process invalid edges:
+  // check for the inverted edges
+  TopTools_ListOfShape aLVIE;
+  // fill neutral edges
+  TopTools_ListOfShape aLNE;
+  //
+  Standard_Integer i, aNbEInv = aMEInv.Extent();
+  for (i = 1; i <= aNbEInv; ++i) {
+    const TopoDS_Shape& aEIm = aMEInv(i);
+    //
+    // neutral edges - on the splits of the same offset face
+    // it is valid for one split and invalid for other
+    if (aMEVal.Contains(aEIm)) {
+      aLNE.Append(aEIm);
+      continue;
+    }
+    //
+    // the inverted images of the origins of invalid edges should also be invalid
+    if (!theMEInverted.Contains(aEIm)) {
+      continue;
+    }
+    //
+    const TopTools_ListOfShape* pLOEOr = theOEOrigins.Seek(aEIm);
+    if (!pLOEOr) {
+      continue;
+    }
+    //
+    TopTools_ListIteratorOfListOfShape aItLOEOr(*pLOEOr);
+    for (; aItLOEOr.More(); aItLOEOr.Next()) {
+      const TopoDS_Shape& aOEOr = aItLOEOr.Value();
+      const TopTools_ListOfShape& aLEIm1 = theOEImages.Find(aOEOr);
+      //
+      TopTools_ListIteratorOfListOfShape aItLEIm1(aLEIm1);
+      for (; aItLEIm1.More(); aItLEIm1.Next()) {
+        const TopoDS_Shape& aEIm1 = aItLEIm1.Value();
+        if (aMEdges.Contains(aEIm1) &&
+            !aMEInv.Contains(aEIm1) && !aMEInt.Contains(aEIm1) &&
+            theMEInverted.Contains(aEIm1)) {
+          theInvEdges.Add(aEIm1);
+          aLVIE.Append(aEIm1);
+        }
+      }
+    }
+  }
+  //
+  if (aLNE.Extent()) {
+    theDMFLNE.Bind(theF, aLNE);
+  }
+  //
+  if (aLVIE.Extent()) {
+    theDMFLVIE.Bind(theF, aLVIE);
+  }
+}
+
+//=======================================================================
+//function : FindInvalidFaces
+//purpose  : Looking for the invalid faces by analyzing their invalid edges
+//=======================================================================
+void FindInvalidFaces(TopTools_ListOfShape& theLFImages,
+                      const TopTools_IndexedMapOfShape& theInvEdges,
+                      const TopTools_IndexedMapOfShape& theValidEdges,
+                      const TopTools_DataMapOfShapeListOfShape& theDMFLVE,
+                      const TopTools_DataMapOfShapeListOfShape& theDMFLIE,
+                      const TopTools_ListOfShape& theLENeutral,
+                      const TopTools_ListOfShape& theLEValInverted,
+                      const TopTools_MapOfShape& theMEInverted,
+                      const TopTools_MapOfShape& theEdgesInvalidByVertex,
+                      TopTools_ListOfShape& theInvFaces)
+{
+  // The face should be considered as invalid in the following cases:
+  // 1. It has been reverted, i.e. at least two not connected edges 
+  //    have changed orientation (i.e. invalid). In this case all edges,
+  //    should be invalid for that face, because edges have also been reverted;
+  // 2. All checked edges of the face are invalid for this face;
+  // The face should be removed from the splits in the following cases:
+  // 1. All checked edges of the face are invalid for this one, but valid for
+  //    some other face in this list of splits.
+  // The face will be kept in the following cases:
+  // 1. Some of the edges are valid for this face.
+  Standard_Boolean bHasValid, bAllValid, bAllInvalid, bHasReallyInvalid, bAllInvNeutral;
+  Standard_Boolean bValid, bValidLoc, bInvalid, bInvalidLoc, bNeutral;
+  Standard_Integer i, aNbChecked;
+  //
+  // neutral edges
+  TopTools_MapOfShape aMEN;
+  TopTools_ListIteratorOfListOfShape aItLE(theLENeutral);
+  for (; aItLE.More(); aItLE.Next()) {
+    aMEN.Add(aItLE.Value());
+  }
+  //
+  // valid inverted edges
+  TopTools_MapOfShape aMEValInverted;
+  aItLE.Initialize(theLEValInverted);
+  for (; aItLE.More(); aItLE.Next()) {
+    aMEValInverted.Add(aItLE.Value());
+  }
+  //
+  Standard_Boolean bCheckInverted = (theLFImages.Extent() == 1);
+  //
+  // neutral edges to remove
+  TopTools_IndexedMapOfShape aMENRem;
+  //
+  // faces for post treat
+  TopTools_ListOfShape aLFPT;
+  //
+  TopTools_ListIteratorOfListOfShape aItLF(theLFImages);
+  for (; aItLF.More(); ) {
+    const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value();
+    //
+    // valid edges for this split
+    TopTools_MapOfShape aMVE;
+    // invalid edges for this split
+    TopTools_MapOfShape aMIE;
+    //
+    for (i = 0; i < 2; ++i) {
+      TopTools_MapOfShape& aME = !i ? aMVE : aMIE;
+      const TopTools_ListOfShape* pLE = !i ? theDMFLVE.Seek(aFIm) : theDMFLIE.Seek(aFIm);
+      if (pLE) {
+        TopTools_ListIteratorOfListOfShape aItLE(*pLE);
+        for (; aItLE.More(); aItLE.Next()) {
+          const TopoDS_Shape& aE = aItLE.Value();
+          aME.Add(aE);
+        }
+      }
+    }
+    //
+    bHasValid = Standard_False;
+    bAllValid = Standard_True;
+    bAllInvalid = Standard_True;
+    bHasReallyInvalid = Standard_False;
+    bAllInvNeutral = Standard_True;
+    aNbChecked = 0;
+    //
+    const TopoDS_Wire& aWIm = BRepTools::OuterWire(aFIm);
+    TopExp_Explorer aExp(aWIm, TopAbs_EDGE);
+    for (; aExp.More(); aExp.Next()) {
+      const TopoDS_Shape& aEIm = aExp.Current();
+      //
+      bValid = theValidEdges.Contains(aEIm);
+      bInvalid = theInvEdges.Contains(aEIm);
+      //
+      if (!bValid && !bInvalid) {
+        // edge has not been checked for some reason
+        continue;
+      }
+      //
+      ++aNbChecked;
+      //
+      bInvalidLoc = aMIE.Contains(aEIm);
+      bHasReallyInvalid = bInvalidLoc && !bValid && !theEdgesInvalidByVertex.Contains(aEIm);
+      if (bHasReallyInvalid) {
+        break;
+      }
+      //
+      bNeutral = aMEN.Contains(aEIm);
+      bValidLoc = aMVE.Contains(aEIm);
+      //
+      if (!bInvalid && bCheckInverted) {
+        bInvalid = theMEInverted.Contains(aEIm);
+      }
+      //
+      if (bValidLoc && (bNeutral || aMEValInverted.Contains(aEIm))) {
+        bHasValid = Standard_True;
+      }
+      //
+      bAllValid = bAllValid && bValidLoc;
+      bAllInvalid = bAllInvalid && bInvalid;
+      bAllInvNeutral = bAllInvNeutral && bAllInvalid && bNeutral;
+    }
+    //
+    if (!aNbChecked) {
+      aItLF.Next();
+      continue;
+    }
+    //
+    if (!bHasReallyInvalid && (bAllInvNeutral && !bHasValid) && (aNbChecked > 1)) {
+      // remove edges from neutral
+      TopExp::MapShapes(aFIm, TopAbs_EDGE, aMENRem);
+      // remove face
+      theLFImages.Remove(aItLF);
+      continue;
+    }
+    //
+    if (bHasReallyInvalid || (bAllInvalid && 
+                             !(bHasValid || bAllValid) &&
+                             !(bAllInvNeutral && (aNbChecked == 1)))) {
+      theInvFaces.Append(aFIm);
+    }
+    //
+    if (!bAllInvNeutral) {
+      aLFPT.Append(aFIm);
+    }
+    else {
+      // remove edges from neutral
+      TopExp::MapShapes(aFIm, TopAbs_EDGE, aMENRem);
+    }
+    aItLF.Next();
+  }
+  //
+  if (aLFPT.IsEmpty() || aMENRem.IsEmpty()) {
+    return;
+  }
+  //
+  Standard_Integer aNb = aMENRem.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    aMEN.Remove(aMENRem(i));
+  }
+  //
+  // check the splits once more
+  aItLF.Initialize(aLFPT);
+  for (; aItLF.More(); aItLF.Next()) {
+    const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value();
+    //
+    // valid edges for this split
+    TopTools_MapOfShape aMVE;
+    const TopTools_ListOfShape* pLVE = theDMFLVE.Seek(aFIm);
+    if (pLVE) {
+      TopTools_ListIteratorOfListOfShape aItLE(*pLVE);
+      for (; aItLE.More(); aItLE.Next()) {
+        const TopoDS_Shape& aE = aItLE.Value();
+        aMVE.Add(aE);
+      }
+    }
+    //
+    bHasValid = Standard_False;
+    bAllValid = Standard_True;
+    bAllInvalid = Standard_True;
+    //
+    const TopoDS_Wire& aWIm = BRepTools::OuterWire(aFIm);
+    TopExp_Explorer aExp(aWIm, TopAbs_EDGE);
+    for (; aExp.More(); aExp.Next()) {
+      const TopoDS_Shape& aEIm = aExp.Current();
+      //
+      bValid = theValidEdges.Contains(aEIm);
+      bInvalid = theInvEdges.Contains(aEIm);
+      bNeutral = aMEN.Contains(aEIm);
+      bValidLoc = aMVE.Contains(aEIm);
+      //
+      if (!bInvalid && bCheckInverted) {
+        bInvalid = theMEInverted.Contains(aEIm);
+      }
+      //
+      if (bValidLoc && (bNeutral || aMEValInverted.Contains(aEIm))) {
+        bHasValid = Standard_True;
+      }
+      //
+      bAllValid = bAllValid && bValidLoc;
+      bAllInvalid = bAllInvalid && bInvalid;
+    }
+    //
+    if (bAllInvalid && !bHasValid && !bAllValid) {
+      theInvFaces.Append(aFIm);
+    }
+  }
+}
+
+//=======================================================================
+//function : GetAverageTangent
+//purpose  : Computes average tangent vector along the curve
+//=======================================================================
+gp_Vec GetAverageTangent(const TopoDS_Shape& theS,
+                         const Standard_Integer theNbP)
+{
+  gp_Vec aVA;
+  TopExp_Explorer aExp(theS, TopAbs_EDGE);
+  for (; aExp.More(); aExp.Next()) {
+    const TopoDS_Edge& aE = *(TopoDS_Edge*)&aExp.Current();
+    //
+    Standard_Real aT1, aT2;
+    const Handle(Geom_Curve)& aC = BRep_Tool::Curve(aE, aT1, aT2);
+    //
+    gp_Pnt aP;
+    gp_Vec aV, aVSum;
+    Standard_Real aT = aT1;
+    Standard_Real aDt = (aT2 - aT1) / theNbP;
+    while (aT <= aT2) {
+      aC->D1(aT, aP, aV);
+      aVSum += aV.Normalized();
+      aT += aDt;
+    }
+    //
+    if (aE.Orientation() == TopAbs_REVERSED) {
+      aVSum.Reverse();
+    }
+    //
+    aVA += aVSum;
+  }
+  return aVA;
+}
+
+//=======================================================================
+//function : CheckInverted
+//purpose  : Checks if the edge has been inverted
+//=======================================================================
+Standard_Boolean CheckInverted(const TopoDS_Edge& theEIm,
+                               const TopoDS_Face& theFOr,
+                               const TopTools_DataMapOfShapeListOfShape& theOEImages,
+                               const TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                               const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                               const TopTools_IndexedDataMapOfShapeListOfShape& theDMEF,
+                               const TopTools_IndexedDataMapOfShapeListOfShape& theDMVE,
+                               const TopTools_IndexedMapOfShape& theMEdges,
+                               TopTools_MapOfShape& theMEInverted)
+{
+  if (theDMEF.FindFromKey(theEIm).Extent() > 1) {
+    return Standard_False;
+  }
+  //
+  if (theMEInverted.Contains(theEIm)) {
+    return Standard_True;
+  }
+  //
+  // it is necessary to compare the direction from first vertex
+  // to the last vertex on the original edge with the
+  // same direction on the new edge. If the directions
+  // will be different - the edge has been inverted.
+  //
+  TopoDS_Vertex aVI1, aVI2; // vertices on the offset edge
+  TopoDS_Vertex aVO1, aVO2; // vertices on the original edge
+  //
+  Standard_Integer i;
+  // find vertices of the offset shape
+  TopExp::Vertices(theEIm, aVI1, aVI2);
+  //
+  // find images
+  TopTools_ListOfShape aLEImages;
+  if (theOEOrigins.IsBound(theEIm)) {
+    TopoDS_Wire anImages;
+    BRep_Builder().MakeWire(anImages);
+    //
+    TopTools_MapOfShape aMImFence;
+    const TopTools_ListOfShape& aLOffsetOr = theOEOrigins.Find(theEIm);
+    TopTools_ListIteratorOfListOfShape aItOffset(aLOffsetOr);
+    for (; aItOffset.More(); aItOffset.Next()) {
+      const TopoDS_Shape& aEOffsetOr = aItOffset.Value();
+      const TopTools_ListOfShape& aLImages = theOEImages.Find(aEOffsetOr);
+      //
+      TopTools_ListIteratorOfListOfShape aItImages(aLImages);
+      for (; aItImages.More(); aItImages.Next()) {
+        const TopoDS_Edge& anIm = *(TopoDS_Edge*)&aItImages.Value();
+        if (theMEdges.Contains(anIm) && aMImFence.Add(anIm)) {
+          BRep_Builder().Add(anImages, anIm);
+          aLEImages.Append(anIm);
+        }
+      }
+    }
+    //
+    // find alone vertices
+    TopoDS_Vertex aVW1, aVW2;
+    TopTools_IndexedDataMapOfShapeListOfShape aDMImVE;
+    TopExp::MapShapesAndAncestors(anImages, TopAbs_VERTEX, TopAbs_EDGE, aDMImVE);
+    //
+    TopTools_ListOfShape aLVAlone;
+    Standard_Integer aNb = aDMImVE.Extent();
+    for (i = 1; i <= aNb; ++i) {
+      const TopTools_ListOfShape& aLImE = aDMImVE(i);
+      if (aLImE.Extent() == 1) {
+        aLVAlone.Append(aDMImVE.FindKey(i));
+      }
+    }
+    //
+    if (aLVAlone.Extent() > 1) {
+      aVW1 = *(TopoDS_Vertex*)&aLVAlone.First();
+      aVW2 = *(TopoDS_Vertex*)&aLVAlone.Last();
+      //
+      // check distances
+      const gp_Pnt& aPI1 = BRep_Tool::Pnt(aVI1);
+      const gp_Pnt& aPW1 = BRep_Tool::Pnt(aVW1);
+      const gp_Pnt& aPW2 = BRep_Tool::Pnt(aVW2);
+      //
+      Standard_Real aDist1 = aPI1.SquareDistance(aPW1);
+      Standard_Real aDist2 = aPI1.SquareDistance(aPW2);
+      //
+      if (aDist1 < aDist2) {
+        aVI1 = aVW1;
+        aVI2 = aVW2;
+      }
+      else {
+        aVI1 = aVW2;
+        aVI2 = aVW1;
+      }
+    }
+  }
+  else {
+    aLEImages.Append(theEIm);
+  }
+  //
+  // Find edges connected to these vertices
+  const TopTools_ListOfShape& aLIE1 = theDMVE.FindFromKey(aVI1);
+  const TopTools_ListOfShape& aLIE2 = theDMVE.FindFromKey(aVI2);
+  //
+  // Find vertices on the original face corresponding to vertices on the offset edge
+  //
+  // find original edges for both lists
+  TopTools_ListOfShape aLOE1, aLOE2;
+  for (i = 0; i < 2; ++i) {
+    const TopTools_ListOfShape& aLIE = !i ? aLIE1 : aLIE2;
+    TopTools_ListOfShape& aLOE = !i ? aLOE1 : aLOE2;
+    //
+    TopTools_MapOfShape aMFence;
+    //
+    TopTools_ListIteratorOfListOfShape aItLIE(aLIE);
+    for (; aItLIE.More(); aItLIE.Next()) {
+      const TopoDS_Shape& aEI = aItLIE.Value();
+      if (theEdgesOrigins.IsBound(aEI)) {
+        const TopTools_ListOfShape& aLEOrigins = theEdgesOrigins.Find(aEI);
+        //
+        TopTools_ListIteratorOfListOfShape aItLOE(aLEOrigins);
+        for (; aItLOE.More(); aItLOE.Next()) {
+          const TopoDS_Shape& aEO = aItLOE.Value();
+          if (aEO.ShapeType() == TopAbs_EDGE && aMFence.Add(aEO)) {
+            TopoDS_Shape aEOin;
+            if (FindShape(aEO, theFOr, aEOin)) {
+              aLOE.Append(aEO);
+            }
+          }
+        }
+      }
+    }
+  }
+  //
+  if (aLOE1.Extent() < 2 || aLOE2.Extent() < 2) {
+    return Standard_False;
+  }
+  //
+  // find vertices common for all edges in the lists
+  for (i = 0; i < 2; ++i) {
+    const TopTools_ListOfShape& aLOE = !i ? aLOE1 : aLOE2;
+    TopoDS_Vertex& aVO = !i ? aVO1 : aVO2;
+    //
+    const TopoDS_Shape& aEO = aLOE.First();
+    TopExp_Explorer aExpV(aEO, TopAbs_VERTEX);
+    for (; aExpV.More(); aExpV.Next()) {
+      const TopoDS_Vertex& aV = *(TopoDS_Vertex*)&aExpV.Current();
+      //
+      Standard_Boolean bVertValid = Standard_True;
+      TopTools_ListIteratorOfListOfShape aItLOE(aLOE);
+      for (aItLOE.Next(); aItLOE.More(); aItLOE.Next()) {
+        const TopoDS_Shape& aEOx = aItLOE.Value();
+        TopExp_Explorer aExpVx(aEOx, TopAbs_VERTEX);
+        for (; aExpVx.More(); aExpVx.Next()) {
+          const TopoDS_Shape& aVx = aExpVx.Current();
+          if (aVx.IsSame(aV)) {
+            break;
+          }
+        }
+        //
+        if (!aExpVx.More()) {
+          bVertValid = Standard_False;
+          break;
+        }
+      }
+      //
+      if (bVertValid) {
+        aVO = aV;
+        break;
+      }
+    }
+  }
+  //
+  if (aVO1.IsNull() || aVO2.IsNull() || aVO1.IsSame(aVO2)) {
+    return Standard_False;
+  }
+  //
+  // check positions of the offset and original vertices
+  const gp_Pnt& aPI1 = BRep_Tool::Pnt(aVI1);
+  const gp_Pnt& aPI2 = BRep_Tool::Pnt(aVI2);
+  const gp_Pnt& aPO1 = BRep_Tool::Pnt(aVO1);
+  const gp_Pnt& aPO2 = BRep_Tool::Pnt(aVO2);
+  //
+  gp_Vec aVI(aPI1, aPI2);
+  gp_Vec aVO(aPO1, aPO2);
+  //
+  Standard_Real anAngle = aVI.Angle(aVO);
+  Standard_Boolean bInverted = Abs(anAngle - M_PI) < 1.e-4;
+  if (bInverted) {
+    TopTools_ListIteratorOfListOfShape aItLEIm(aLEImages);
+    for (; aItLEIm.More(); aItLEIm.Next()) {
+      const TopoDS_Shape& aEInvr = aItLEIm.Value();
+      theMEInverted.Add(aEInvr);
+    }
+  }
+  return bInverted;
+}
+
+//=======================================================================
+//function : RemoveInvalidSplitsByInvertedEdges
+//purpose  : Looking for the invalid faces containing inverted edges
+//           that can be safely removed
+//=======================================================================
+void RemoveInvalidSplitsByInvertedEdges(const TopTools_MapOfShape& theMEInverted,
+                                        TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                                        TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                                        TopTools_IndexedMapOfShape& theMERemoved)
+{
+  if (theMEInverted.IsEmpty()) {
+    return;
+  }
+  //
+  // check the faces on regularity, i.e. the splits of the same face
+  // should not be connected only by vertex. Such irregular splits
+  // will have to be rebuilt and cannot be removed.
+  //
+  TopTools_MapOfShape aMEAvoid;
+  TopTools_DataMapOfShapeListOfShape aDMVF;
+  Standard_Integer aNb = theFImages.Extent(), i;
+  for (i = 1; i <= aNb; ++i) {
+    const TopTools_ListOfShape& aLFIm = theFImages(i);
+    //
+    TopoDS_Compound aCFIm;
+    BRep_Builder().MakeCompound(aCFIm);
+    //
+    TopTools_DataMapOfShapeListOfShape aDMEF;
+    TopTools_ListIteratorOfListOfShape aIt(aLFIm);
+    for (; aIt.More(); aIt.Next()) {
+      const TopoDS_Shape& aF = aIt.Value();
+      BRep_Builder().Add(aCFIm, aF);
+      //
+      // make a map to use only outer edges
+      TopExp_Explorer aExp(aF, TopAbs_EDGE);
+      for (; aExp.More(); aExp.Next()) {
+        const TopoDS_Shape& aE = aExp.Current();
+        //
+        TopTools_ListOfShape *pLF = aDMEF.ChangeSeek(aE);
+        if (!pLF) {
+          TopTools_ListOfShape aLF;
+          aLF.Append(aF);
+          aDMEF.Bind(aE, aLF);
+        }
+        else {
+          pLF->Append(aF);
+          // internal edges should not be used
+          aMEAvoid.Add(aE);
+        }
+      }
+      //
+      // fill connection map of the vertices of inverted edges to faces
+      aExp.Init(aF, TopAbs_VERTEX);
+      for (; aExp.More(); aExp.Next()) {
+        const TopoDS_Shape& aV = aExp.Current();
+        //
+        TopTools_ListOfShape *pLF = aDMVF.ChangeSeek(aV);
+        if (!pLF) {
+          TopTools_ListOfShape aLF;
+          aLF.Append(aF);
+          aDMVF.Bind(aV, aLF);
+        }
+        else {
+          AppendToList(*pLF, aF);
+        }
+      }
+    }
+    //
+    // for the splits to be regular they should form only one block
+    TopTools_ListOfShape aLCBF;
+    BOPTools_AlgoTools::MakeConnexityBlocks(aCFIm, TopAbs_EDGE, TopAbs_FACE, aLCBF);
+    //
+    if (aLCBF.Extent() >  1) {
+      // non of these edges should be removed
+      TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDM(aDMEF);
+      for (; aItDM.More(); aItDM.Next()) {
+        aMEAvoid.Add(aItDM.Key());
+      }
+    }
+  }
+  //
+  // all edges not included in aMEAvoid can be removed
+  TopTools_MapOfShape aMERem;
+  TopTools_MapIteratorOfMapOfShape aItM(theMEInverted);
+  for (; aItM.More(); aItM.Next()) {
+    const TopoDS_Shape& aE = aItM.Value();
+    if (!aMEAvoid.Contains(aE)) {
+      TopoDS_Iterator aIt(aE);
+      for (; aIt.More(); aIt.Next()) {
+        const TopoDS_Shape& aV = aIt.Value();
+        const TopTools_ListOfShape *pLF = aDMVF.Seek(aV);
+        if (pLF && (pLF->Extent() > 3)) {
+          aMERem.Add(aE);
+          break;
+        }
+      }
+    }
+  }
+  //
+  if (aMERem.IsEmpty()) {
+    return;
+  }
+  //
+  // all invalid faces containing these edges can be removed
+  TopTools_IndexedDataMapOfShapeListOfShape aInvFaces;
+  TopTools_MapOfShape aMFRem;
+  TopTools_IndexedMapOfShape aMFToUpdate;
+  aNb = theInvFaces.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aF = theInvFaces.FindKey(i);
+    TopTools_ListOfShape& aLFIm = theInvFaces(i);
+    //
+    TopTools_ListIteratorOfListOfShape aIt(aLFIm);
+    for (; aIt.More(); ) {
+      const TopoDS_Shape& aFIm = aIt.Value();
+      //
+      // to be removed the face should have at least two not connected
+      // inverted edges
+      TopoDS_Compound aCEInv;
+      BRep_Builder().MakeCompound(aCEInv);
+      TopExp_Explorer aExp(aFIm, TopAbs_EDGE);
+      for (; aExp.More(); aExp.Next()) {
+        const TopoDS_Shape& aE = aExp.Current();
+        //
+        if (aMERem.Contains(aE)) {
+          BRep_Builder().Add(aCEInv, aE);
+        }
+      }
+      //
+      // check connectivity
+      TopTools_ListOfShape aLCBE;
+      BOPTools_AlgoTools::MakeConnexityBlocks(aCEInv, TopAbs_VERTEX, TopAbs_EDGE, aLCBE);
+      //
+      if (aLCBE.Extent() >= 2) {
+        aMFToUpdate.Add(aF);
+        aMFRem.Add(aFIm);
+        aLFIm.Remove(aIt);
+      }
+      else {
+        aIt.Next();
+      }
+    }
+    //
+    if (aLFIm.Extent()) {
+      aInvFaces.Add(aF, aLFIm);
+    }
+  }
+  //
+  if (aMFRem.IsEmpty()) {
+    return;
+  }
+  //
+  theInvFaces = aInvFaces;
+  // remove from splits
+  aNb = aMFToUpdate.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aF = aMFToUpdate(i);
+    TopTools_ListOfShape& aLFIm = theFImages.ChangeFromKey(aF);
+    //
+    TopTools_ListIteratorOfListOfShape aIt(aLFIm);
+    for (; aIt.More(); ) {
+      const TopoDS_Shape& aFIm = aIt.Value();
+      if (aMFRem.Contains(aFIm)) {
+        TopExp::MapShapes(aFIm, TopAbs_EDGE, theMERemoved);
+        aLFIm.Remove(aIt);
+      }
+      else {
+        aIt.Next();
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : RemoveInvalidSplitsFromValid
+//purpose  : Removing invalid splits of faces from valid
+//=======================================================================
+void RemoveInvalidSplitsFromValid(const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                                  const TopTools_DataMapOfShapeShape& theArtInvFaces,
+                                  const TopTools_MapOfShape& theMEInverted,
+                                  TopTools_IndexedDataMapOfShapeListOfShape& theFImages)
+{
+  // Decide whether to remove the found invalid faces or not.
+  // The procedure is the following:
+  // 1. Make connexity blocks from invalid faces;
+  // 2. Find free edges in this blocks;
+  // 3. If all free edges are valid for the faces - remove block.
+  //
+  TopTools_MapOfShape aMFence, aMFToRem;
+  TopoDS_Compound aCFInv;
+  BRep_Builder aBB;
+  aBB.MakeCompound(aCFInv);
+  TopTools_ListIteratorOfListOfShape aItLF;
+  //
+  // make compound of invalid faces
+  TopTools_DataMapOfShapeShape aDMIFOF;
+  Standard_Integer i, aNb = theInvFaces.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aF = theInvFaces.FindKey(i);
+    // artificially invalid faces should not be removed
+    if (theArtInvFaces.IsBound(aF)) {
+      continue;
+    }
+    const TopTools_ListOfShape& aLFInv = theInvFaces(i);
+    aItLF.Initialize(aLFInv);
+    for (; aItLF.More(); aItLF.Next()) {
+      const TopoDS_Shape& aFIm = aItLF.Value();
+      if (aMFence.Add(aFIm)) {
+        aBB.Add(aCFInv, aFIm);
+        aDMIFOF.Bind(aFIm, aF);
+      }
+    }
+  }
+  //
+  // make connexity blocks
+  TopTools_ListOfShape aLCBInv;
+  BOPTools_AlgoTools::MakeConnexityBlocks(aCFInv, TopAbs_EDGE, TopAbs_FACE, aLCBInv);
+  //
+  // analyze each block
+  aItLF.Initialize(aLCBInv);
+  for (; aItLF.More(); aItLF.Next()) {
+    const TopoDS_Shape& aCB = aItLF.Value();
+    //
+    // if connexity block contains only one face - it should be removed;
+    TopExp_Explorer aExp(aCB, TopAbs_FACE);
+    aExp.Next();
+    if (aExp.More()) {
+      // check if there are valid images left
+      aExp.Init(aCB, TopAbs_FACE);
+      for (; aExp.More(); aExp.Next()) {
+        const TopoDS_Shape& aFIm = aExp.Current();
+        const TopoDS_Shape& aF = aDMIFOF.Find(aFIm);
+        //
+        const TopTools_ListOfShape& aLFIm = theFImages.FindFromKey(aF);
+        const TopTools_ListOfShape& aLFInv = theInvFaces.FindFromKey(aF);
+        //
+        if (aLFIm.Extent() == aLFInv.Extent()) {
+          break;
+        }
+      }
+    }
+    //
+    if (!aExp.More()) {
+      aExp.Init(aCB, TopAbs_FACE);
+      for (; aExp.More(); aExp.Next()) {
+        const TopoDS_Shape& aF = aExp.Current();
+        aMFToRem.Add(aF);
+      }
+      continue;
+    }
+    //
+    // remove faces connected by inverted edges
+    TopTools_IndexedDataMapOfShapeListOfShape aDMEF;
+    TopExp::MapShapesAndAncestors(aCB, TopAbs_EDGE, TopAbs_FACE, aDMEF);
+    //
+    aExp.Init(aCB, TopAbs_FACE);
+    for (; aExp.More(); aExp.Next()) {
+      const TopoDS_Shape& aFCB = aExp.Current();
+      //
+      TopExp_Explorer aExpE(aFCB, TopAbs_EDGE);
+      for (; aExpE.More(); aExpE.Next()) {
+        const TopoDS_Shape& aECB = aExpE.Current();
+        if (aDMEF.FindFromKey(aECB).Extent() > 1) {
+          if (!theMEInverted.Contains(aECB)) {
+            break;
+          }
+        }
+      }
+      //
+      if (!aExpE.More()) {
+        aMFToRem.Add(aFCB);
+      }
+    }
+  }
+  //
+  if (aMFToRem.Extent()) {
+    // remove invalid faces from images
+    aNb = theInvFaces.Extent();
+    for (i = 1; i <= aNb; ++i) {
+      const TopoDS_Shape& aF = theInvFaces.FindKey(i);
+      TopTools_ListOfShape& aLFImages = theFImages.ChangeFromKey(aF);
+      aItLF.Initialize(aLFImages);
+      for (; aItLF.More();) {
+        const TopoDS_Shape& aFIm = aItLF.Value();
+        if (aMFToRem.Contains(aFIm)) {
+          aLFImages.Remove(aItLF);
+        }
+        else {
+          aItLF.Next();
+        }
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : RemoveInsideFaces
+//purpose  : Looking for the inside faces that can be safely removed
+//=======================================================================
+void RemoveInsideFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                       TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                       const TopTools_DataMapOfShapeShape& theArtInvFaces,
+                       const TopTools_IndexedMapOfShape& theInvEdges,
+                       const TopTools_IndexedMapOfShape& theMFToCheckInt,
+                       TopTools_DataMapOfShapeListOfShape& theSSInterfs,
+                       TopTools_IndexedMapOfShape& theMERemoved,
+                       TopoDS_Shape& theSolids)
+{
+  BOPCol_ListOfShape aLS;
+  TopTools_MapOfShape aMFence;
+  TopTools_IndexedMapOfShape aMFInv;
+  TopTools_ListIteratorOfListOfShape aItLF;
+  TopTools_DataMapOfShapeShape aDMFImF;
+  //
+  Standard_Integer i, aNb = theFImages.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aF = theFImages.FindKey(i);
+    // to avoid intersection of the splits of the same
+    // offset faces among themselves make compound of the
+    // splits and use it as one argument
+    TopoDS_Compound aCFImi;
+    BRep_Builder().MakeCompound(aCFImi);
+    //
+    for (Standard_Integer j = 0; j < 2; ++j) {
+      const TopTools_ListOfShape* pLFSp = !j ? theInvFaces.Seek(aF) : &theFImages(i);
+      if (!pLFSp) {
+        continue;
+      }
+      //
+      aItLF.Initialize(*pLFSp);
+      for (; aItLF.More(); aItLF.Next()) {
+        const TopoDS_Shape& aFIm = aItLF.Value();
+        if (aMFence.Add(aFIm)) {
+          BRep_Builder().Add(aCFImi, aFIm);
+          aDMFImF.Bind(aFIm, aF);
+          if (!j) {
+            aMFInv.Add(aFIm);
+          }
+        }
+      }
+    }
+    //
+    aLS.Append(aCFImi);
+  }
+  //
+  // to make the solids more complete add for intersection also the faces
+  // consisting only of invalid edges and not included into splits
+  aNb = theMFToCheckInt.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aFSp = theMFToCheckInt(i);
+    if (aMFence.Add(aFSp)) {
+      aLS.Append(aFSp);
+    }
+  }
+  //
+  BOPAlgo_MakerVolume aMV;
+  aMV.SetArguments(aLS);
+  aMV.SetIntersect(Standard_True);
+  aMV.Perform();
+  //
+  // get shapes connection for using in the rebuilding process
+  // for the cases in which some of the intersection left undetected
+  ShapesConnections(theInvFaces, theInvEdges, aDMFImF, aMV, theSSInterfs);
+  //
+  // find faces to remove
+  const TopoDS_Shape& aSols = aMV.Shape();
+  //
+  TopTools_IndexedDataMapOfShapeListOfShape aDMFS;
+  TopExp::MapShapesAndAncestors(aSols, TopAbs_FACE, TopAbs_SOLID, aDMFS);
+  //
+  aNb = aDMFS.Extent();
+  if (!aNb) {
+    return;
+  }
+  //
+  // To use the created solids for classifications, firstly, it is necessary
+  // to check them on validity - the created solids should be complete,
+  // i.e. all faces should be included.
+  //
+  // Check completeness
+  if (aMV.HasDeleted()) {
+    // perform additional check on faces
+    aNb = theFImages.Extent();
+    for (i = 1; i <= aNb; ++i) {
+      const TopTools_ListOfShape& aLFIm = theFImages(i);
+      if (aLFIm.IsEmpty()) {
+        continue;
+      }
+      //
+      aItLF.Initialize(aLFIm);
+      for (; aItLF.More(); aItLF.Next()) {
+        const TopoDS_Shape& aFIm = aItLF.Value();
+        if (!aMV.IsDeleted(aFIm)) {
+          break;
+        }
+      }
+      //
+      if (!aItLF.More()) {
+        return;
+      }
+    }
+  }
+  //
+  TopTools_MapOfShape aMFToRem;
+  aNb = aDMFS.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopTools_ListOfShape& aLSol = aDMFS(i);
+    if (aLSol.Extent() > 1) {
+      const TopoDS_Shape& aFIm = aDMFS.FindKey(i);
+      aMFToRem.Add(aFIm);
+    }
+  }
+  //
+  // update invalid faces with images
+  aNb = aMFInv.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aFInv = aMFInv(i);
+    const TopTools_ListOfShape& aLFInvIm = aMV.Modified(aFInv);
+    TopTools_ListIteratorOfListOfShape aItLFInvIm(aLFInvIm);
+    for (; aItLFInvIm.More(); aItLFInvIm.Next()) {
+      const TopoDS_Shape& aFInvIm = aItLFInvIm.Value();
+      aMFInv.Add(aFInvIm);
+    }
+  }
+  //
+  TopoDS_Compound aSolids;
+  BRep_Builder().MakeCompound(aSolids);
+  //
+  TopExp_Explorer aExpS(aSols, TopAbs_SOLID);
+  for (; aExpS.More(); aExpS.Next()) {
+    const TopoDS_Shape& aSol = aExpS.Current();
+    //
+    Standard_Boolean bAllInv(Standard_True), bAllRemoved(Standard_True);
+
+    TopExp_Explorer aExpF(aSol, TopAbs_FACE);
+    for (; aExpF.More(); aExpF.Next()) {
+      const TopoDS_Shape& aFS = aExpF.Current();
+      //
+      if (aFS.Orientation() == TopAbs_INTERNAL) {
+        aMFToRem.Add(aFS);
+      }
+      //
+      bAllRemoved = bAllRemoved && aMFToRem.Contains(aFS);
+      bAllInv = bAllInv && (aMFToRem.Contains(aFS) || aMFInv.Contains(aFS));
+    }
+    //
+    if (bAllInv && !bAllRemoved) {
+      // remove invalid faces but keep those that have already been marked for removal
+      TopExp_Explorer aExpF(aSol, TopAbs_FACE);
+      for (; aExpF.More(); aExpF.Next()) {
+        const TopoDS_Shape& aFS = aExpF.Current();
+        //
+        if (aMFToRem.Contains(aFS)) {
+          aMFToRem.Remove(aFS);
+        }
+        else {
+          aMFToRem.Add(aFS);
+        }
+      }
+    }
+    else {
+      BRep_Builder().Add(aSolids, aSol);
+      theSolids = aSolids;
+    }
+  }
+  //
+  // remove newly found internal faces
+  RemoveValidSplits(aMFToRem, theFImages, aMV, theMERemoved);
+  RemoveInvalidSplits(aMFToRem, theArtInvFaces, theInvEdges, theInvFaces, aMV, theMERemoved);
+}
+
+//=======================================================================
+//function : ShapesConnections
+//purpose  : Looking for the connections between faces not to miss
+//           some necessary intersection
+//=======================================================================
+void ShapesConnections(const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                       const TopTools_IndexedMapOfShape& theInvEdges,
+                       const TopTools_DataMapOfShapeShape& theDMFOr,
+                       BOPAlgo_Builder& theBuilder,
+                       TopTools_DataMapOfShapeListOfShape& theSSInterfs)
+{
+  // update invalid edges with images and keep connection to original edge
+  TopTools_DataMapOfShapeListOfShape aDMEOr;
+  Standard_Integer i, aNb = theInvEdges.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aEInv = theInvEdges(i);
+    const TopTools_ListOfShape& aLEIm = theBuilder.Modified(aEInv);
+    if (aLEIm.IsEmpty()) {
+      aDMEOr.Bound(aEInv, TopTools_ListOfShape())->Append(aEInv);
+      continue;
+    }
+    //
+    TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm);
+    for (; aItLEIm.More(); aItLEIm.Next()) {
+      const TopoDS_Shape& aEIm = aItLEIm.Value();
+      //
+      TopTools_ListOfShape* pLEOr = aDMEOr.ChangeSeek(aEIm);
+      if (!pLEOr) {
+        pLEOr = aDMEOr.Bound(aEIm, TopTools_ListOfShape());
+      }
+      AppendToList(*pLEOr, aEInv);
+    }
+  }
+  //
+  // get shapes connections for using in the rebuilding process
+  const BOPDS_PDS& pDS = theBuilder.PDS();
+  // analyze all Face/Face intersections
+  const BOPDS_VectorOfInterfFF& aFFs = pDS->InterfFF();
+  Standard_Integer iInt, aNbFF = aFFs.Extent();
+  for (iInt = 0; iInt < aNbFF; ++iInt) {
+    const BOPDS_InterfFF& aFF = aFFs(iInt);
+    const BOPDS_VectorOfCurve& aVNC = aFF.Curves();
+    Standard_Integer aNbC = aVNC.Extent();
+    if (!aNbC) {
+      continue;
+    }
+    //
+    const TopoDS_Shape& aFIm1 = pDS->Shape(aFF.Index1());
+    const TopoDS_Shape& aFIm2 = pDS->Shape(aFF.Index2());
+    //
+    const TopoDS_Shape* pF1 = theDMFOr.Seek(aFIm1);
+    const TopoDS_Shape* pF2 = theDMFOr.Seek(aFIm2);
+    //
+    if (!pF1 || !pF2) {
+      continue;
+    }
+    //
+    if (pF1->IsSame(*pF2)) {
+      continue;
+    }
+    //
+    Standard_Boolean bInv1 = theInvFaces.Contains(*pF1);
+    Standard_Boolean bInv2 = theInvFaces.Contains(*pF2);
+    //
+    if (!bInv1 && !bInv2) {
+      continue;
+    }
+    //
+    // check if it is real Face/Face intersection
+    TopTools_MapOfShape aMEInt;
+    for (Standard_Integer iC = 0; iC < aNbC; ++iC) {
+      const BOPDS_Curve& aNC = aVNC(iC);
+      const BOPDS_ListOfPaveBlock& aLPB = aNC.PaveBlocks();
+      BOPDS_ListIteratorOfListOfPaveBlock aItLPB(aLPB);
+      for (; aItLPB.More(); aItLPB.Next()) {
+        const Handle(BOPDS_PaveBlock)& aPB = aItLPB.Value();
+        Standard_Integer nEInt;
+        if (aPB->HasEdge(nEInt)) {
+          const TopoDS_Shape& aEInt = pDS->Shape(nEInt);
+          aMEInt.Add(aEInt);
+        }
+      }
+    }
+    //
+    if (aMEInt.IsEmpty()) {
+      continue;
+    }
+    //
+    // check if invalid edges of the face are in the same splits with intersection edges
+    for (Standard_Integer i = 0; i < 2; ++i) {
+      if ((!i && !bInv1) || (i && !bInv2)) {
+        continue;
+      }
+      //
+      const TopoDS_Shape& aF = !i ? *pF1 : *pF2;
+      const TopoDS_Shape& aFOp = !i ? *pF2 : *pF1;
+      const TopoDS_Shape& aFIm = !i ? aFIm1 : aFIm2;
+      //
+      Standard_Boolean bFound = Standard_False;
+      //
+      TopTools_ListOfShape aLFIm = theBuilder.Modified(aFIm);
+      if (aLFIm.IsEmpty()) {
+        aLFIm.Append(aFIm);
+      }
+      //
+      TopTools_ListIteratorOfListOfShape aItLFIm(aLFIm);
+      for (; aItLFIm.More(); aItLFIm.Next()) {
+        const TopoDS_Shape& aFImIm = aItLFIm.Value();
+        //
+        Standard_Boolean bInv(Standard_False), bInt(Standard_False);
+        TopExp_Explorer aExpE(aFImIm, TopAbs_EDGE);
+        for (; aExpE.More(); aExpE.Next()) {
+          const TopoDS_Shape& aE = aExpE.Current();
+          if (!bInv) {
+            bInv = aDMEOr.IsBound(aE);
+          }
+          if (!bInt) {
+            bInt = aMEInt.Contains(aE);
+          }
+          if (bInv && bInt) {
+            break;
+          }
+        }
+        //
+        if (!bInt || !bInv) {
+          continue;
+        }
+        //
+        bFound = Standard_True;
+        //
+        // append opposite face to all invalid edges in the split
+        aExpE.Init(aFImIm, TopAbs_EDGE);
+        for (; aExpE.More(); aExpE.Next()) {
+          const TopoDS_Shape& aE = aExpE.Current();
+          const TopTools_ListOfShape* pLEOr = aDMEOr.Seek(aE);
+          if (!pLEOr) {
+            continue;
+          }
+          //
+          TopTools_ListIteratorOfListOfShape aItLE(*pLEOr);
+          for (; aItLE.More(); aItLE.Next()) {
+            const TopoDS_Shape& aEOr = aItLE.Value();
+            TopTools_ListOfShape *pLFE = theSSInterfs.ChangeSeek(aEOr);
+            if (!pLFE) {
+              pLFE = theSSInterfs.Bound(aEOr, TopTools_ListOfShape());
+            }
+            AppendToList(*pLFE, aFOp);
+          }
+        }
+      }
+      if (bFound) {
+        // save connection between offset faces
+        TopTools_ListOfShape *pLF = theSSInterfs.ChangeSeek(aF);
+        if (!pLF) {
+          pLF = theSSInterfs.Bound(aF, TopTools_ListOfShape());
+        }
+        AppendToList(*pLF, aFOp);
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : RemoveValidSplits
+//purpose  : Removing valid splits according to results of intersection
+//=======================================================================
+void RemoveValidSplits(const TopTools_MapOfShape& theSpRem,
+                       TopTools_IndexedDataMapOfShapeListOfShape& theImages,
+                       BOPAlgo_Builder& theGF,
+                       TopTools_IndexedMapOfShape& theMERemoved)
+{
+  Standard_Integer i, aNb = theImages.Extent();
+  if (!aNb) {
+    return;
+  }
+  //
+  for (i = 1; i <= aNb; ++i) {
+    TopTools_ListOfShape& aLSIm = theImages(i);
+    TopTools_ListIteratorOfListOfShape aIt(aLSIm);
+    for (; aIt.More(); ) {
+      const TopoDS_Shape& aSIm = aIt.Value();
+      if (theSpRem.Contains(aSIm)) {
+        TopExp::MapShapes(aSIm, TopAbs_EDGE, theMERemoved);
+        aLSIm.Remove(aIt);
+        continue;
+      }
+      //
+      // check if all its images are have to be removed
+      const TopTools_ListOfShape& aLSImIm = theGF.Modified(aSIm);
+      if (aLSImIm.Extent()) {
+        Standard_Boolean bAllRem = Standard_True;
+        TopTools_ListIteratorOfListOfShape aIt1(aLSImIm);
+        for (; aIt1.More(); aIt1.Next()) {
+          const TopoDS_Shape& aSImIm = aIt1.Value();
+          if (theSpRem.Contains(aSImIm)) {
+            TopExp::MapShapes(aSImIm, TopAbs_EDGE, theMERemoved);
+          }
+          else {
+            bAllRem = Standard_False;
+          }
+        }
+        //
+        if (bAllRem) {
+          TopExp::MapShapes(aSIm, TopAbs_EDGE, theMERemoved);
+          aLSIm.Remove(aIt);
+          continue;
+        }
+      }
+      aIt.Next();
+    }
+  }
+}
+
+//=======================================================================
+//function : RemoveInvalidSplits
+//purpose  : Removing invalid splits according to the results of intersection
+//=======================================================================
+void RemoveInvalidSplits(const TopTools_MapOfShape& theSpRem,
+                         const TopTools_DataMapOfShapeShape& theArtInvFaces,
+                         const TopTools_IndexedMapOfShape& theInvEdges,
+                         TopTools_IndexedDataMapOfShapeListOfShape& theImages,
+                         BOPAlgo_Builder& theGF,
+                         TopTools_IndexedMapOfShape& theMERemoved)
+{
+  Standard_Integer i, aNb = theImages.Extent();
+  if (!aNb) {
+    return;
+  }
+  //
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aS = theImages.FindKey(i);
+    Standard_Boolean bArt = theArtInvFaces.IsBound(aS);
+    //
+    TopTools_ListOfShape& aLSIm = theImages(i);
+    TopTools_ListIteratorOfListOfShape aIt(aLSIm);
+    for (; aIt.More();) {
+      const TopoDS_Shape& aSIm = aIt.Value();
+      if (theSpRem.Contains(aSIm)) {
+        TopExp::MapShapes(aSIm, TopAbs_EDGE, theMERemoved);
+        aLSIm.Remove(aIt);
+        continue;
+      }
+      //
+      // check if all its images are have to be removed
+      const TopTools_ListOfShape& aLSImIm = theGF.Modified(aSIm);
+      if (aLSImIm.IsEmpty()) {
+        aIt.Next();
+        continue;
+      }
+      //
+      Standard_Boolean bAllRem = Standard_True;
+      TopTools_IndexedMapOfShape aMERemoved;
+      TopTools_ListIteratorOfListOfShape aIt1(aLSImIm);
+      for (; aIt1.More(); aIt1.Next()) {
+        const TopoDS_Shape& aSImIm = aIt1.Value();
+        if (theSpRem.Contains(aSImIm)) {
+          TopExp::MapShapes(aSImIm, TopAbs_EDGE, aMERemoved);
+        }
+        else {
+          bAllRem = Standard_False;
+        }
+      }
+      //
+      if (bAllRem) {
+        aLSIm.Remove(aIt);
+        continue;
+      }
+      //
+      if (bArt) {
+        aIt.Next();
+        continue;
+      }
+      //
+      // remove the face from invalid if all invalid edges of this face
+      // have been marked for removal
+      TopExp_Explorer aExpE(aSIm, TopAbs_EDGE);
+      for (; aExpE.More(); aExpE.Next()) {
+        const TopoDS_Shape& aEInv = aExpE.Current();
+        if (theInvEdges.Contains(aEInv) && !aMERemoved.Contains(aEInv)) {
+          break;
+        }
+      }
+      if (!aExpE.More()) {
+        TopExp::MapShapes(aSIm, TopAbs_EDGE, theMERemoved);
+        aLSIm.Remove(aIt);
+      }
+      else {
+        aIt.Next();
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : FilterEdgesImages
+//purpose  : Updating the maps of images and origins of the offset edges
+//=======================================================================
+void FilterEdgesImages(const TopoDS_Shape& theS,
+                       TopTools_DataMapOfShapeListOfShape& theOEImages,
+                       TopTools_DataMapOfShapeListOfShape& theOEOrigins)
+{
+  // map edges
+  TopTools_IndexedMapOfShape aME;
+  TopExp::MapShapes(theS, TopAbs_EDGE, aME);
+  //
+  theOEOrigins.Clear();
+  TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDM(theOEImages);
+  for (; aItDM.More(); aItDM.Next()) {
+    const TopoDS_Shape& aE = aItDM.Key();
+    TopTools_ListOfShape& aLEIm = aItDM.ChangeValue();
+    //
+    TopTools_ListIteratorOfListOfShape aIt(aLEIm);
+    for (; aIt.More(); ) {
+      const TopoDS_Shape& aEIm = aIt.Value();
+      // filter images
+      if (!aME.Contains(aEIm)) {
+        // remove the image
+        // edges with no images left should be kept in the map
+        // to avoid their usage when building the splits of faces
+        aLEIm.Remove(aIt);
+        continue;
+      }
+      //
+      // save origins
+      if (theOEOrigins.IsBound(aEIm)) {
+        AppendToList(theOEOrigins.ChangeFind(aEIm), aE);
+      }
+      else {
+        TopTools_ListOfShape aLOr;
+        aLOr.Append(aE);
+        theOEOrigins.Bind(aEIm, aLOr);
+      }
+      //
+      aIt.Next();
+    }
+  }
+}
+
+//=======================================================================
+//function : FilterInvalidFaces
+//purpose  : Filtering of the invalid faces
+//=======================================================================
+void FilterInvalidFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                        const TopTools_IndexedDataMapOfShapeListOfShape& theDMFE,
+                        TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                        TopTools_DataMapOfShapeShape& theArtInvFaces)
+{
+  //
+  // filter invalid faces, considering faces having only valid 
+  // images left with non-free edges as valid
+  // do not remove invalid faces if it creates free edges
+  //
+  TopTools_IndexedDataMapOfShapeListOfShape aReallyInvFaces;
+  TopTools_ListIteratorOfListOfShape aItLF;
+  //
+  Standard_Integer i, aNb = theInvFaces.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aF = theInvFaces.FindKey(i);
+    const TopTools_ListOfShape& aLFInv = theInvFaces(i);
+    //
+    if (theArtInvFaces.IsBound(aF)) {
+      if (aLFInv.IsEmpty()) {
+        theArtInvFaces.UnBind(aF);
+      }
+      else {
+        aReallyInvFaces.Add(aF, aLFInv);
+      }
+      continue;
+    }
+    //
+    if (aLFInv.IsEmpty()) {
+      continue;
+    }
+    //
+    const TopTools_ListOfShape& aLFIm = theFImages.FindFromKey(aF);
+    Standard_Boolean bInvalid = aLFIm.IsEmpty();
+    //
+    if (!bInvalid) {
+      // check two lists on common splits
+      aItLF.Initialize(aLFInv);
+      for (; aItLF.More(); aItLF.Next()) {
+        const TopoDS_Shape& aFInv = aItLF.Value();
+        //
+        TopTools_ListIteratorOfListOfShape aItLFIm(aLFIm);
+        for (; aItLFIm.More(); aItLFIm.Next()) {
+          const TopoDS_Shape& aFIm = aItLFIm.Value();
+          //
+          if (aFInv.IsSame(aFIm)) {
+            break;
+          }
+        }
+        //
+        if (aItLFIm.More()) {
+          break;
+        }
+      }
+      //
+      bInvalid = aItLF.More();
+    }
+    //
+    if (!bInvalid) {
+      // check for free edges
+      for (Standard_Integer j = 0; !bInvalid && j < 2; ++j) {
+        const TopTools_ListOfShape& aLI = !j ? aLFIm : aLFInv;
+        aItLF.Initialize(aLI);
+        for (; aItLF.More(); aItLF.Next()) {
+          const TopoDS_Shape& aFIm = aItLF.Value();
+          //
+          TopExp_Explorer aExp(aFIm, TopAbs_EDGE);
+          for (; aExp.More(); aExp.Next()) {
+            const TopoDS_Shape& aE = aExp.Current();
+            if (theDMFE.Contains(aE)) {
+              const TopTools_ListOfShape& aLEF = theDMFE.FindFromKey(aE);
+              if (aLEF.Extent() == 1) {
+                break;
+              }
+            }
+          }
+          //
+          if (aExp.More()) {
+            break;
+          }
+        }
+        bInvalid = aItLF.More();
+      }
+    }
+    //
+    if (bInvalid) {
+      aReallyInvFaces.Add(aF, aLFInv);
+    }
+  }
+  //
+  theInvFaces = aReallyInvFaces;
+}
+
+//=======================================================================
+//function : FilterInvalidEdges
+//purpose  : Filtering the invalid edges according to currently invalid faces
+//=======================================================================
+void FilterInvalidEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                        const TopTools_DataMapOfShapeShape& theArtInvFaces,
+                        const TopTools_DataMapOfShapeListOfShape& theDMFLIE,
+                        const TopTools_IndexedMapOfShape& theMERemoved,
+                        TopTools_IndexedMapOfShape& theInvEdges)
+{
+  TopoDS_Compound aCEInv;
+  TopTools_IndexedMapOfShape aMEInv;
+  BRep_Builder aBB;
+  aBB.MakeCompound(aCEInv);
+  TopTools_ListIteratorOfListOfShape aItLF;
+  //
+  Standard_Integer i, aNb = theInvFaces.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopTools_ListOfShape& aLFInv = theInvFaces(i);
+    aItLF.Initialize(aLFInv);
+    for (; aItLF.More(); aItLF.Next()) {
+      const TopoDS_Shape& aFIm = aItLF.Value();
+      TopExp::MapShapes(aFIm, TopAbs_EDGE, aMEInv);
+      //
+      TopExp_Explorer aExpE(aFIm, TopAbs_EDGE);
+      for (; aExpE.More(); aExpE.Next()) {
+        const TopoDS_Shape& aE = aExpE.Current();
+        if (theInvEdges.Contains(aE)) {
+          aBB.Add(aCEInv, aE);
+        }
+      }
+    }
+  }
+  //
+  // remove edges which have been marked for removal
+  TopTools_IndexedMapOfShape aMEInvToAvoid;
+  TopTools_ListOfShape aLCBE;
+  BOPTools_AlgoTools::MakeConnexityBlocks(aCEInv, TopAbs_VERTEX, TopAbs_EDGE, aLCBE);
+  //
+  TopTools_ListIteratorOfListOfShape aItLCBE(aLCBE);
+  for (; aItLCBE.More(); aItLCBE.Next()) {
+    const TopoDS_Shape& aCBE = aItLCBE.Value();
+    TopExp_Explorer aExpCB(aCBE, TopAbs_EDGE);
+    for (; aExpCB.More(); aExpCB.Next()) {
+      const TopoDS_Shape& aE = aExpCB.Current();
+      if (!theMERemoved.Contains(aE)) {
+        break;
+      }
+    }
+    //
+    if (!aExpCB.More()) {
+      TopExp::MapShapes(aCBE, TopAbs_EDGE, aMEInvToAvoid);
+    }
+  }
+  //
+  TopTools_IndexedMapOfShape aReallyInvEdges;
+  //
+  aNb = theInvFaces.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aF = theInvFaces.FindKey(i);
+    if (theArtInvFaces.IsBound(aF)) {
+      const TopTools_ListOfShape& aLEInv = theDMFLIE.Find(aF);
+      aItLF.Initialize(aLEInv);
+      for (; aItLF.More(); aItLF.Next()) {
+        const TopoDS_Shape& aE = aItLF.Value();
+        if (aMEInv.Contains(aE) && !aMEInvToAvoid.Contains(aE)) {
+          aReallyInvEdges.Add(aE);
+        }
+      }
+    }
+    else {
+      const TopTools_ListOfShape& aLFInv = theInvFaces(i);
+      aItLF.Initialize(aLFInv);
+      for (; aItLF.More(); aItLF.Next()) {
+        const TopoDS_Shape& aFIm = aItLF.Value();
+        TopExp_Explorer aExpE(aFIm, TopAbs_EDGE);
+        for (; aExpE.More(); aExpE.Next()) {
+          const TopoDS_Shape& aE = aExpE.Current();
+          if (theInvEdges.Contains(aE) && !aMEInvToAvoid.Contains(aE)) {
+            aReallyInvEdges.Add(aE);
+          }
+        }
+      }
+    }
+  }
+  //
+  theInvEdges = aReallyInvEdges;
+}
+
+//=======================================================================
+//function : FindFacesToRebuild
+//purpose  : Looking for the faces that have to be rebuilt:
+//           1. Faces close to invalidity
+//           2. Faces containing some invalid parts
+//=======================================================================
+void FindFacesToRebuild(const TopTools_IndexedDataMapOfShapeListOfShape&  theLFImages,
+                        const TopTools_IndexedMapOfShape&  theInvEdges,
+                        const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                        const TopTools_DataMapOfShapeListOfShape& theSSInterfs,
+                        TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+                        TopTools_MapOfShape& theFSelfRebAvoid)
+{
+  Standard_Integer i, aNb = theLFImages.Extent();
+  if (!aNb) {
+    return;
+  }
+  //
+  Standard_Boolean bRebuild;
+  TopTools_ListIteratorOfListOfShape aItLF;
+  TopTools_ListOfShape aLEValid;
+  TopTools_MapOfShape aMFence, aMEReb, aMFReb;
+  TopExp_Explorer aExp;
+  //
+  TopTools_DataMapOfShapeListOfShape aDMFLV;
+  // get edges from invalid faces
+  aNb = theInvFaces.Extent();
+  for (i = 1; i <= aNb; i++) {
+    const TopoDS_Shape& aF = theInvFaces.FindKey(i);
+    aMFence.Clear();
+    TopTools_ListOfShape aLVAvoid;
+    const TopTools_ListOfShape& aLFIm = theInvFaces(i);
+    aItLF.Initialize(aLFIm);
+    for (; aItLF.More(); aItLF.Next()) {
+      const TopoDS_Shape& aFIm = aItLF.Value();
+      aExp.Init(aFIm, TopAbs_EDGE);
+      for (; aExp.More(); aExp.Next()) {
+        const TopoDS_Shape& aE = aExp.Current();
+        aMEReb.Add(aE);
+        if (theInvEdges.Contains(aE)) {
+          TopExp_Explorer aExpV(aE, TopAbs_VERTEX);
+          for (; aExpV.More(); aExpV.Next()) {
+            const TopoDS_Shape& aV = aExpV.Current();
+            if (aMFence.Add(aV)) {
+              aLVAvoid.Append(aV);
+              aMEReb.Add(aV);
+            }
+          }
+        }
+      }
+    }
+    //
+    if (aLVAvoid.Extent()) {
+      aDMFLV.Bind(aF, aLVAvoid);
+    }
+    //
+    const TopTools_ListOfShape* pLF = theSSInterfs.Seek(aF);
+    if (pLF) {
+      TopTools_ListIteratorOfListOfShape aItLFE(*pLF);
+      for (; aItLFE.More(); aItLFE.Next()) {
+        const TopoDS_Shape& aFE = aItLFE.Value();
+        aMFReb.Add(aFE);
+      }
+    }
+  }
+  //
+  // get face to rebuild
+  aNb = theLFImages.Extent();
+  for (i = 1; i <= aNb; i++) {
+    const TopoDS_Shape& aF = theLFImages.FindKey(i);
+    const TopTools_ListOfShape& aLFIm = theLFImages(i);
+    TopTools_MapOfShape aMVAvoid;
+    if (aDMFLV.IsBound(aF)) {
+      const TopTools_ListOfShape& aLVAvoid = aDMFLV.Find(aF);
+      TopTools_ListIteratorOfListOfShape aItLV(aLVAvoid);
+      for (; aItLV.More(); aItLV.Next()) {
+        const TopoDS_Shape& aV = aItLV.Value();
+        aMVAvoid.Add(aV);
+      }
+    }
+    //
+    bRebuild = aMFReb.Contains(aF);
+    aLEValid.Clear();
+    aMFence.Clear();
+    //
+    aItLF.Initialize(aLFIm);
+    for (; aItLF.More(); aItLF.Next()) {
+      const TopoDS_Shape& aFIm = aItLF.Value();
+      aExp.Init(aFIm, TopAbs_EDGE);
+      for (; aExp.More(); aExp.Next()) {
+        const TopoDS_Edge& anEIm = TopoDS::Edge(aExp.Current());
+        if (!theInvEdges.Contains(anEIm)) {
+          if (aMFence.Add(anEIm)) {
+            aLEValid.Append(anEIm);
+          }
+        }
+        //
+        if (!bRebuild) {
+          bRebuild = aMEReb.Contains(anEIm);
+        }
+        //
+        if (!bRebuild) {
+          // check vertices
+          TopExp_Explorer aExpV(anEIm, TopAbs_VERTEX);
+          for (; aExpV.More() && !bRebuild; aExpV.Next()) {
+            const TopoDS_Shape& aV = aExpV.Current();
+            if (!aMVAvoid.Contains(aV)) {
+              bRebuild = aMEReb.Contains(aV);
+            }
+          }
+        }
+      }
+    }
+    //
+    if (!bRebuild) {
+      bRebuild = aLFIm.Extent() && theInvFaces.Contains(aF);
+      if (bRebuild) {
+        theFSelfRebAvoid.Add(aF);
+      }
+    }
+    //
+    if (bRebuild) {
+      theFToRebuild.Add(aF, aLEValid);
+    }
+  }
+}
+
+//=======================================================================
+//function : RebuildFaces
+//purpose  : Rebuilding of the faces
+//=======================================================================
+void RebuildFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+                  const TopTools_MapOfShape& theFSelfRebAvoid,
+                  const TopoDS_Shape& theSolids,
+                  const TopTools_DataMapOfShapeListOfShape& theSSInterfs,
+                  TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                  TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                  TopTools_DataMapOfShapeShape& theFacesOrigins,
+                  TopTools_DataMapOfShapeListOfShape& theOEImages,
+                  TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                  TopTools_MapOfShape& theLastInvEdges,
+                  TopTools_IndexedMapOfShape& theEdgesToAvoid,
+                  TopTools_IndexedMapOfShape& theInvEdges,
+                  TopTools_IndexedMapOfShape& theValidEdges,
+                  const TopTools_MapOfShape& theInvertedEdges,
+                  TopTools_DataMapOfShapeInteger& theAlreadyInvFaces,
+                  TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                  const TopTools_DataMapOfShapeShape& theArtInvFaces,
+                  TopTools_MapOfShape& theVertsToAvoid,
+                  TopTools_DataMapOfShapeShape& theETrimEInf,
+                  Handle(BRepAlgo_AsDes)& theAsDes)
+{
+  TopTools_MapOfShape aModifiedEdges;
+  //
+  // 1. Intersect faces
+  IntersectFaces(theFToRebuild, theFSelfRebAvoid, theSolids, theSSInterfs, theFImages, theEdgesOrigins, theOEImages, 
+                 theOEOrigins, theInvEdges, theValidEdges, theInvertedEdges, theEdgesToAvoid,
+                 theInvFaces, theArtInvFaces, theVertsToAvoid, theETrimEInf, aModifiedEdges, theAsDes);
+  //
+  // 2. Repeat steps to build the correct faces
+  BuildSplitsOfInvFaces(theFToRebuild, aModifiedEdges, theFImages, theEdgesOrigins,
+                        theFacesOrigins, theOEImages, theOEOrigins, theLastInvEdges,
+                        theEdgesToAvoid, theVertsToAvoid, theAlreadyInvFaces, theValidEdges, 
+                        theETrimEInf, theAsDes);
+}
+
+//=======================================================================
+//function : IntersectFaces
+//purpose  : Intersection of the faces that should be rebuild
+//           to resolve all invalidities
+//=======================================================================
+void IntersectFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+                    const TopTools_MapOfShape& theFSelfRebAvoid,
+                    const TopoDS_Shape& theSolids,
+                    const TopTools_DataMapOfShapeListOfShape& theSSInterfs,
+                    TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                    TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                    TopTools_DataMapOfShapeListOfShape& theOEImages,
+                    TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                    TopTools_IndexedMapOfShape& theInvEdges,
+                    TopTools_IndexedMapOfShape& theValidEdges,
+                    const TopTools_MapOfShape& theInvertedEdges,
+                    TopTools_IndexedMapOfShape& theEdgesToAvoid,
+                    TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                    const TopTools_DataMapOfShapeShape& theArtInvFaces,
+                    TopTools_MapOfShape& theVertsToAvoid,
+                    TopTools_DataMapOfShapeShape& theETrimEInf,
+                    TopTools_MapOfShape& theModifiedEdges,
+                    Handle(BRepAlgo_AsDes)& theAsDes)
+{
+  Standard_Integer aNbFR = theFToRebuild.Extent();
+  if (!aNbFR) {
+    return;
+  }
+  //
+  Standard_Integer i, j, k, aNbInv;
+  TopTools_ListIteratorOfListOfShape aItLF, aItLE;
+  TopExp_Explorer aExp;
+  //
+  // get vertices from invalid edges
+  TopTools_MapOfShape aMVInv, aMVInvAll;
+  aNbInv = theInvEdges.Extent();
+  for (i = 1; i <= aNbInv; ++i) {
+    const TopoDS_Shape& aEInv = theInvEdges(i);
+    Standard_Boolean bValid = theValidEdges.Contains(aEInv);
+    aExp.Init(aEInv, TopAbs_VERTEX);
+    for (; aExp.More(); aExp.Next()) {
+      const TopoDS_Shape& aV = aExp.Current();
+      aMVInvAll.Add(aV);
+      if (!bValid) {
+        aMVInv.Add(aV);
+      }
+    }
+  }
+  //
+  Standard_Boolean bLookVertToAvoid = (aMVInv.Extent() > 0);
+  //
+  TopTools_DataMapOfShapeListOfShape aDMSF, aMDone, aMEInfETrim, aDMVEFull;
+  TopTools_IndexedDataMapOfShapeListOfShape aFLE, aDMEFInv;
+  //
+  // Add all faces to rebuild to outgoing map <aFLE>,
+  // plus link edges and vertices to the faces to
+  // define intersection faces
+  PrepareFacesForIntersection(theFToRebuild, theFImages, theInvFaces, theArtInvFaces, 
+                              bLookVertToAvoid, aFLE, aMDone, aDMSF, aMEInfETrim, 
+                              aDMVEFull, theETrimEInf, aDMEFInv);
+
+  // Find vertices to avoid while trimming the edges.
+  // These vertices are taken from the invalid edges common between
+  // splits of different invalid, but not artificially, faces.
+  // Additional condition for these vertices is that all 
+  // edges adjacent to this vertex must be either invalid
+  // or contained in invalid faces
+  TopTools_MapOfShape aMVRInv = theVertsToAvoid;
+  FindVerticesToAvoid(aDMEFInv, theInvEdges, theValidEdges, aDMVEFull, aMVRInv);
+  //
+  // The faces should be intersected selectively -
+  // intersect only faces neighboring to the same invalid face
+  // and connected to its invalid edges;
+  // when dealing with artificially invalid faces for intersection to be
+  // complete we need to use not only invalid edges, but also the 
+  // edges connected to invalid ones
+  TopTools_MapOfShape aMEAlone, aMFence;
+  TopTools_IndexedDataMapOfShapeListOfShape aDMVEVal;
+  //
+  TopTools_DataMapIteratorOfDataMapOfShapeShape aItM(theArtInvFaces);
+  for (; aItM.More(); aItM.Next()) {
+    const TopoDS_Shape& aF = aItM.Key();
+    const TopTools_ListOfShape& aLFInv = theInvFaces.FindFromKey(aF);
+    aItLF.Initialize(aLFInv);
+    for (; aItLF.More(); aItLF.Next()) {
+      const TopoDS_Shape& aFInv = aItLF.Value();
+      aExp.Init(aFInv, TopAbs_EDGE);
+      for (; aExp.More(); aExp.Next()) {
+        const TopoDS_Shape& aE = aExp.Current();
+        if (!theInvEdges.Contains(aE) && aMFence.Add(aE)) {
+          TopExp::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aDMVEVal);
+        }
+      }
+    }
+  }
+  //
+  // collect edges with free vertices
+  Standard_Integer aNbV = aDMVEVal.Extent();
+  for (i = 1; i <= aNbV; ++i) {
+    const TopTools_ListOfShape& aLEV = aDMVEVal(i);
+    if (aLEV.Extent() == 1) {
+      const TopoDS_Shape& aE = aLEV.First();
+      aMEAlone.Add(aE);
+      //
+      // if this alone edge adds nothing to the intersection list
+      // it means that the origin of this edge has been split and we need to
+      // add the neigboring images of the same origins
+      if (aDMSF.Find(aE).Extent() > 1) {
+        continue;
+      }
+      //
+      // check also its vertices
+      TopoDS_Iterator aItE(aE);
+      for (; aItE.More(); aItE.Next()) {
+        const TopoDS_Shape& aV = aItE.Value();
+        if (aDMSF.Find(aV).Extent() > 2) {
+          break;
+        }
+      }
+      //
+      if (aItE.More()) {
+        continue;
+      }
+      //
+      // the edge is useless - look for other images
+      const TopTools_ListOfShape *pLEOr = theOEOrigins.Seek(aE);
+      if (!pLEOr) {
+        continue;
+      }
+      //
+      TopTools_ListIteratorOfListOfShape aItLEOr(*pLEOr);
+      for (; aItLEOr.More(); aItLEOr.Next()) {
+        const TopoDS_Shape& aEOr = aItLEOr.Value();
+        //
+        const TopTools_ListOfShape& aLEIm = theOEImages.Find(aEOr);
+        TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm);
+        for (; aItLEIm.More(); aItLEIm.Next()) {
+          const TopoDS_Shape& aEIm = aItLEIm.Value();
+          //
+          if (aMFence.Contains(aEIm)) {
+            aMEAlone.Add(aEIm);
+          }
+        }
+      }
+    }
+  }
+  //
+  // Bounding vertices of not trimmed edges
+  TopTools_MapOfShape aMVBounds;
+  // Save connections between not trimmed edge and its trimmed parts
+  TopTools_DataMapOfShapeListOfShape aDMEETrim;
+  // Splits of the new edges
+  TopTools_DataMapOfShapeListOfShape aEImages;
+  BRep_Builder aBB;
+  //
+  aNbInv = theInvFaces.Extent();
+  for (k = 1; k <= aNbInv; ++k) {
+    const TopoDS_Shape& aFInv = theInvFaces.FindKey(k);
+    Standard_Boolean bSelfRebAvoid = theFSelfRebAvoid.Contains(aFInv);
+    const TopTools_ListOfShape& aLFInv = theInvFaces(k);
+    //
+    TopTools_ListOfShape aLCB;
+    if (aLFInv.Extent() > 1) {
+      // make compound of invalid faces
+      TopoDS_Compound aCFInv;
+      aBB.MakeCompound(aCFInv);
+      //
+      TopTools_ListIteratorOfListOfShape aIt(aLFInv);
+      for (; aIt.More(); aIt.Next()) {
+        const TopoDS_Shape& aFIm = aIt.Value();
+        aBB.Add(aCFInv, aFIm);
+      }
+      //
+      // make connexity blocks
+      BOPTools_AlgoTools::MakeConnexityBlocks(aCFInv, TopAbs_EDGE, TopAbs_FACE, aLCB);
+    }
+    else {
+      aLCB = aLFInv;
+    }
+    //
+    Standard_Boolean bArtificial = theArtInvFaces.IsBound(aFInv);
+    TopTools_ListIteratorOfListOfShape aItLCB(aLCB);
+    for (; aItLCB.More(); aItLCB.Next()) {
+      const TopoDS_Shape& aCBInv = aItLCB.Value();
+      //
+      TopTools_MapOfShape aMEFence;
+      //
+      TopoDS_Compound aCBE;
+      aBB.MakeCompound(aCBE);
+      //
+      TopExp_Explorer aExp(aCBInv, TopAbs_EDGE);
+      for (; aExp.More(); aExp.Next()) {
+        const TopoDS_Shape& aE = aExp.Current();
+        if (theInvEdges.Contains(aE) || (bArtificial && aMEAlone.Contains(aE))) {
+          if (aMEFence.Add(aE)) {
+            aBB.Add(aCBE, aE);
+          }
+        }
+      }
+      //
+      // make connexity blocks of edges
+      TopTools_ListOfShape aLCBE;
+      BOPTools_AlgoTools::MakeConnexityBlocks(aCBE, TopAbs_VERTEX, TopAbs_EDGE, aLCBE);
+      //
+      TopTools_ListIteratorOfListOfShape aItLCBE(aLCBE);
+      for (; aItLCBE.More(); aItLCBE.Next()) {
+        const TopoDS_Shape& aCBELoc = aItLCBE.Value();
+        //
+        // map of edges and vertices of processing invalidity
+        TopTools_IndexedMapOfShape aME;
+        // map of vertices to trim the new edges
+        TopTools_IndexedMapOfShape  aMECV;
+        TopExp::MapShapes(aCBELoc, TopAbs_EDGE, aME);
+        aMECV = aME;
+        TopExp::MapShapes(aCBELoc, TopAbs_VERTEX, aME);
+        //
+        // Using the map <aME> find chain of faces to be intersected;
+        //
+        // faces for intersection
+        TopTools_IndexedMapOfShape aMFInt;
+        // additional faces for intersection
+        TopTools_IndexedMapOfShape aMFIntExt;
+        // splits of faces for intersection
+        TopTools_ListOfShape aLFInt;
+        // faces to avoid intersection
+        TopTools_IndexedMapOfShape aMFAvoid;
+        //
+        FindFacesForIntersection(aFInv, aME, theFImages, aDMSF, aMVInvAll,
+          theArtInvFaces, bArtificial, theSSInterfs, aMFAvoid, aMFInt, aMFIntExt, aLFInt);
+        if (aMFInt.Extent() < 3) {
+          // nothing to intersect
+          continue;
+        }
+        //
+        // intersect the faces, but do not intersect the invalid ones
+        // among each other (except for the artificially invalid faces)
+        TopTools_IndexedMapOfShape aMEToInt;
+        Standard_Integer aNb = aMFInt.Extent();
+        for (i = 1; i <= aNb; ++i) {
+          const TopoDS_Face& aFi = TopoDS::Face(aMFInt(i));
+          if (bSelfRebAvoid && aFi.IsSame(aFInv)) {
+            continue;
+          }
+          //
+          const TopTools_ListOfShape& aLFImi = theFImages.FindFromKey(aFi);
+          //
+          TopTools_ListOfShape& aLFEi = aFLE.ChangeFromKey(aFi);
+          //
+          TopTools_ListOfShape& aLFDone = aMDone.ChangeFind(aFi);
+          //
+          for (j = i + 1; j <= aNb; ++j) {
+            const TopoDS_Face& aFj = TopoDS::Face(aMFInt(j));
+            if (bSelfRebAvoid && aFj.IsSame(aFInv)) {
+              continue;
+            }
+            //
+            const TopTools_ListOfShape& aLFImj = theFImages.FindFromKey(aFj);
+            //
+            TopTools_ListOfShape& aLFEj = aFLE.ChangeFromKey(aFj);
+            //
+            // if there are some common edges between faces
+            // we should use these edges and do not intersect again.
+            TopTools_ListOfShape aLEC;
+            FindCommonParts(aLFImi, aLFImj, aLEC);
+            //
+            if (aLEC.Extent()) {
+              // no need to intersect if we have common edges between faces
+              Standard_Boolean bForceUse = aMFIntExt.Contains(aFi) || aMFIntExt.Contains(aFj);
+              ProcessCommonEdges(aLEC, theInvEdges, theValidEdges, aME, theETrimEInf, aMEInfETrim,
+                                 theOEOrigins, bForceUse, aMECV, aDMEETrim, aLFEi, aLFEj, aMEToInt);
+              continue;
+            }
+            //
+            // check if both these faces are invalid and sharing edges
+            if (theInvFaces.Contains(aFi) && theInvFaces.Contains(aFj) &&
+              !theArtInvFaces.IsBound(aFi) && !theArtInvFaces.IsBound(aFj)) {
+              continue;
+            }
+            //
+            // check if these two faces have already been treated
+            aItLE.Initialize(aLFDone);
+            for (; aItLE.More(); aItLE.Next()) {
+              const TopoDS_Shape& aF = aItLE.Value();
+              if (aF.IsSame(aFj)) {
+                break;
+              }
+            }
+            //
+            if (aItLE.More()) {
+              // use intersection line obtained on the previous steps
+              // plus, find new origins for these lines
+              UpdateIntersectedFaces(aFInv, aFi, aFj, aLFInv, aLFImi, aLFImj,
+                                     aLFEi, aLFEj, theEdgesOrigins, aMEToInt);
+              continue;
+            }
+            //
+            if (aMFAvoid.Contains(aFi) || aMFAvoid.Contains(aFj)) {
+              continue;
+            }
+            //
+            aLFDone.Append(aFj);
+            aMDone.ChangeFind(aFj).Append(aFi);
+            //
+            IntersectFaces(aFInv, aFi, aFj, aLFInv, aLFImi, aLFImj, 
+                           aLFEi, aLFEj, theEdgesOrigins, aMECV, aMEToInt);
+          }
+        }
+        //
+        // intersect and trim edges for this chain
+        IntersectAndTrimEdges(theFToRebuild, aMFInt, aMEToInt, aDMEETrim,
+                              aME, aMECV, aMVInv, aMVRInv, aMVBounds, aEImages);
+      }
+    }
+  }
+  //
+  // filter the obtained edges
+  UpdateValidEdges(theFToRebuild, theFImages, aFLE, aMVBounds, theSolids, theInvEdges,
+                    theInvertedEdges, theEdgesToAvoid, theEdgesOrigins, theOEImages, theOEOrigins,
+                   theVertsToAvoid, theETrimEInf, aEImages, aDMEETrim, theModifiedEdges, theAsDes);
+}
+
+//=======================================================================
+//function : PrepareFacesForIntersection
+//purpose  : Preparation of the maps for analyzing intersections of the faces
+//=======================================================================
+void PrepareFacesForIntersection(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+                                 const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                                 const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
+                                 const TopTools_DataMapOfShapeShape& theArtInvFaces,
+                                 const Standard_Boolean bLookVertToAvoid,
+                                 TopTools_IndexedDataMapOfShapeListOfShape& theFLE,
+                                 TopTools_DataMapOfShapeListOfShape& theMDone,
+                                 TopTools_DataMapOfShapeListOfShape& theDMSF,
+                                 TopTools_DataMapOfShapeListOfShape& theMEInfETrim,
+                                 TopTools_DataMapOfShapeListOfShape& theDMVEFull,
+                                 TopTools_DataMapOfShapeShape& theETrimEInf,
+                                 TopTools_IndexedDataMapOfShapeListOfShape& theDMEFInv)
+{
+  Standard_Integer i, aNb = theFToRebuild.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aF = theFToRebuild.FindKey(i);
+    //
+    TopTools_ListOfShape aLE;
+    theFLE.Add(aF, aLE);
+    theMDone.Bind(aF, aLE);
+    //
+    const TopTools_ListOfShape& aLFIm = theFImages.FindFromKey(aF);
+    TopTools_ListIteratorOfListOfShape aItLF(aLFIm);
+    for (; aItLF.More(); aItLF.Next()) {
+      const TopoDS_Shape& aFIm = aItLF.Value();
+      TopExp_Explorer aExp(aFIm, TopAbs_EDGE);
+      for (; aExp.More(); aExp.Next()) {
+        const TopoDS_Shape& aE = aExp.Current();
+        // save connection to untrimmed face
+        TopTools_ListOfShape *pLF = theDMSF.ChangeSeek(aE);
+        if (!pLF) {
+          pLF = theDMSF.Bound(aE, TopTools_ListOfShape());
+        }
+        AppendToList(*pLF, aF);
+        //
+        // save connection to untrimmed edge
+        const TopoDS_Shape& aEInf = theETrimEInf.Find(aE);
+        TopTools_ListOfShape *pLETrim = theMEInfETrim.ChangeSeek(aEInf);
+        if (!pLETrim) {
+          pLETrim = theMEInfETrim.Bound(aEInf, TopTools_ListOfShape());
+        }
+        AppendToList(*pLETrim, aE);
+        //
+        TopExp_Explorer aExpV(aE, TopAbs_VERTEX);
+        for (; aExpV.More(); aExpV.Next()) {
+          const TopoDS_Shape& aV = aExpV.Current();
+          // save connection to face
+          TopTools_ListOfShape *pLFV = theDMSF.ChangeSeek(aV);
+          if (!pLFV) {
+            pLFV = theDMSF.Bound(aV, TopTools_ListOfShape());
+          }
+          AppendToList(*pLFV, aF);
+          //
+          if (bLookVertToAvoid) {
+            // save connection to edges
+            TopTools_ListOfShape *pLEV = theDMVEFull.ChangeSeek(aV);
+            if (!pLEV) {
+              pLEV = theDMVEFull.Bound(aV, TopTools_ListOfShape());
+            }
+            AppendToList(*pLEV, aE);
+          }
+        }
+      }
+    }
+    //
+    if (bLookVertToAvoid) {
+      // get edges of invalid faces (from invalid splits only)
+      const TopTools_ListOfShape *pLFInv = theInvFaces.Seek(aF);
+      if (!pLFInv || theArtInvFaces.IsBound(aF)) {
+        continue;
+      }
+      //
+      aItLF.Initialize(*pLFInv);
+      for (; aItLF.More(); aItLF.Next()) {
+        const TopoDS_Shape& aFInv = aItLF.Value();
+        TopExp_Explorer aExp(aFInv, TopAbs_EDGE);
+        for (; aExp.More(); aExp.Next()) {
+          const TopoDS_Shape& aE = aExp.Current();
+          TopTools_ListOfShape *pLF = theDMEFInv.ChangeSeek(aE);
+          if (!pLF) {
+            pLF = &theDMEFInv(theDMEFInv.Add(aE, TopTools_ListOfShape()));
+          }
+          AppendToList(*pLF, aF);
+        }
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : FindVerticesToAvoid
+//purpose  : Looking for the invalid vertices
+//=======================================================================
+void FindVerticesToAvoid(const TopTools_IndexedDataMapOfShapeListOfShape& theDMEFInv,
+                         const TopTools_IndexedMapOfShape& theInvEdges,
+                         const TopTools_IndexedMapOfShape& theValidEdges,
+                         TopTools_DataMapOfShapeListOfShape& theDMVEFull,
+                         TopTools_MapOfShape& theMVRInv)
+{
+  TopTools_MapOfShape aMFence;
+  Standard_Integer i, aNb = theDMEFInv.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopTools_ListOfShape& aLFInv = theDMEFInv(i);
+    if (aLFInv.Extent() == 1) {
+      continue;
+    }
+    //
+    const TopoDS_Shape& aE = theDMEFInv.FindKey(i);
+    if (!theInvEdges.Contains(aE) || theValidEdges.Contains(aE)) {
+      continue;
+    }
+    //
+    TopExp_Explorer aExp(aE, TopAbs_VERTEX);
+    for (; aExp.More(); aExp.Next()) {
+      const TopoDS_Shape& aV = aExp.Current();
+      TopTools_ListOfShape *pLE = theDMVEFull.ChangeSeek(aV);
+      if (!pLE) {
+        theMVRInv.Add(aV);
+        continue;
+      }
+      //
+      TopTools_ListIteratorOfListOfShape aItLE(*pLE);
+      for (; aItLE.More(); aItLE.Next()) {
+        const TopoDS_Shape& aEV = aItLE.Value();
+        if (!theInvEdges.Contains(aEV) && !theDMEFInv.Contains(aEV)) {
+          break;
+        }
+      }
+      if (!aItLE.More()) {
+        theMVRInv.Add(aV);
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : FindFacesForIntersection
+//purpose  : Looking for the faces around each invalidity for intersection
+//=======================================================================
+void FindFacesForIntersection(const TopoDS_Shape& theFInv,
+                              const TopTools_IndexedMapOfShape& theME,
+                              const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                              const TopTools_DataMapOfShapeListOfShape& theDMSF,
+                              const TopTools_MapOfShape& theMVInvAll,
+                              const TopTools_DataMapOfShapeShape& theArtInvFaces,
+                              const Standard_Boolean theArtCase,
+                              const TopTools_DataMapOfShapeListOfShape& theSSInterfs,
+                              TopTools_IndexedMapOfShape& theMFAvoid,
+                              TopTools_IndexedMapOfShape& theMFInt,
+                              TopTools_IndexedMapOfShape& theMFIntExt,
+                              TopTools_ListOfShape& theLFImInt)
+{
+  Standard_Integer i, aNbE = theME.Extent();
+  //
+  TopTools_IndexedMapOfShape aMShapes;
+  //
+  for (i = 1; i <= aNbE; ++i) {
+    const TopoDS_Shape& aS = theME(i);
+    if (!theDMSF.IsBound(aS)) {
+      continue;
+    }
+    //
+    // in artificial case we intersect the faces which are close to invalidity
+    Standard_Boolean bAvoid = theArtCase ? 
+      ((aS.ShapeType() == TopAbs_VERTEX) && !theMVInvAll.Contains(aS)) : Standard_False;
+    //
+    const TopTools_ListOfShape& aLF = theDMSF.Find(aS);
+    TopTools_ListIteratorOfListOfShape aItLF(aLF);
+    for (; aItLF.More(); aItLF.Next()) {
+      const TopoDS_Shape& aF = aItLF.Value();
+      if (theMFInt.Contains(aF)) {
+        continue;
+      }
+      //
+      if (bAvoid && theArtInvFaces.IsBound(aF)) {
+        theMFAvoid.Add(aF);
+      }
+      //
+      theMFInt.Add(aF);
+      //
+      Standard_Boolean bUse = !aF.IsSame(theFInv);
+      //
+      const TopTools_ListOfShape& aLFIm = theFImages.FindFromKey(aF);
+      TopTools_ListIteratorOfListOfShape aItLFIm(aLFIm);
+      for (; aItLFIm.More(); aItLFIm.Next()) {
+        const TopoDS_Shape& aFIm = aItLFIm.Value();
+        theLFImInt.Append(aFIm);
+        if (bUse) {
+          TopExp::MapShapes(aFIm, TopAbs_EDGE, aMShapes);
+        }
+      }
+    }
+  }
+  //
+  if (theArtCase) {
+    return;
+  }
+  //
+  const TopTools_ListOfShape* pLFInv = theSSInterfs.Seek(theFInv);
+  if (!pLFInv) {
+    return;
+  }
+  //
+  TopTools_MapOfShape aMF;
+  TopTools_ListIteratorOfListOfShape aItLF(*pLFInv);
+  for (; aItLF.More(); aItLF.Next()) {
+    const TopoDS_Shape& aF = aItLF.Value();
+    aMF.Add(aF);
+  }
+  //
+  // the faces should be unique in each place
+  TopoDS_Compound aCF;
+  BRep_Builder().MakeCompound(aCF);
+  //
+  TopTools_IndexedMapOfShape aMFToAdd;
+  TopTools_DataMapOfShapeShape aDMFOr;
+  //
+  for (i = 1; i <= aNbE; ++i) {
+    const TopoDS_Shape& aS = theME(i);
+    const TopTools_ListOfShape* pLF = theSSInterfs.Seek(aS);
+    if (!pLF) {
+      continue;
+    }
+    //
+    aItLF.Initialize(*pLF);
+    for (; aItLF.More(); aItLF.Next()) {
+      const TopoDS_Shape& aF = aItLF.Value();
+      if (theMFInt.Contains(aF) || aMFToAdd.Contains(aF) || !aMF.Contains(aF)) {
+        continue;
+      }
+      //
+      // check if the face has some connection to already added for intersection faces
+      const TopTools_ListOfShape& aLFIm = theFImages.FindFromKey(aF);
+      TopTools_ListIteratorOfListOfShape aItLFIm(aLFIm);
+      for (; aItLFIm.More(); aItLFIm.Next()) {
+        const TopoDS_Shape& aFIm = aItLFIm.Value();
+        TopExp_Explorer aExp(aFIm, TopAbs_EDGE);
+        for (; aExp.More(); aExp.Next()) {
+          if (aMShapes.Contains(aExp.Current())) {
+            break;
+          }
+        }
+        if (aExp.More()) {
+          break;
+        }
+      }
+      if (!aItLFIm.More()) {
+        continue;
+      }
+      //
+      aMFToAdd.Add(aF);
+      aItLFIm.Initialize(aLFIm);
+      for (; aItLFIm.More(); aItLFIm.Next()) {
+        const TopoDS_Shape& aFIm = aItLFIm.Value();
+        aDMFOr.Bind(aFIm, aF);
+        BRep_Builder().Add(aCF, aFIm);
+      }
+    }
+  }
+  //
+  if (aMFToAdd.IsEmpty()) {
+    return;
+  }
+  //
+  TopTools_ListOfShape aLCB;
+  BOPTools_AlgoTools::MakeConnexityBlocks(aCF, TopAbs_EDGE, TopAbs_FACE, aLCB);
+  //
+  if ((aLCB.Extent() == 1) && (aMFToAdd.Extent() > 1)) {
+    return;
+  }
+  //
+  TopTools_ListIteratorOfListOfShape aItLCB(aLCB);
+  for (; aItLCB.More(); aItLCB.Next()) {
+    const TopoDS_Shape& aCB = aItLCB.Value();
+    aMFToAdd.Clear();
+    TopExp_Explorer aExpF(aCB, TopAbs_FACE);
+    for (; aExpF.More(); aExpF.Next()) {
+      const TopoDS_Shape& aFIm = aExpF.Current();
+      aMFToAdd.Add(aDMFOr.Find(aFIm));
+    }
+    //
+    if (aMFToAdd.Extent() == 1) {
+      const TopoDS_Shape& aF = aMFToAdd(1);
+      //
+      theMFInt.Add(aF);
+      theMFIntExt.Add(aF);
+      //
+      const TopTools_ListOfShape& aLFIm = theFImages.FindFromKey(aF);
+      TopTools_ListIteratorOfListOfShape aItLFIm(aLFIm);
+      for (; aItLFIm.More(); aItLFIm.Next()) {
+        const TopoDS_Shape& aFIm = aItLFIm.Value();
+        theLFImInt.Append(aFIm);
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : ProcessCommonEdges
+//purpose  : Analyzing the common edges between splits of offset faces
+//=======================================================================
+void ProcessCommonEdges(const TopTools_ListOfShape& theLEC,
+                        const TopTools_IndexedMapOfShape& theInvEdges,
+                        const TopTools_IndexedMapOfShape& theValidEdges,
+                        const TopTools_IndexedMapOfShape& theME,
+                        const TopTools_DataMapOfShapeShape& theETrimEInf,
+                        const TopTools_DataMapOfShapeListOfShape& theMEInfETrim,
+                        const TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                        const Standard_Boolean theForceUse,
+                        TopTools_IndexedMapOfShape& theMECV,
+                        TopTools_DataMapOfShapeListOfShape& theDMEETrim,
+                        TopTools_ListOfShape& theLFEi,
+                        TopTools_ListOfShape& theLFEj,
+                        TopTools_IndexedMapOfShape& theMEToInt)
+{
+  TopTools_ListOfShape aLEC;
+  // process common edges
+  TopTools_ListIteratorOfListOfShape aItLE(theLEC);
+  for (; aItLE.More(); aItLE.Next()) {
+    const TopoDS_Shape& aEC = aItLE.Value();
+    //
+    // check first if common edges are valid
+    if (theInvEdges.Contains(aEC) && !theValidEdges.Contains(aEC)) {
+      continue;
+    }
+    //
+    // common edge should have connection to current invalidity
+    if (theME.Contains(aEC)) {
+      aLEC.Append(aEC);
+      continue;
+    }
+    //
+    TopoDS_Iterator aItV(aEC);
+    for (; aItV.More(); aItV.Next()) {
+      const TopoDS_Shape& aVE = aItV.Value();
+      if (theME.Contains(aVE)) {
+        aLEC.Append(aEC);
+        break;
+      }
+    }
+  }
+  //
+  Standard_Boolean bUseOnlyInf = (aLEC.IsEmpty() && theForceUse);
+  if (bUseOnlyInf) {
+    aLEC = theLEC;
+  }
+  //
+  aItLE.Initialize(aLEC);
+  for (; aItLE.More(); aItLE.Next()) {
+    const TopoDS_Shape& aEC = aItLE.Value();
+    //
+    const TopoDS_Shape& aEInt = theETrimEInf.Find(aEC);
+    if (!bUseOnlyInf) {
+      // find the edges of the same original edge
+      // and take their vertices as well
+      const TopTools_ListOfShape& aLVE = theMEInfETrim.Find(aEInt);
+      TopTools_ListIteratorOfListOfShape aItLVE(aLVE);
+      for (; aItLVE.More(); aItLVE.Next()) {
+        const TopoDS_Shape& aECx = aItLVE.Value();
+        //
+        const TopTools_ListOfShape* pLEOr = theOEOrigins.Seek(aECx);
+        if (!pLEOr || (pLEOr->Extent() == 1)) {
+          TopExp::MapShapes(aECx, TopAbs_VERTEX, theMECV);
+        }
+      }
+      //
+      // bind unlimited edge to its trimmed part in face to update maps of 
+      // images and origins in the future
+      TopTools_ListOfShape* pLTAdded = theDMEETrim.ChangeSeek(aEInt);
+      if (!pLTAdded) {
+        pLTAdded = theDMEETrim.Bound(aEInt, TopTools_ListOfShape());
+      }
+      AppendToList(*pLTAdded, aEC);
+    }
+    //
+    AppendToList(theLFEi, aEInt);
+    AppendToList(theLFEj, aEInt);
+    theMEToInt.Add(aEInt);
+  }
+}
+
+//=======================================================================
+//function : UpdateIntersectedFaces
+//purpose  : Updating the already interfered faces
+//=======================================================================
+void UpdateIntersectedFaces(const TopoDS_Shape& theFInv,
+                            const TopoDS_Shape& theFi,
+                            const TopoDS_Shape& theFj,
+                            const TopTools_ListOfShape& theLFInv,
+                            const TopTools_ListOfShape& theLFImi,
+                            const TopTools_ListOfShape& theLFImj,
+                            const TopTools_ListOfShape& theLFEi,
+                            const TopTools_ListOfShape& theLFEj,
+                            TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                            TopTools_IndexedMapOfShape& theMEToInt)
+{
+  // Find common edges in these two lists
+  TopTools_MapOfShape aMEi;
+  TopTools_ListIteratorOfListOfShape aItLE(theLFEi);
+  for (; aItLE.More(); aItLE.Next()) {
+    const TopoDS_Shape& aE = aItLE.Value();
+    aMEi.Add(aE);
+  }
+  //
+  // find origins
+  TopTools_IndexedMapOfShape aMEToFindOrigins;
+  TopTools_ListOfShape aLEToFindOrigins;
+  if (!theFi.IsSame(theFInv)) {
+    FindCommonParts(theLFImi, theLFInv, aLEToFindOrigins);
+  }
+  if (!theFj.IsSame(theFInv)) {
+    FindCommonParts(theLFImj, theLFInv, aLEToFindOrigins);
+  }
+  //
+  TopTools_ListOfShape aLEOrInit;
+  aItLE.Initialize(aLEToFindOrigins);
+  for (; aItLE.More(); aItLE.Next()) {
+    const TopoDS_Shape& aEC = aItLE.Value();
+    aMEToFindOrigins.Add(aEC);
+  }
+  //
+  FindOrigins(theLFImi, theLFImj, aMEToFindOrigins, theEdgesOrigins, aLEOrInit);
+  //
+  aItLE.Initialize(theLFEj);
+  for (; aItLE.More(); aItLE.Next()) {
+    const TopoDS_Shape& aE = aItLE.Value();
+    if (aMEi.Contains(aE)) {
+      theMEToInt.Add(aE);
+      if (aLEOrInit.Extent()) {
+        if (theEdgesOrigins.IsBound(aE)) {
+          TopTools_ListOfShape& aLEOr = theEdgesOrigins.ChangeFind(aE);
+          TopTools_ListIteratorOfListOfShape aItLEOr(aLEOrInit);
+          for (; aItLEOr.More(); aItLEOr.Next()) {
+            const TopoDS_Shape& aEOr = aItLEOr.Value();
+            AppendToList(aLEOr, aEOr);
+          }
+        }
+        else {
+          theEdgesOrigins.Bind(aE, aLEOrInit);
+        }
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : IntersectFaces
+//purpose  : Intersection of the pair of faces
+//=======================================================================
+void IntersectFaces(const TopoDS_Shape& theFInv,
+                    const TopoDS_Shape& theFi,
+                    const TopoDS_Shape& theFj,
+                    const TopTools_ListOfShape& theLFInv,
+                    const TopTools_ListOfShape& theLFImi,
+                    const TopTools_ListOfShape& theLFImj,
+                    TopTools_ListOfShape& theLFEi,
+                    TopTools_ListOfShape& theLFEj,
+                    TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                    TopTools_IndexedMapOfShape& theMECV,
+                    TopTools_IndexedMapOfShape& theMEToInt)
+{
+  // intersect faces
+  TopAbs_State aSide = TopAbs_OUT;
+  TopTools_ListOfShape aLInt1, aLInt2;
+  TopoDS_Edge aNullEdge;
+  BRepOffset_Tool::Inter3D(TopoDS::Face(theFi), TopoDS::Face(theFj), aLInt1, aLInt2, aSide, aNullEdge);
+  //
+  if (aLInt1.IsEmpty()) {
+    return;
+  }
+  //
+  // find common vertices for trimming edges
+  TopTools_ListOfShape aLCV;
+  TopTools_ListIteratorOfListOfShape aItLE;
+  FindCommonParts(theLFImi, theLFImj, aLCV, TopAbs_VERTEX);
+  if (aLCV.Extent() > 1) {
+    aItLE.Initialize(aLCV);
+    for (; aItLE.More(); aItLE.Next()) {
+      const TopoDS_Shape& aCV = aItLE.Value();
+      theMECV.Add(aCV);
+    }
+  }
+  //
+  // find origins
+  TopTools_IndexedMapOfShape aMEToFindOrigins;
+  TopTools_ListOfShape aLEToFindOrigins;
+  if (!theFi.IsSame(theFInv)) {
+    FindCommonParts(theLFImi, theLFInv, aLEToFindOrigins);
+  }
+  if (!theFj.IsSame(theFInv)) {
+    FindCommonParts(theLFImj, theLFInv, aLEToFindOrigins);
+  }
+  TopTools_ListOfShape aLEOrInit;
+  aItLE.Initialize(aLEToFindOrigins);
+  for (; aItLE.More(); aItLE.Next()) {
+    const TopoDS_Shape& aEC = aItLE.Value();
+    aMEToFindOrigins.Add(aEC);
+  }
+  //
+  FindOrigins(theLFImi, theLFImj, aMEToFindOrigins, theEdgesOrigins, aLEOrInit);
+  //
+  aItLE.Initialize(aLInt1);
+  for (; aItLE.More(); aItLE.Next()) {
+    const TopoDS_Shape& aEInt = aItLE.Value();
+    theLFEi.Append(aEInt);
+    theLFEj.Append(aEInt);
+    //
+    if (aLEOrInit.Extent()) {
+      theEdgesOrigins.Bind(aEInt, aLEOrInit);
+    }
+    //
+    theMEToInt.Add(aEInt);
+  }
+}
+
+//=======================================================================
+//function : FindOrigins
+//purpose  : Looking for the origin edges
+//=======================================================================
+void FindOrigins(const TopTools_ListOfShape& theLFIm1,
+                 const TopTools_ListOfShape& theLFIm2,
+                 const TopTools_IndexedMapOfShape& theME,
+                 const TopTools_DataMapOfShapeListOfShape& theOrigins,
+                 TopTools_ListOfShape& theLEOr)
+{
+  Standard_Integer i;
+  TopTools_MapOfShape aMFence;
+  TopExp_Explorer aExp;
+  TopTools_ListIteratorOfListOfShape aIt, aItLE;
+  //
+  for (i = 0; i < 2; ++i) {
+    const TopTools_ListOfShape& aLF = !i ? theLFIm1 : theLFIm2;
+    aIt.Initialize(aLF);
+    for (; aIt.More(); aIt.Next()) {
+      const TopoDS_Shape& aF = aIt.Value();
+      //
+      aExp.Init(aF, TopAbs_EDGE);
+      for (; aExp.More(); aExp.Next()) {
+        const TopoDS_Shape& aE = aExp.Current();
+        //
+        if (theME.Contains(aE) && theOrigins.IsBound(aE)) {
+          const TopTools_ListOfShape& aLEOr = theOrigins.Find(aE);
+          aItLE.Initialize(aLEOr);
+          for (; aItLE.More(); aItLE.Next()) {
+            const TopoDS_Shape& aEOr = aItLE.Value();
+            //
+            if (aMFence.Add(aEOr) && (aEOr.ShapeType() == TopAbs_EDGE)) {
+              theLEOr.Append(aEOr);
+            }
+          } // for (; aItLE.More(); aItLE.Next()) {
+        } // if (theME.Contains(aE) && theOrigins.IsBound(aE)) {
+      } // aExp.Init(aF, TopAbs_EDGE);
+    } // for (; aIt.More(); aIt.Next()) {
+  } // for (i = 0; i < 2; ++i) {
+}
+
+//=======================================================================
+//function : IntersectAndTrimEdges
+//purpose  : Intersection of the new intersection edges among themselves
+//=======================================================================
+void IntersectAndTrimEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+                           const TopTools_IndexedMapOfShape& theMFInt,
+                           const TopTools_IndexedMapOfShape& theMEInt,
+                           const TopTools_DataMapOfShapeListOfShape& theDMEETrim,
+                           const TopTools_IndexedMapOfShape& theMSInv,
+                           const TopTools_IndexedMapOfShape& theMVE,
+                           const TopTools_MapOfShape& theVertsToAvoid,
+                           const TopTools_MapOfShape& theNewVertsToAvoid,
+                           TopTools_MapOfShape& theMVBounds,
+                           TopTools_DataMapOfShapeListOfShape& theEImages)
+{
+  Standard_Integer i, aNb = theMEInt.Extent();
+  if (!aNb) {
+    return;
+  }
+  //
+  BOPCol_ListOfShape aLArgs;
+  TopTools_MapOfShape aMFence;
+  TopTools_ListIteratorOfListOfShape aIt, aIt1;
+  TopExp_Explorer aExp;
+  //
+  // get vertices from the splits of intersected faces.
+  // vertices are taken from the edges close to invalidity
+  //
+  TopTools_IndexedDataMapOfShapeListOfShape aDMVE;
+  aNb = theMFInt.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aF = theMFInt(i);
+    const TopTools_ListOfShape& aLE = theFToRebuild.FindFromKey(aF);
+    //
+    aIt.Initialize(aLE);
+    for (; aIt.More(); aIt.Next()) {
+      const TopoDS_Shape& aE = aIt.Value();
+      TopExp::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aDMVE);
+      //
+      aExp.Init(aE, TopAbs_VERTEX);
+      for (; aExp.More(); aExp.Next()) {
+        const TopoDS_Shape& aV1 = aExp.Current();
+        if (!theVertsToAvoid.Contains(aV1) && theMVE.Contains(aV1) && aMFence.Add(aV1)) {
+          aLArgs.Append(aV1);
+        }
+      }
+    }
+  }
+  //
+  aNb = theMSInv.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aV = theMSInv(i);
+    if (aV.ShapeType() != TopAbs_VERTEX) {
+      continue;
+    }
+    //
+    TopTools_ListOfShape *pLVE = aDMVE.ChangeSeek(aV);
+    if (!pLVE) {
+      continue;
+    }
+    //
+    aIt.Initialize(*pLVE);
+    for (; aIt.More(); aIt.Next()) {
+      const TopoDS_Shape& aE = aIt.Value();
+      //
+      aExp.Init(aE, TopAbs_VERTEX);
+      for (; aExp.More(); aExp.Next()) {
+        const TopoDS_Shape& aV1 = aExp.Current();
+        if (!theVertsToAvoid.Contains(aV1) && aMFence.Add(aV1)) {
+          aLArgs.Append(aV1);
+        }
+      }
+    }
+  }
+  //
+  // bounding vertices of untrimmed edges
+  TopTools_ListOfShape aLVBounds;
+  // new intersection edges
+  TopTools_ListOfShape aLENew;
+  // get edges to intersect
+  TopTools_ListOfShape aLEInt;
+  aNb = theMEInt.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aE = theMEInt(i);
+    if (!aMFence.Add(aE)) {
+      continue;
+    }
+    //
+    if (!theDMEETrim.IsBound(aE)) {
+      aLENew.Append(aE);
+    }
+    //
+    aLEInt.Append(aE);
+    aLArgs.Append(aE);
+    //
+    aExp.Init(aE, TopAbs_VERTEX);
+    for (; aExp.More(); aExp.Next()) {
+      const TopoDS_Shape& aV = aExp.Current();
+      aLVBounds.Append(aV);
+    }
+  }
+  //
+  // Intersect Edges
+  BOPAlgo_Builder aGF;
+  aGF.SetArguments(aLArgs);
+  aGF.Perform();
+  if (aGF.ErrorStatus()) {
+    return;
+  }
+  //
+  // update vertices to avoid with SD vertices
+  aIt.Initialize(aLVBounds);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aV = aIt.Value();
+    const TopTools_ListOfShape& aLVIm = aGF.Modified(aV);
+    if (aLVIm.IsEmpty()) {
+      theMVBounds.Add(aV);
+    }
+    else {
+      const TopoDS_Shape& aVIm = aLVIm.First();
+      theMVBounds.Add(aVIm);
+    }
+  }
+  //
+  // find invalid splits of edges
+  TopTools_MapOfShape aMEInv;
+  GetInvalidEdges(theNewVertsToAvoid, theMVBounds, aGF, aMEInv);
+  //
+  // remove the splits containing vertices from invalid edges
+  aIt.Initialize(aLEInt);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aE = aIt.Value();
+    //
+    TopTools_ListOfShape aLEIm = aGF.Modified(aE);
+    if (aLEIm.IsEmpty()) {
+      continue;
+    }
+    //
+    aIt1.Initialize(aLEIm);
+    for (; aIt1.More(); ) {
+      const TopoDS_Shape& aEIm = aIt1.Value();
+      //
+      if (aMEInv.Contains(aEIm)) {
+        aLEIm.Remove(aIt1);
+      }
+      else {
+        aIt1.Next();
+      }
+    }
+    //
+    if (aLEIm.Extent()) {
+      if (theEImages.IsBound(aE)) {
+        theEImages.ChangeFind(aE).Append(aLEIm);
+      }
+      else {
+        theEImages.Bind(aE, aLEIm);
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : GetInvalidEdges
+//purpose  : Looking for the invalid edges by intersecting with invalid vertices
+//=======================================================================
+void GetInvalidEdges(const TopTools_MapOfShape& theVertsToAvoid,
+                     const TopTools_MapOfShape& theMVBounds,
+                     BOPAlgo_Builder& theGF,
+                     TopTools_MapOfShape& theMEInv)
+{
+  if (theVertsToAvoid.IsEmpty()) {
+    return;
+  }
+  //
+  TopTools_ListIteratorOfListOfShape aIt, aIt1;
+  // get vertices created with intersection edges
+  const TopoDS_Shape& aRes = theGF.Shape();
+  TopTools_IndexedDataMapOfShapeListOfShape aDMVE;
+  TopExp::MapShapesAndAncestors(aRes, TopAbs_VERTEX, TopAbs_EDGE, aDMVE);
+  //
+  const BOPDS_PDS& pDS = theGF.PDS();
+  //
+  // find invalid splits of edges
+  // check if the vertex is invalid:
+  // a. it may be the vertex SD with the vertices to avoid
+  // b. or it may be the vertex which is created by the intersection 
+  //    of only existing edges, i.e. no new intersection edges goes
+  //    through this vertex
+  //
+  TopTools_MapOfShape aMVInv;
+  Standard_Integer i, aNb = aDMVE.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Vertex& aV = TopoDS::Vertex(aDMVE.FindKey(i));
+    if (theMVBounds.Contains(aV)) {
+      continue;
+    }
+    //
+    Standard_Integer nV = pDS->Index(aV);
+    if ((nV >= 0) && !pDS->IsNewShape(nV)) {
+      continue;
+    }
+    //
+    TopTools_MapIteratorOfMapOfShape aItM(theVertsToAvoid);
+    for (; aItM.More(); aItM.Next()) {
+      const TopoDS_Vertex& aVInv = *(TopoDS_Vertex*)&aItM.Value();
+      Standard_Integer iFlag = BOPTools_AlgoTools::ComputeVV(aV, aVInv);
+      if (!iFlag) {
+        aMVInv.Add(aV);
+        break;
+      }
+    }
+    //
+    if (aItM.More()) {
+      const TopTools_ListOfShape& aLVE = aDMVE.FindFromKey(aV);
+      aIt.Initialize(aLVE);
+      for (; aIt.More(); aIt.Next()) {
+        const TopoDS_Shape& aE = aIt.Value();
+        theMEInv.Add(aE);
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : UpdateValidEdges
+//purpose  : Making the new splits and updating the maps
+//=======================================================================
+void UpdateValidEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+                      const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                      const TopTools_IndexedDataMapOfShapeListOfShape& theFLE,
+                      const TopTools_MapOfShape& theMVBounds,
+                      const TopoDS_Shape& theSolids,
+                      const TopTools_IndexedMapOfShape& theInvEdges,
+                      const TopTools_MapOfShape& theInvertedEdges,
+                      TopTools_IndexedMapOfShape& theEdgesToAvoid,
+                      TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                      TopTools_DataMapOfShapeListOfShape& theOEImages,
+                      TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                      TopTools_MapOfShape& theVertsToAvoid,
+                      TopTools_DataMapOfShapeShape& theETrimEInf,
+                      TopTools_DataMapOfShapeListOfShape& theEImages,
+                      TopTools_DataMapOfShapeListOfShape& theEETrim,
+                      TopTools_MapOfShape& theModifiedEdges,
+                      Handle(BRepAlgo_AsDes)& theAsDes)
+{
+  // update images and origins of edges, plus update AsDes
+  //
+  // new edges
+  TopTools_ListOfShape aLE;
+  // back connection from edges to faces
+  TopTools_DataMapOfShapeListOfShape aMELF;
+  //
+  Standard_Integer i, aNb = theFLE.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Face& aF = TopoDS::Face(theFLE.FindKey(i));
+    //
+    const TopTools_ListOfShape& aLEInt = theFLE(i);
+    TopTools_ListIteratorOfListOfShape aItLE(aLEInt);
+    for (; aItLE.More(); aItLE.Next()) {
+      const TopoDS_Shape& aE = aItLE.Value();
+      TopTools_ListOfShape* pLF = aMELF.ChangeSeek(aE);
+      if (!pLF) {
+        pLF = aMELF.Bound(aE, TopTools_ListOfShape());
+        aLE.Append(aE);
+      }
+      pLF->Append(aF);
+    }
+  }
+  //
+  if (aLE.IsEmpty()) {
+    return;
+  }
+  //
+  // bounding edges, that are going to be replaced
+  TopTools_MapOfShape aMEB;
+  //
+  // new intersection edges
+  TopTools_ListOfShape aLENew;
+  TopTools_MapOfShape aMENew;
+  // map of old vertices
+  TopTools_MapOfShape aMVOld;
+  // back connection to untrimmed edges
+  TopTools_DataMapOfShapeListOfShape aDMEOr;
+  //
+  // trim the new intersection edges
+  BOPCol_ListOfShape aLA;
+  TrimNewIntersectionEdges(aLE, theEETrim, theMVBounds, theEImages, aMEB, aMVOld, aLENew, aLA, aDMEOr);
+  //
+  if (aLA.IsEmpty()) {
+    // update intersection edges
+    UpdateNewIntersectionEdges(aLE, aMELF, theEImages, theInvEdges, theInvertedEdges, theEdgesOrigins,
+      theOEImages, theOEOrigins, theETrimEInf, theEETrim, theModifiedEdges, theAsDes);
+    return;
+  }
+  //
+  TopoDS_Shape aSplits1;
+  if (aLA.Extent() > 1) {
+    // intersect the new splits among themselves to avoid self-intersections
+    IntersectEdges(aLA, aLE, aLENew, theMVBounds, theVertsToAvoid, theEImages,
+                   theModifiedEdges, aDMEOr, aMENew, aSplits1);
+  }
+  else {
+    aSplits1 = aLA.First();
+  }
+  //
+  // filter the new splits with bounds
+  TopoDS_Shape aFilterBounds;
+  GetBounds(theFImages, aMEB, aFilterBounds);
+  //
+  // intersect splits and bounds and remove those splits which have pure E/E intersection
+  TopTools_MapOfShape aMEInv;
+  GetInvalidEdgesByBounds(aSplits1, aFilterBounds, theFToRebuild, theFImages, theSolids,
+    theInvEdges, aMVOld, aMENew, aDMEOr, theEImages, theVertsToAvoid, aMEInv);
+  //
+  // get valid edges only
+  TopoDS_Shape aSplits;
+  if (aMEInv.Extent()) {
+    // clear images from found invalid edges
+    TopoDS_Compound aSp;
+    BRep_Builder().MakeCompound(aSp);
+    TopTools_MapOfShape aMFence;
+    //
+    TopTools_ListIteratorOfListOfShape aItLE(aLE);
+    for (; aItLE.More(); aItLE.Next()) {
+      const TopoDS_Shape& aE = aItLE.Value();
+      //
+      TopTools_ListOfShape* pLEIm = theEImages.ChangeSeek(aE);
+      if (!pLEIm) {
+        continue;
+      }
+      //
+      TopTools_ListIteratorOfListOfShape aItLEIm(*pLEIm);
+      for (; aItLEIm.More();) {
+        const TopoDS_Shape& aEIm = aItLEIm.Value();
+        if (aMEInv.Contains(aEIm)) {
+          pLEIm->Remove(aItLEIm);
+        }
+        else {
+          if (aMFence.Add(aEIm)) {
+            BRep_Builder().Add(aSp, aEIm);
+          }
+          aItLEIm.Next();
+        }
+      }
+      //
+      if (pLEIm->IsEmpty()) {
+        theEImages.UnBind(aE);
+      }
+    }
+    aSplits = aSp;
+  }
+  else {
+    aSplits = aSplits1;
+  }
+  //
+  // get bounds to update
+  // we need to update the edges of all the affected faces
+  TopTools_ListOfShape aLF;
+  // prepare the vertices from new splits of edges
+  TopTools_IndexedMapOfShape aMVSp;
+  TopExp::MapShapes(aSplits, TopAbs_VERTEX, aMVSp);
+  //
+  Standard_Integer aNbF = theFImages.Extent();
+  for (i = 1; i <= aNbF; ++i) {
+    const TopoDS_Shape& aF = theFImages.FindKey(i);
+    if (theFLE.Contains(aF)) {
+      aLF.Append(aF);
+      continue;
+    }
+    //
+    // check the splits of faces to have vertices from splits
+    const TopTools_ListOfShape& aLFIm = theFImages(i);
+    TopTools_ListIteratorOfListOfShape aItLFIm(aLFIm);
+    for (; aItLFIm.More(); aItLFIm.Next()) {
+      const TopoDS_Shape& aFIm = aItLFIm.Value();
+      //
+      TopExp_Explorer aExpV(aFIm, TopAbs_VERTEX);
+      for (; aExpV.More(); aExpV.Next()) {
+        const TopoDS_Shape& aV = aExpV.Current();
+        if (aMVSp.Contains(aV)) {
+          break;
+        }
+      }
+      //
+      if (aExpV.More()) {
+        break;
+      }
+    }
+    //
+    if (aItLFIm.More()) {
+      aLF.Append(aF);
+    }
+  }
+  //
+  // get bounds from splits of faces of aLF
+  TopoDS_Shape aBounds;
+  TopTools_ListOfShape aLAValid, aLABounds;
+  GetBoundsToUpdate(aLF, theOEImages, theOEOrigins, aMEB,
+                    aLABounds, aLAValid, aBounds, theAsDes);
+  //
+  // intersect valid splits with bounds and update both
+  BOPAlgo_Builder aGF;
+  aGF.AddArgument(aSplits);
+  aGF.AddArgument(aBounds);
+  aGF.Perform();
+  //
+  // update splits
+  UpdateImages(aLE, theEImages, aGF, theModifiedEdges);
+  //
+  // update new intersection edges
+  UpdateNewIntersectionEdges(aLE, aMELF, theEImages, theInvEdges, theInvertedEdges, theEdgesOrigins,
+    theOEImages, theOEOrigins, theETrimEInf, theEETrim, theModifiedEdges, theAsDes);
+  //
+  // update bounds
+  UpdateImages(aLAValid, theOEImages, aGF, theModifiedEdges);
+  UpdateOrigins(aLABounds, theOEOrigins, aGF);
+  UpdateOrigins(aLABounds, theEdgesOrigins, aGF);
+  UpdateIntersectedEdges(aLABounds, theETrimEInf, aGF);
+  //
+  // update the edges to avoid with the splits
+  TopTools_IndexedMapOfShape aNewEdges;
+  const TopTools_ListOfShape* pSplitsIm = aGF.Images().Seek(aSplits);
+  if (pSplitsIm) {
+    TopTools_ListIteratorOfListOfShape aItSpIm(*pSplitsIm);
+    for (; aItSpIm.More(); aItSpIm.Next()) {
+      TopExp::MapShapes(aItSpIm.Value(), TopAbs_EDGE, aNewEdges);
+    }
+  }
+  //
+  Standard_Integer aNbE = theEdgesToAvoid.Extent();
+  for (i = 1; i <= aNbE; ++i) {
+    const TopoDS_Shape& aE = theEdgesToAvoid(i);
+    const TopTools_ListOfShape& aLEIm = aGF.Modified(aE);
+    TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm);
+    for (; aItLEIm.More(); aItLEIm.Next()) {
+      const TopoDS_Shape& aEIm = aItLEIm.Value();
+      if (!aNewEdges.Contains(aEIm)) {
+        theEdgesToAvoid.Add(aItLEIm.Value());
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : TrimNewIntersectionEdges
+//purpose  : 
+//=======================================================================
+void TrimNewIntersectionEdges(const TopTools_ListOfShape& theLE,
+                              const TopTools_DataMapOfShapeListOfShape& theEETrim,
+                              const TopTools_MapOfShape& theMVBounds,
+                              TopTools_DataMapOfShapeListOfShape& theEImages,
+                              TopTools_MapOfShape& theMEB,
+                              TopTools_MapOfShape& theMVOld,
+                              TopTools_ListOfShape& theLENew,
+                              BOPCol_ListOfShape& theLA,
+                              TopTools_DataMapOfShapeListOfShape& theDMEOr)
+{
+  TopTools_ListIteratorOfListOfShape aIt, aIt1;
+  aIt.Initialize(theLE);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aE = aIt.Value();
+    //
+    if (theEETrim.IsBound(aE)) {
+      const TopTools_ListOfShape& aLET = theEETrim.Find(aE);
+      aIt1.Initialize(aLET);
+      for (; aIt1.More(); aIt1.Next()) {
+        const TopoDS_Shape& aET = aIt1.Value();
+        theMEB.Add(aET);
+        TopExp_Explorer aExpV(aET, TopAbs_VERTEX);
+        for (; aExpV.More(); aExpV.Next()) {
+          const TopoDS_Shape& aV = aExpV.Current();
+          theMVOld.Add(aV);
+        }
+      }
+    }
+    //
+    if (!theEImages.IsBound(aE)) {
+      continue;
+    }
+    //
+    TopTools_ListOfShape& aLEIm = theEImages.ChangeFind(aE);
+    if (aLEIm.IsEmpty()) {
+      theEImages.UnBind(aE);
+      continue;
+    }
+    //
+    TopoDS_Shape aCEIm;
+    TopTools_MapOfShape aMEVBounds;
+    //
+    if (aLEIm.Extent() > 2) {
+      TopTools_IndexedMapOfShape aMV;
+      // fuse these parts
+      BOPAlgo_Builder aGFE;
+      TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm);
+      for (; aItLEIm.More(); aItLEIm.Next()) {
+        const TopoDS_Shape& aEIm = aItLEIm.Value();
+        aGFE.AddArgument(aEIm);
+        TopExp::MapShapes(aEIm, TopAbs_VERTEX, aMV);
+      }
+      //
+      // add two bounding vertices of this edge to the operation
+      TopoDS_Vertex aV1, aV2;
+      TopExp::Vertices(TopoDS::Edge(aE), aV1, aV2);
+      //
+      aGFE.AddArgument(aV1);
+      aGFE.AddArgument(aV2);
+      aMV.Add(aV1);
+      aMV.Add(aV2);
+      //
+      aGFE.Perform();
+      if (!aGFE.ErrorStatus()) {
+        // get images of bounding vertices to remove splits containing them
+        // in case some of the bounding edges has been interfered
+        // during operation it is necessary to update their images as well
+        Standard_Integer iV, aNbV = aMV.Extent();
+        for (iV = 1; iV <= aNbV; ++iV) {
+          const TopoDS_Shape& aV = aMV(iV);
+          if (theMVBounds.Contains(aV) || aV.IsSame(aV1) || aV.IsSame(aV2)) {
+            const TopTools_ListOfShape& aLVIm = aGFE.Modified(aV);
+            if (aLVIm.Extent()) {
+              aMEVBounds.Add(aLVIm.First());
+            }
+            else {
+              aMEVBounds.Add(aV);
+            }
+          }
+        }
+        //
+        aCEIm = aGFE.Shape();
+      }
+    }
+    else {
+      aCEIm = aLEIm.First();
+    }
+    //
+    aLEIm.Clear();
+    //
+    TopExp_Explorer aExp(aCEIm, TopAbs_EDGE);
+    for (; aExp.More(); aExp.Next()) {
+      const TopoDS_Shape& aEIm = aExp.Current();
+      //
+      // check the split not to contain bounding vertices
+      TopoDS_Iterator aItV(aEIm);
+      for (; aItV.More(); aItV.Next()) {
+        const TopoDS_Shape& aV = aItV.Value();
+        if (aMEVBounds.Contains(aV) || theMVBounds.Contains(aV)) {
+          break;
+        }
+      }
+      //
+      if (!aItV.More()) {
+        theLA.Append(aEIm);
+        aLEIm.Append(aEIm);
+        //
+        theDMEOr.Bound(aEIm, TopTools_ListOfShape())->Append(aE);
+      }
+    }
+    //
+    if (aLEIm.IsEmpty()) {
+      theEImages.UnBind(aE);
+    }
+    else {
+      if (!theEETrim.IsBound(aE)) {
+        TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm);
+        for (; aItLEIm.More(); aItLEIm.Next()) {
+          const TopoDS_Shape& aEIm = aItLEIm.Value();
+          theLENew.Append(aEIm);
+        }
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : IntersectEdges
+//purpose  : Intersecting the trimmed edges to avoid self-intersections
+//=======================================================================
+void IntersectEdges(const BOPCol_ListOfShape& theLA,
+                    const TopTools_ListOfShape& theLE,
+                    const TopTools_ListOfShape& theLENew,
+                    const TopTools_MapOfShape& theMVBounds,
+                    const TopTools_MapOfShape& theVertsToAvoid,
+                    TopTools_DataMapOfShapeListOfShape& theEImages,
+                    TopTools_MapOfShape& theModifiedEdges,
+                    TopTools_DataMapOfShapeListOfShape& theDMEOr,
+                    TopTools_MapOfShape& theMENew,
+                    TopoDS_Shape& theSplits)
+{
+  BOPAlgo_Builder aGFA;
+  aGFA.SetArguments(theLA);
+  aGFA.Perform();
+  if (aGFA.ErrorStatus()) {
+    // just copy input to the result
+    TopoDS_Compound aSp;
+    BRep_Builder aBB;
+    aBB.MakeCompound(aSp);
+    BOPCol_ListIteratorOfListOfShape anIt(theLA);
+    for (; anIt.More(); anIt.Next()) {
+      const TopoDS_Shape& aE = anIt.Value();
+      aBB.Add(aSp, aE);
+    }
+    theSplits = aSp;
+    return;
+  }
+  //
+  UpdateImages(theLE, theEImages, aGFA, theModifiedEdges);
+  //
+  // compound of valid splits
+  theSplits = aGFA.Shape();
+  //
+  // update new edges
+  TopTools_ListIteratorOfListOfShape aIt, aIt1;
+  aIt.Initialize(theLENew);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aE = aIt.Value();
+    const TopTools_ListOfShape& aLEIm = aGFA.Modified(aE);
+    if (aLEIm.Extent()) {
+      aIt1.Initialize(aLEIm);
+      for (; aIt1.More(); aIt1.Next()) {
+        const TopoDS_Shape& aEIm = aIt1.Value();
+        theMENew.Add(aEIm);
+      }
+    }
+    else {
+      theMENew.Add(aE);
+    }
+  }
+  //
+  TopTools_MapOfShape aMEInv;
+  GetInvalidEdges(theVertsToAvoid, theMVBounds, aGFA, aMEInv);
+  if (aMEInv.Extent()) {
+    // update shape
+    TopoDS_Compound aSp;
+    BRep_Builder aBB;
+    aBB.MakeCompound(aSp);
+    TopExp_Explorer aExp(theSplits, TopAbs_EDGE);
+    for (; aExp.More(); aExp.Next()) {
+      const TopoDS_Shape& aE = aExp.Current();
+      if (!aMEInv.Contains(aE)) {
+        aBB.Add(aSp, aE);
+      }
+    }
+    theSplits = aSp;
+  }
+  //
+  UpdateOrigins(theLA, theDMEOr, aGFA);
+}
+
+//=======================================================================
+//function : GetBounds
+//purpose  : Getting edges from the splits of offset faces
+//=======================================================================
+void GetBounds(const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+               const TopTools_MapOfShape& theMEB,
+               TopoDS_Shape& theBounds)
+{
+  // make compound of edges contained in the splits of faces
+  TopoDS_Compound aBounds;
+  BRep_Builder aBB;
+  aBB.MakeCompound(aBounds);
+  //
+  TopTools_MapOfShape aMFence;
+  //
+  Standard_Integer i, aNb = theFImages.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopTools_ListOfShape& aLFIm = theFImages(i);
+    TopTools_ListIteratorOfListOfShape aIt(aLFIm);
+    for (; aIt.More(); aIt.Next()) {
+      const TopoDS_Shape& aFIm = aIt.Value();
+      //
+      TopExp_Explorer aExpE(aFIm, TopAbs_EDGE);
+      for (; aExpE.More(); aExpE.Next()) {
+        const TopoDS_Shape& aEIm = aExpE.Current();
+        if (!theMEB.Contains(aEIm) && aMFence.Add(aEIm)) {
+          aBB.Add(aBounds, aEIm);
+        }
+      }
+    }
+  }
+  theBounds = aBounds;
+}
+
+//=======================================================================
+//function : GetBoundsToUpdate
+//purpose  : Get bounding edges that should be updated
+//=======================================================================
+void GetBoundsToUpdate(const TopTools_ListOfShape& theLF,
+                       const TopTools_DataMapOfShapeListOfShape& theOEImages,
+                       const TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                       const TopTools_MapOfShape& theMEB,
+                       TopTools_ListOfShape& theLABounds,
+                       TopTools_ListOfShape& theLAValid,
+                       TopoDS_Shape& theBounds,
+                       Handle(BRepAlgo_AsDes)& theAsDes)
+{
+  // get all edges
+  TopoDS_Compound aBounds;
+  BRep_Builder aBB;
+  aBB.MakeCompound(aBounds);
+  //
+  TopTools_MapOfShape aMAValid, aMFence;
+  //
+  TopTools_ListIteratorOfListOfShape aItLF(theLF);
+  for (; aItLF.More(); aItLF.Next()) {
+    const TopoDS_Shape& aF = aItLF.Value();
+    //
+    TopTools_IndexedMapOfShape aMDE;
+    const TopTools_ListOfShape& aLFDes = theAsDes->Descendant(aF);
+    TopTools_ListIteratorOfListOfShape aItLFDes(aLFDes);
+    for (; aItLFDes.More(); aItLFDes.Next()) {
+      const TopoDS_Shape& aED = aItLFDes.Value();
+      const TopTools_ListOfShape *pLEDIm = theOEImages.Seek(aED);
+      if (!pLEDIm) {
+        aMDE.Add(aED);
+        continue;
+      }
+      //
+      TopTools_ListIteratorOfListOfShape aItLEDIm(*pLEDIm);
+      for (; aItLEDIm.More(); aItLEDIm.Next()) {
+        const TopoDS_Shape& aEDIm = aItLEDIm.Value();
+        aMDE.Add(aEDIm);
+      }
+    }
+    //
+    Standard_Integer j, aNbE = aMDE.Extent();
+    for (j = 1; j <= aNbE; ++j) {
+      const TopoDS_Edge& aEIm = TopoDS::Edge(aMDE(j));
+      //
+      if (!theMEB.Contains(aEIm) && aMFence.Add(aEIm)) {
+        aBB.Add(aBounds, aEIm);
+        theLABounds.Append(aEIm);
+      }
+      //
+      const TopTools_ListOfShape *pLO = theOEOrigins.Seek(aEIm);
+      if (pLO) {
+        TopTools_ListIteratorOfListOfShape aItLO(*pLO);
+        for (; aItLO.More(); aItLO.Next()) {
+          const TopoDS_Shape& aEO = aItLO.Value();
+          //
+          if (aMAValid.Add(aEO)) {
+            theLAValid.Append(aEO);
+          }
+        }
+      }
+      else {
+        if (aMAValid.Add(aEIm)) {
+          theLAValid.Append(aEIm);
+        }
+      }
+    }
+  }
+  theBounds = aBounds;
+}
+
+//=======================================================================
+//function : GetInvalidEdgesByBounds
+//purpose  : Filter new splits by intersection with bounds
+//=======================================================================
+void GetInvalidEdgesByBounds(const TopoDS_Shape& theSplits,
+                             const TopoDS_Shape& theBounds,
+                             const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+                             const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                             const TopoDS_Shape& theSolids,
+                             const TopTools_IndexedMapOfShape& theInvEdges,
+                             const TopTools_MapOfShape& theMVOld,
+                             const TopTools_MapOfShape& theMENew,
+                             const TopTools_DataMapOfShapeListOfShape& theDMEOr,
+                             const TopTools_DataMapOfShapeListOfShape& theEImages,
+                             TopTools_MapOfShape& theVertsToAvoid,
+                             TopTools_MapOfShape& theMEInv)
+{
+  BOPAlgo_Section aSec;
+  aSec.AddArgument(theSplits);
+  aSec.AddArgument(theBounds);
+  //
+  aSec.Perform();
+  //
+  // invalid vertices
+  TopTools_IndexedMapOfShape aMVInv;
+  // vertices to check additionally by classification relatively to solid
+  TopTools_MapOfShape aMVCheckAdd;
+  // collect parts for removal
+  const BOPDS_PDS& pDS = aSec.PDS();
+  //
+  // check edge/edge intersections
+  const BOPDS_VectorOfInterfEE& aEEs = pDS->InterfEE();
+  Standard_Integer i, aNb = aEEs.Extent();
+  for (i = 0; i < aNb; ++i) {
+    const BOPDS_InterfEE& aEE = aEEs(i);
+    if (!aEE.HasIndexNew()) {
+      continue;
+    }
+    //
+    const TopoDS_Shape& aE1 = pDS->Shape(aEE.Index1());
+    const TopoDS_Shape& aE2 = pDS->Shape(aEE.Index2());
+    //
+    if (theInvEdges.Contains(aE2)) {
+      theMEInv.Add(aE1);
+    }
+    //
+    // add vertices of all images of this edges for checking
+    const TopTools_ListOfShape& aLEOr = theDMEOr.Find(aE1);
+    TopTools_ListIteratorOfListOfShape aItLEOr(aLEOr);
+    for (; aItLEOr.More(); aItLEOr.Next()) {
+      const TopoDS_Shape& aEOr = aItLEOr.Value();
+      //
+      const TopTools_ListOfShape& aLEIm = theEImages.Find(aEOr);
+      TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm);
+      for (; aItLEIm.More(); aItLEIm.Next()) {
+        const TopoDS_Shape& aEIm = aItLEIm.Value();
+        //
+        TopoDS_Iterator aItV(aEIm);
+        for (; aItV.More(); aItV.Next()) {
+          const TopoDS_Shape& aV = aItV.Value();
+          if (!theMVOld.Contains(aV)) {
+            aMVInv.Add(aV);
+            aMVCheckAdd.Add(aV);
+          }
+        }
+      }
+    }
+  }
+  //
+  // map to check the vertices of edges
+  TopTools_IndexedDataMapOfShapeListOfShape aDMVE;
+  TopExp::MapShapesAndAncestors(theSplits, TopAbs_VERTEX, TopAbs_EDGE, aDMVE);
+  //
+  // to avoid unnecessary filling of parts due to extra trim of the edges
+  // process Edge/Edge interferences of type EDGE, i.e. common blocks.
+  //
+  // all common blocks are contained in the result of SECTION operation
+  // between sets of edges
+  const TopoDS_Shape& aSecR = aSec.Shape();
+  //
+  TopTools_IndexedMapOfShape aMSSec;
+  TopExp::MapShapes(aSecR, aMSSec);
+  //
+  const BOPCol_DataMapOfShapeListOfShape& anIm = aSec.Images();
+  TopExp_Explorer aExp(theSplits, TopAbs_EDGE);
+  for (; aExp.More(); aExp.Next()) {
+    const TopoDS_Shape& aE = aExp.Current();
+    if (aSec.IsDeleted(aE)) {
+      // no common blocks for this edge
+      continue;
+    }
+    //
+    const BOPCol_ListOfShape* pLEIm = anIm.Seek(aE);
+    if (!pLEIm) {
+      // no splits, i.e. completely coincides with some edge from boundary
+      continue;
+    }
+    //
+    BOPCol_ListIteratorOfListOfShape aItLEIm(*pLEIm);
+    for (; aItLEIm.More(); aItLEIm.Next()) {
+      const TopoDS_Shape& aEIm = aItLEIm.Value();
+      if (!aMSSec.Contains(aEIm)) {
+        // the edge included in section only partially.
+        // the part not included in section may be excesssive
+        //
+        // check vertices of this edge - if one of them is new
+        // the edge might be removed
+        TopoDS_Vertex aV1, aV2;
+        TopExp::Vertices(TopoDS::Edge(aEIm), aV1, aV2);
+        if (!theMVOld.Contains(aV1) || !theMVOld.Contains(aV2)) {
+          // add this edge for checking
+          TopoDS_Vertex aV;
+          Standard_Real f, l;
+          const Handle(Geom_Curve)& aC = BRep_Tool::Curve(TopoDS::Edge(aEIm), f, l);
+          BRep_Builder().MakeVertex(aV, aC->Value((f+l)*0.5), Precision::Confusion());
+          //
+          TopTools_ListOfShape aLEx;
+          aLEx.Append(aE);
+          aDMVE.Add(aV, aLEx);
+          aMVInv.Add(aV);
+          break;
+        }
+      }
+    }
+  }
+  //
+  // add for check also the vertices connected only to new edges
+  aNb = aDMVE.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aV = aDMVE.FindKey(i);
+    if (theMVOld.Contains(aV)) {
+      continue;
+    }
+    //
+    Standard_Boolean bNew = Standard_False, bOld = Standard_False;
+    const TopTools_ListOfShape& aLEx = aDMVE(i);
+    TopTools_ListIteratorOfListOfShape aIt(aLEx);
+    for (; aIt.More(); aIt.Next()) {
+      const TopoDS_Shape& aE = aIt.Value();
+      if (theMENew.Contains(aE)) {
+        bNew = Standard_True;
+      }
+      else {
+        bOld = Standard_True;
+      }
+      //
+      if (bNew && bOld) {
+        break;
+      }
+    }
+    //
+    if (!bNew || !bOld) {
+      aMVInv.Add(aV);
+      aMVCheckAdd.Remove(aV);
+    }
+  }
+  //
+  Handle(IntTools_Context) aCtx = new IntTools_Context;
+  // filter vertices
+  Standard_Integer iv, aNbIV = aMVInv.Extent(), aNbF = theFToRebuild.Extent();
+  for (iv = 1; iv <= aNbIV; ++iv) {
+    const TopoDS_Vertex& aV = TopoDS::Vertex(aMVInv(iv));
+    const gp_Pnt& aP = BRep_Tool::Pnt(aV);
+    Standard_Real aTolV = BRep_Tool::Tolerance(aV);
+    Standard_Boolean bInvalid = Standard_True;
+    //
+    for (i = 1; i <= aNbF && bInvalid; ++i) {
+      const TopoDS_Shape& aF = theFToRebuild.FindKey(i);
+      const TopTools_ListOfShape& aLFIm = theFImages.FindFromKey(aF);
+      //
+      TopTools_ListIteratorOfListOfShape aItLF(aLFIm);
+      for (; aItLF.More() && bInvalid; aItLF.Next()) {
+        const TopoDS_Face& aFIm = TopoDS::Face(aItLF.Value());
+        TopExp_Explorer aExp(aFIm, TopAbs_VERTEX);
+        for (; aExp.More() && bInvalid; aExp.Next()) {
+          const TopoDS_Shape& aVF = aExp.Current();
+          bInvalid = !aVF.IsSame(aV);
+        }
+        //
+        if (bInvalid) {
+          bInvalid = !aCtx->IsValidPointForFace(aP, aFIm, aTolV);
+        }
+      }
+    }
+    //
+    if (bInvalid && aMVCheckAdd.Contains(aV)) {
+      // the vertex is invalid for all faces
+      // check the same vertex for the solids
+      TopExp_Explorer aExpS(theSolids, TopAbs_SOLID);
+      for (; aExpS.More() && bInvalid; aExpS.Next()) {
+        const TopoDS_Solid& aSol = TopoDS::Solid(aExpS.Current());
+        BRepClass3d_SolidClassifier& aSC = aCtx->SolidClassifier(aSol);
+        aSC.Perform(aP, aTolV);
+        bInvalid = (aSC.State() == TopAbs_OUT);
+      }
+    }
+    //
+    if (bInvalid) {
+      theVertsToAvoid.Add(aV);
+      if (aDMVE.Contains(aV)) {
+        const TopTools_ListOfShape& aLEInv = aDMVE.FindFromKey(aV);
+        TopTools_ListIteratorOfListOfShape aItLEInv(aLEInv);
+        for (; aItLEInv.More(); aItLEInv.Next()) {
+          const TopoDS_Shape& aEInv = aItLEInv.Value();
+          theMEInv.Add(aEInv);
+        }
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : UpdateNewIntersectionEdges
+//purpose  : Updating the maps of images and origins of the offset edges
+//=======================================================================
+void UpdateNewIntersectionEdges(const TopTools_ListOfShape& theLE,
+                                const TopTools_DataMapOfShapeListOfShape& theMELF,
+                                const TopTools_DataMapOfShapeListOfShape& theEImages,
+                                const TopTools_IndexedMapOfShape& theInvEdges,
+                                const TopTools_MapOfShape& theInvertedEdges,
+                                TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+                                TopTools_DataMapOfShapeListOfShape& theOEImages,
+                                TopTools_DataMapOfShapeListOfShape& theOEOrigins,
+                                TopTools_DataMapOfShapeShape& theETrimEInf,
+                                TopTools_DataMapOfShapeListOfShape& theEETrim,
+                                TopTools_MapOfShape& theModifiedEdges,
+                                Handle(BRepAlgo_AsDes)& theAsDes)
+{
+  TopTools_ListOfShape aLEImEmpty;
+  TopTools_ListIteratorOfListOfShape aIt, aIt1;
+  // update global maps of images and origins with new splits
+  aIt.Initialize(theLE);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aE = aIt.Value();
+    //
+    if (!theEImages.IsBound(aE)) {
+      TopTools_ListOfShape* pLET = theEETrim.ChangeSeek(aE);
+      if (!pLET) {
+        continue;
+      }
+      //
+      TopTools_ListIteratorOfListOfShape aItLET(*pLET);
+      for (; aItLET.More();) {
+        const TopoDS_Shape& aET = aItLET.Value();
+        if (!theInvEdges.Contains(aET) && !theInvertedEdges.Contains(aET)) {
+          pLET->Remove(aItLET);
+        }
+        else {
+          aItLET.Next();
+        }
+      }
+      //
+      if (pLET->IsEmpty()) {
+        continue;
+      }
+    }
+    // new images
+    const TopTools_ListOfShape& aLENew = 
+      theEImages.IsBound(aE) ? theEImages.Find(aE) : aLEImEmpty;
+    //
+    // save connection to untrimmed edge for the next steps
+    aIt1.Initialize(aLENew);
+    for (; aIt1.More(); aIt1.Next()) {
+      const TopoDS_Shape& aET = aIt1.Value();
+      theETrimEInf.Bind(aET, aE);
+      theModifiedEdges.Add(aET);
+    }
+    //
+    // check if it is existing edge
+    if (!theEETrim.IsBound(aE)) {
+      const TopTools_ListOfShape& aLF = theMELF.Find(aE);
+      // the edge is new
+      // add this edge to AsDes
+      aIt1.Initialize(aLF);
+      for (; aIt1.More(); aIt1.Next()) {
+        const TopoDS_Shape& aF = aIt1.Value();
+        theAsDes->Add(aF, aE);
+      }
+      //
+      // add aE to the images
+      theOEImages.Bind(aE, aLENew);
+      theModifiedEdges.Add(aE);
+      //
+      // add to origins
+      TopTools_ListIteratorOfListOfShape aItNew(aLENew);
+      for (; aItNew.More(); aItNew.Next()) {
+        const TopoDS_Shape& aENew = aItNew.Value();
+        if (theOEOrigins.IsBound(aENew)) {
+          TopTools_ListOfShape& aEOrigins = theOEOrigins.ChangeFind(aENew);
+          AppendToList(aEOrigins, aE);
+        }
+        else {
+          TopTools_ListOfShape aEOrigins;
+          aEOrigins.Append(aE);
+          theOEOrigins.Bind(aENew, aEOrigins);
+        }
+      }
+      //
+      // update connection to initial origins
+      if (theEdgesOrigins.IsBound(aE)) {
+        const TopTools_ListOfShape& aLEOrInit = theEdgesOrigins.Find(aE);
+        aIt1.Initialize(aLENew);
+        for (; aIt1.More(); aIt1.Next()) {
+          const TopoDS_Shape& aENew = aIt1.Value();
+          if (theEdgesOrigins.IsBound(aENew)) {
+            TopTools_ListOfShape& aLENewOr = theEdgesOrigins.ChangeFind(aENew);
+            TopTools_ListIteratorOfListOfShape aItOrInit(aLEOrInit);
+            for (; aItOrInit.More(); aItOrInit.Next()) {
+              const TopoDS_Shape& aEOr = aItOrInit.Value();
+              AppendToList(aLENewOr, aEOr);
+            }
+          }
+          else {
+            theEdgesOrigins.Bind(aENew, aLEOrInit);
+          }
+        }
+      }
+      //
+      continue;
+    }
+    //
+    // old images
+    const TopTools_ListOfShape& aLEOld = theEETrim.Find(aE);
+    //
+    // list of initial origins
+    TopTools_ListOfShape anInitOrigins;
+    //
+    // it is necessary to replace the old edges with new ones
+    aIt1.Initialize(aLEOld);
+    for (; aIt1.More(); aIt1.Next()) {
+      const TopoDS_Shape& aEOld = aIt1.Value();
+      //
+      if (theOEOrigins.IsBound(aEOld)) {
+        // get its origins
+        const TopTools_ListOfShape& aEOrigins = theOEOrigins.Find(aEOld);
+        //
+        TopTools_ListIteratorOfListOfShape aItOr(aEOrigins);
+        for (; aItOr.More(); aItOr.Next()) {
+          const TopoDS_Shape& aEOr = aItOr.Value();
+          //
+          theModifiedEdges.Add(aEOr);
+          //
+          TopTools_ListOfShape& aEImages = theOEImages.ChangeFind(aEOr);
+          //
+          // remove old edge from images
+          TopTools_ListIteratorOfListOfShape aItIm(aEImages);
+          for (; aItIm.More(); ) {
+            const TopoDS_Shape& aEIm = aItIm.Value();
+            if (aEIm.IsSame(aEOld)) {
+              aEImages.Remove(aItIm);
+            }
+            else {
+              aItIm.Next();
+            }
+          }
+          //
+          // add new images
+          TopTools_ListIteratorOfListOfShape aItNew(aLENew);
+          for (; aItNew.More(); aItNew.Next()) {
+            const TopoDS_Shape& aENew = aItNew.Value();
+            AppendToList(aEImages, aENew);
+            if (theOEOrigins.IsBound(aENew)) {
+              TopTools_ListOfShape& aENewOrigins = theOEOrigins.ChangeFind(aENew);
+              AppendToList(aENewOrigins, aEOr);
+            }
+            else {
+              TopTools_ListOfShape aENewOrigins;
+              aENewOrigins.Append(aEOr);
+              theOEOrigins.Bind(aENew, aENewOrigins);
+            }
+          }
+        }
+      }
+      else {
+        // add to images
+        theOEImages.Bind(aEOld, aLENew);
+        //
+        theModifiedEdges.Add(aEOld);
+        //
+        // add to origins
+        TopTools_ListIteratorOfListOfShape aItNew(aLENew);
+        for (; aItNew.More(); aItNew.Next()) {
+          const TopoDS_Shape& aENew = aItNew.Value();
+          if (theOEOrigins.IsBound(aENew)) {
+            TopTools_ListOfShape& aEOrigins = theOEOrigins.ChangeFind(aENew);
+            AppendToList(aEOrigins, aEOld);
+          }
+          else {
+            TopTools_ListOfShape aEOrigins;
+            aEOrigins.Append(aEOld);
+            theOEOrigins.Bind(aENew, aEOrigins);
+          }
+        }
+      }
+      //
+      // update connection to initial shape
+      if (theEdgesOrigins.IsBound(aEOld)) {
+        const TopTools_ListOfShape& aLEOrInit = theEdgesOrigins.Find(aEOld);
+        TopTools_ListIteratorOfListOfShape aItEOrInit(aLEOrInit);
+        for (; aItEOrInit.More(); aItEOrInit.Next()) {
+          const TopoDS_Shape& aEOrInit = aItEOrInit.Value();
+          AppendToList(anInitOrigins, aEOrInit);
+        }
+      }
+    }
+    //
+    if (anInitOrigins.Extent()) {
+      TopTools_ListIteratorOfListOfShape aItNew(aLENew);
+      for (; aItNew.More(); aItNew.Next()) {
+        const TopoDS_Shape& aENew = aItNew.Value();
+        if (theEdgesOrigins.IsBound(aENew)) {
+          TopTools_ListOfShape& aLENewOr = theEdgesOrigins.ChangeFind(aENew);
+          TopTools_ListIteratorOfListOfShape aItOrInit(anInitOrigins);
+          for (; aItOrInit.More(); aItOrInit.Next()) {
+            const TopoDS_Shape& aEOr = aItOrInit.Value();
+            AppendToList(aLENewOr, aEOr);
+          }
+        }
+        else {
+          theEdgesOrigins.Bind(aENew, anInitOrigins);
+        }
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : FillHistory
+//purpose  : Saving obtained results in history tools
+//=======================================================================
+void FillHistory(const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
+                 const TopTools_DataMapOfShapeListOfShape& theEImages,
+                 BRepAlgo_Image& theImage)
+{
+  Standard_Integer i, aNb = theFImages.Extent();
+  if (!aNb) {
+    return;
+  }
+  //
+  BRep_Builder aBB;
+  TopoDS_Compound aFaces;
+  aBB.MakeCompound(aFaces);
+  //
+  // Fill history for faces
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aF = theFImages.FindKey(i);
+    const TopTools_ListOfShape& aLFImages = theFImages(i);
+    //
+    if (aLFImages.Extent()) {
+      if (theImage.HasImage(aF)) {
+        theImage.Add(aF, aLFImages);
+      }
+      else {
+        theImage.Bind(aF, aLFImages);
+      }
+    }
+    //
+    TopTools_ListIteratorOfListOfShape aItLF(aLFImages);
+    for (; aItLF.More(); aItLF.Next()) {
+      const TopoDS_Shape& aFIm = aItLF.Value();
+      aBB.Add(aFaces, aFIm);
+    }
+  }
+  //
+  // fill history for edges
+  TopTools_IndexedMapOfShape aMFE;
+  TopExp::MapShapes(aFaces, TopAbs_EDGE, aMFE);
+  //
+  TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItEIm(theEImages);
+  for (; aItEIm.More(); aItEIm.Next()) {
+    const TopoDS_Shape& aE = aItEIm.Key();
+    const TopTools_ListOfShape& aLEIm = aItEIm.Value();
+    //
+    Standard_Boolean bHasImage = theImage.HasImage(aE);
+    TopTools_ListIteratorOfListOfShape aItLE(aLEIm);
+    for (; aItLE.More(); aItLE.Next()) {
+      const TopoDS_Shape& aEIm = aItLE.Value();
+      if (aMFE.Contains(aEIm)) {
+        if (bHasImage) {
+          theImage.Add(aE, aEIm);
+        }
+        else {
+          theImage.Bind(aE, aEIm);
+          bHasImage = Standard_True;
+        }
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : ProcessMicroEdge
+//purpose  : Checking if the edge is micro edge
+//=======================================================================
+Standard_Boolean ProcessMicroEdge(const TopoDS_Edge& theEdge,
+                                  const Handle(IntTools_Context)& theCtx)
+{
+  TopoDS_Vertex aV1, aV2;
+  TopExp::Vertices(theEdge, aV1, aV2);
+  if (aV1.IsNull() || aV2.IsNull()) {
+    return Standard_False;
+  }
+  //
+  Standard_Boolean bMicro = BOPTools_AlgoTools::IsMicroEdge(theEdge, theCtx);
+  if (bMicro && BRepAdaptor_Curve(theEdge).GetType() == GeomAbs_Line) {
+    Standard_Real aLen = BRep_Tool::Pnt(aV1).Distance(BRep_Tool::Pnt(aV2));
+    BRep_Builder().UpdateVertex(aV1, aLen / 2.);
+    BRep_Builder().UpdateVertex(aV2, aLen / 2.);
+  }
+  //
+  return bMicro;
+}
+
+//=======================================================================
+//function : UpdateOrigins
+//purpose  : Updating origins
+//=======================================================================
+void UpdateOrigins(const TopTools_ListOfShape& theLA,
+                   TopTools_DataMapOfShapeListOfShape& theOrigins,
+                   BOPAlgo_Builder& theGF)
+{
+  TopTools_ListIteratorOfListOfShape aItA(theLA);
+  for (; aItA.More(); aItA.Next()) {
+    const TopoDS_Shape& aS = aItA.Value();
+    //
+    const TopTools_ListOfShape& aLSIm = theGF.Modified(aS);
+    if (aLSIm.IsEmpty()) {
+      continue;
+    }
+    //
+    TopTools_ListOfShape aLSEmpt;
+    TopTools_ListOfShape *pLS = theOrigins.ChangeSeek(aS);
+    if (!pLS) {
+      pLS = &aLSEmpt;
+      pLS->Append(aS);
+    }
+    //
+    TopTools_ListIteratorOfListOfShape aIt(aLSIm);
+    for (; aIt.More(); aIt.Next()) {
+      const TopoDS_Shape& aSIm = aIt.Value();
+      //
+      TopTools_ListOfShape *pLSOr = theOrigins.ChangeSeek(aSIm);
+      if (!pLSOr) {
+        // just bind the origins
+        theOrigins.Bind(aSIm, *pLS);
+      }
+      else {
+        // merge two lists
+        TopTools_ListIteratorOfListOfShape aIt1(*pLS);
+        for (; aIt1.More(); aIt1.Next()) {
+          const TopoDS_Shape& aS1 = aIt1.Value();
+          AppendToList(*pLSOr, aS1);
+        }
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : UpdateImages
+//purpose  : Updating images of the shapes
+//=======================================================================
+void UpdateImages(const TopTools_ListOfShape& theLA,
+                  TopTools_DataMapOfShapeListOfShape& theImages,
+                  BOPAlgo_Builder& theGF,
+                  TopTools_MapOfShape& theModified)
+{
+  TopTools_ListIteratorOfListOfShape aIt(theLA);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aS = aIt.Value();
+    //
+    TopTools_ListOfShape* pLSIm = theImages.ChangeSeek(aS);
+    if (!pLSIm) {
+      const TopTools_ListOfShape& aLSIm = theGF.Modified(aS);
+      if (aLSIm.Extent()) {
+        theImages.Bind(aS, aLSIm);
+        theModified.Add(aS);
+      }
+      continue;
+    }
+    //
+    TopTools_MapOfShape aMFence;
+    TopTools_ListOfShape aLSImNew;
+    //
+    Standard_Boolean bModified = Standard_False;
+    //
+    // check modifications of the images
+    TopTools_ListIteratorOfListOfShape aIt1(*pLSIm);
+    for (; aIt1.More(); aIt1.Next()) {
+      const TopoDS_Shape& aSIm = aIt1.Value();
+      const TopTools_ListOfShape& aLSIm1 = theGF.Modified(aSIm);
+      if (aLSIm1.IsEmpty()) {
+        if (aMFence.Add(aSIm)) {
+          aLSImNew.Append(aSIm);
+        }
+      }
+      else {
+        TopTools_ListIteratorOfListOfShape aIt2(aLSIm1);
+        for (; aIt2.More(); aIt2.Next()) {
+          const TopoDS_Shape& aSImIm = aIt2.Value();
+          if (aMFence.Add(aSImIm)) {
+            aLSImNew.Append(aSImIm);
+          }
+        }
+        bModified = Standard_True;
+      }
+    }
+    //
+    if (bModified) {
+      *pLSIm = aLSImNew;
+      theModified.Add(aS);
+    }
+  }
+}
+
+//=======================================================================
+//function : UpdateIntersectedEdges
+//purpose  : Saving connection from trimmed edges to not trimmed ones
+//=======================================================================
+void UpdateIntersectedEdges(const TopTools_ListOfShape& theLA,
+                            TopTools_DataMapOfShapeShape& theETrimEInf,
+                            BOPAlgo_Builder& theGF)
+{
+  TopTools_ListIteratorOfListOfShape aItA(theLA);
+  for (; aItA.More(); aItA.Next()) {
+    const TopoDS_Shape& aS = aItA.Value();
+    //
+    const TopoDS_Shape* pEInf = theETrimEInf.Seek(aS);
+    if (!pEInf) {
+      continue;
+    }
+    //
+    const TopTools_ListOfShape& aLSIm = theGF.Modified(aS);
+    if (aLSIm.IsEmpty()) {
+      continue;
+    }
+    //
+    TopTools_ListIteratorOfListOfShape aIt(aLSIm);
+    for (; aIt.More(); aIt.Next()) {
+      const TopoDS_Shape& aEIm = aIt.Value();
+      if (!theETrimEInf.IsBound(aEIm)) {
+        theETrimEInf.Bind(aEIm, *pEInf);
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : FindCommonParts
+//purpose  : Looking for the parts of type <theType> contained in both lists
+//=======================================================================
+void FindCommonParts(const TopTools_ListOfShape& theLS1,
+                     const TopTools_ListOfShape& theLS2,
+                     TopTools_ListOfShape& theLSC,
+                     const TopAbs_ShapeEnum theType)
+{
+  // map shapes in the first list
+  TopTools_IndexedMapOfShape aMS1;
+  TopTools_ListIteratorOfListOfShape aIt(theLS1);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aS = aIt.Value();
+    TopExp::MapShapes(aS, theType, aMS1);
+  }
+  //
+  if (aMS1.IsEmpty()) {
+    return;
+  }
+  //
+  TopTools_MapOfShape aMFence;
+  // check for such shapes in the other list
+  aIt.Initialize(theLS2);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aS = aIt.Value();
+    //
+    TopExp_Explorer aExp(aS, theType);
+    for(; aExp.More(); aExp.Next()) {
+      const TopoDS_Shape& aST = aExp.Current();
+      //
+      if (aMS1.Contains(aST) && aMFence.Add(aST)) {
+        theLSC.Append(aST);
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : NbPoints
+//purpose  : Defines number of sample points to get average direction of the edge
+//=======================================================================
+Standard_Integer NbPoints(const TopoDS_Edge& theEdge)
+{
+  Standard_Integer aNbP;
+  BRepAdaptor_Curve aBAC(theEdge);
+  switch (aBAC.GetType()) {
+  case GeomAbs_Line:
+    aNbP = 1;
+    break;
+  default:
+    aNbP = 11;
+  }
+  //
+  return aNbP;
+}
+
+//=======================================================================
+//function : FindShape
+//purpose  : Looking for the same sub-shape in the shape
+//=======================================================================
+Standard_Boolean FindShape(const TopoDS_Shape& theSWhat,
+                           const TopoDS_Shape& theSWhere,
+                           TopoDS_Shape& theRes)
+{
+  Standard_Boolean bFound = Standard_False;
+  TopAbs_ShapeEnum aType = theSWhat.ShapeType();
+  TopExp_Explorer aExp(theSWhere, aType);
+  for (; aExp.More(); aExp.Next()) {
+    const TopoDS_Shape& aS = aExp.Current();
+    if (aS.IsSame(theSWhat)) {
+      theRes = aS;
+      bFound = Standard_True;
+      break;
+    }
+  }
+  return bFound;
+}
+
+
+//=======================================================================
+//function : AppendToList
+//purpose  : Add to a list only unique elements
+//=======================================================================
+void AppendToList(TopTools_ListOfShape& theList,
+                  const TopoDS_Shape& theShape)
+{
+  TopTools_ListIteratorOfListOfShape aIt(theList);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aS = aIt.Value();
+    if (aS.IsSame(theShape)) {
+      return;
+    }
+  }
+  theList.Append(theShape);
+}
index 5d8e8e2b96af467c50fbbf6ebc4d39dce9bd13fb..c01c500bd68fd5afd1623327ca60b9a552e6016d 100644 (file)
@@ -21,6 +21,7 @@ BRepOffset_ListOfInterval.hxx
 BRepOffset_MakeLoops.cxx
 BRepOffset_MakeLoops.hxx
 BRepOffset_MakeOffset.cxx
+BRepOffset_MakeOffset_1.cxx
 BRepOffset_MakeOffset.hxx
 BRepOffset_Mode.hxx
 BRepOffset_Offset.cxx
index 79bf466e1a1e5557d94226116417f34fa66b28fd..bcf5f2e6693fafbfa39db42392d38bb32bee92bc 100644 (file)
@@ -1003,13 +1003,12 @@ static Standard_Real         TheTolerance = Precision::Confusion();
 static Standard_Boolean      TheInter     = Standard_False;
 static GeomAbs_JoinType      TheJoin      = GeomAbs_Arc;
 static Standard_Boolean      RemoveIntEdges = Standard_False;
-static Standard_Boolean      RemoveInvalidFaces = Standard_False;
 
 Standard_Integer offsetparameter(Draw_Interpretor& di,
                                  Standard_Integer n, const char** a)
 {
   if ( n == 1 ) { 
-    di << " offsetparameter Tol Inter(c/p) JoinType(a/i/t) [RemoveInternalEdges(r/k) RemoveInvalidFaces(r/k)]\n";
+    di << " offsetparameter Tol Inter(c/p) JoinType(a/i/t) [RemoveInternalEdges(r/k)]\n";
     di << " Current Values\n";
     di << "   --> Tolerance : " << TheTolerance << "\n";
     di << "   --> TheInter  : ";
@@ -1034,14 +1033,6 @@ Standard_Integer offsetparameter(Draw_Interpretor& di,
     else {
       di << "Keep";
     }
-    //
-    di << "\n   --> Invalid Faces : ";
-    if (RemoveInvalidFaces) {
-      di << "Remove";
-    }
-    else {
-      di << "Keep";
-    }
     di << "\n";
     //
     return 0;
@@ -1057,7 +1048,6 @@ Standard_Integer offsetparameter(Draw_Interpretor& di,
   else if ( !strcmp(a[3],"t")) TheJoin = GeomAbs_Tangent;
   //
   RemoveIntEdges = (n >= 5) ? !strcmp(a[4], "r") : Standard_False;
-  RemoveInvalidFaces = (n == 6) ? !strcmp(a[5], "r") : Standard_False;
   //
   return 0;
 }
@@ -1079,7 +1069,7 @@ Standard_Integer offsetload(Draw_Interpretor& ,
 //  Standard_Boolean Inter = Standard_True;
   
   TheOffset.Initialize(S,Of,TheTolerance,BRepOffset_Skin,TheInter,0,TheJoin,
-                       Standard_False, RemoveIntEdges, RemoveInvalidFaces);
+                       Standard_False, RemoveIntEdges);
   //------------------------------------------
   // recuperation et chargement des bouchons.
   //----------------------------------------
@@ -2327,7 +2317,7 @@ void BRepTest::FeatureCommands (Draw_Interpretor& theCommands)
                  __FILE__,offsetshape,g);
 
   theCommands.Add("offsetparameter",
-                 "offsetparameter Tol Inter(c/p) JoinType(a/i/t) [RemoveInternalEdges(r/k) RemoveInvalidFaces(r/k)]",
+                 "offsetparameter Tol Inter(c/p) JoinType(a/i/t) [RemoveInternalEdges(r/k)]",
                  __FILE__,offsetparameter);
 
   theCommands.Add("offsetload",
index ac6fc41c1f8f39cac8fb053d1829008548e6bc6c..a552fd2586d1902f7bfbe68a4682dd388025b401 100644 (file)
@@ -24,7 +24,7 @@ foreach f $faces {
 offsetperform result1
 checkprops result1 -s 3.26459e+006
 checkprops result1 -v 1.067e+008
-checknbshapes result1 -vertex 28 -edge 44 -wire 20 -face 19 -shell 1 -solid 1
+checknbshapes result1 -vertex 28 -edge 42 -wire 18 -face 17 -shell 1 -solid 1
 
 
 # second shape
@@ -42,7 +42,7 @@ foreach f $faces {
 offsetperform result2
 checkprops result2 -s 3.26459e+006
 checkprops result2 -v 1.067e+008
-checknbshapes result2 -vertex 28 -edge 44 -wire 20 -face 19 -shell 1 -solid 1
+checknbshapes result2 -vertex 28 -edge 42 -wire 18 -face 17 -shell 1 -solid 1
 
 
 # compare the results
index 1acf324e162410590dad4108545be5b7abf87c00..3f2448e1fb1b2c9e621278ef1458bdb55097bc7f 100644 (file)
@@ -24,7 +24,7 @@ foreach f $faces {
 offsetperform result1
 checkprops result1 -s 3.76166e+006
 checkprops result1 -v 1.74521e+008
-checknbshapes result1 -vertex 36 -edge 56 -wire 24 -face 23 -shell 1 -solid 1
+checknbshapes result1 -vertex 36 -edge 54 -wire 22 -face 21 -shell 1 -solid 1
 
 
 # second shape
@@ -42,7 +42,7 @@ foreach f $faces {
 offsetperform result2
 checkprops result2 -s 3.76166e+006
 checkprops result2 -v 1.74521e+008
-checknbshapes result2 -vertex 36 -edge 56 -wire 24 -face 23 -shell 1 -solid 1
+checknbshapes result2 -vertex 36 -edge 54 -wire 22 -face 21 -shell 1 -solid 1
 
 
 # compare the results
index 8d1437172a13b86d3536a7e5efd69d0e9971c0d4..94805778a61f167a6cd3a2c6439e83471ca8791b 100644 (file)
@@ -24,7 +24,7 @@ foreach f $faces {
 offsetperform result1
 checkprops result1 -s 464088
 checkprops result1 -v 1.29909e+007
-checknbshapes result1 -vertex 48 -edge 74 -wire 32 -face 30 -shell 1 -solid 1
+checknbshapes result1 -vertex 48 -edge 72 -wire 30 -face 28 -shell 1 -solid 1
 
 
 # second shape
@@ -42,7 +42,7 @@ foreach f $faces {
 offsetperform result2
 checkprops result2 -s 464088
 checkprops result2 -v 1.29909e+007
-checknbshapes result2 -vertex 48 -edge 74 -wire 32 -face 30 -shell 1 -solid 1
+checknbshapes result2 -vertex 48 -edge 72 -wire 30 -face 28 -shell 1 -solid 1
 
 
 # compare the results
index 233d5a285044388c53eff5d1ae5874e1597260c9..62789741dff0a65022d0c93db44c78844c82aeb3 100644 (file)
@@ -111,7 +111,11 @@ if { [isdraw result] && $mist == 0} {
         }
     }
     if { $m > 0 } {
-       checkview -display result -2d -path ${imagedir}/${test_image}.png
+      if {[info exists result_unif]} {
+        checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
+      } else {
+        checkview -display result -2d -path ${imagedir}/${test_image}.png
+      }
     }
 } else {
     puts "Error : The offset cannot be built."
index e93274600899c137b3b89d7761837e42d8b44020..452ccff2f2e3ac9a16cde4ce26b7dfa9bf3a5635 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s
 OFFSETSHAPE 0.1 {} $calcul $type
 
 checkprops result -v 925.196
+
+checknbshapes result -shell 1
index 2cf508d6ecc9024cb7d2a59483253fdf4c9a0a8a..dd1fc16398ce854d94d93af49af2e818b22b1d8e 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s
 OFFSETSHAPE 0.3 {} $calcul $type
 
 checkprops result -v 1068.58
+
+checknbshapes result -shell 1
index 6d89081ddb4db2364a1837159191dd78da1f97a5..1880b7276387a935d05536b0fedfb4e1c4334a8d 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s
 OFFSETSHAPE 0.6 {} $calcul $type
 
 checkprops result -v 1296.86
+
+checknbshapes result -shell 1
index d4a606170c4b5f198572e742fe00c6b12e32b755..80d775361fc0ba902abe85338bfbc8a0d2d5c0df 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s
 OFFSETSHAPE 0.9 {} $calcul $type
 
 checkprops result -v 1543.91
+
+checknbshapes result -shell 1
index 9911897edecb98db194880b5e998638024b2e79c..c660bd572673b9f590575c44b83529aea9bc08d8 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s
 OFFSETSHAPE 1.2 {} $calcul $type
 
 checkprops result -v 1817.34
+
+checknbshapes result -shell 1
index 57e4bde154da44cb2af1a8aa2372e7d382d52452..de413a014de827d8137d7018a26bf2a83c18a7a8 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s
 OFFSETSHAPE 1.5 {} $calcul $type
 
 checkprops result -v 2119
+
+checknbshapes result -shell 1
index 898557e04938d636d5156c881147b0a1545f54e0..280e624aba37c0e7f5a947f062b5af014328cf13 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s
 OFFSETSHAPE 1.8 {} $calcul $type
 
 checkprops result -v 2450.18
+
+checknbshapes result -shell 1
index e943acb46d3c662eef5d4883eab1d174dae368da..865692477cbb61c32695329983b3ceb4898c73ca 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s
 OFFSETSHAPE 2.1 {} $calcul $type
 
 checkprops result -v 2812.17
+
+checknbshapes result -shell 1
index db7cefcdfb1728910a0dee7ba49271bb8bbbcec9..1c8a932086ec5dcb9c9ec4b1b71d649d60e025a2 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s
 OFFSETSHAPE 2.4 {} $calcul $type
 
 checkprops result -v 3206.27
+
+checknbshapes result -shell 1
index 2f2fa24556969fe4f74c9698dff4924031b207d2..bc56a9f3900719274560c623cbf75a08046e12d7 100644 (file)
@@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s
 
 OFFSETSHAPE 3 {} $calcul $type
 
-checkprops result -v 2.00176e+007
+checkprops result -v 2.00176e+007 -s 644597
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 24 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
index ad16b2d5ae7d67e02e508b81898497f21b78fdc4..519172f77321647dbee2e4c47a4bccda9fe44bf2 100644 (file)
@@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s
 
 OFFSETSHAPE 6 {} $calcul $type
 
-checkprops result -v 2.19865e+007
+checkprops result -v 2.19865e+007 -s 668050
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 24 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
index 7fcedf94ce73bee0f3dada9a8c08d73a2db62577..e67c6d24e16200adb18b3788ab8181dcc9e8aaa5 100644 (file)
@@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s
 
 OFFSETSHAPE 10 {} $calcul $type
 
-checkprops result -v 2.47223e+007
+checkprops result -v 2.47223e+007 -s 699984
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 24 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
index 767005dbbf31448ef28dd61ab98a8d464c9db426..d73fe82c140a9bf2c763b48e81801c9de5ab3fda 100644 (file)
@@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s
 
 OFFSETSHAPE 18 {} $calcul $type
 
-checkprops result -v 3.05847e+007
+checkprops result -v 3.05847e+007 -s 766128
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 24 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
index e4e7d571c36dae15ce058baccdade66393fbc659..3d88f7bc2105c875e2a90ac1457eafee6e3283b1 100644 (file)
@@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s
 
 OFFSETSHAPE 21 {} $calcul $type
 
-checkprops result -v 3.29213e+007
+checkprops result -v 3.29213e+007 -s 791474
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 22 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
index 983fe152ee5a779b5d9130885f0bf1773b421c7a..70e2ceee3b380f562909963e99381c09d45db881 100644 (file)
@@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s
 
 OFFSETSHAPE 25 {} $calcul $type
 
-checkprops result -v 3.61487e+007
+checkprops result -v 3.61487e+007 -s 823028
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 20 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
index a779476990e53579d8afbfc2df3e913355f3a072..4c56c7fa819932c0d07c43a397c93da762a78123 100644 (file)
@@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s
 
 OFFSETSHAPE 26 {} $calcul $type
 
-checkprops result -v 3.6976e+007
+checkprops result -v 3.6976e+007 -s 831726
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 20 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
index c88dbee1de335a9bd56f59f0610549a34dd417b5..7887ce35640d3ddac8f901e6e6b2f946d76e758b 100644 (file)
@@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s
 
 OFFSETSHAPE 36 {} $calcul $type
 
-checkprops result -v 4.58112e+007
+checkprops result -v 4.58112e+007 -s 936544
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 14 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
index 622af2be844dbe29ba4569d6f68df974a246d63d..66237b1edf70183d49861930d5d3a566e1484622 100644 (file)
@@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s
 
 OFFSETSHAPE 44 {} $calcul $type
 
-checkprops result -v 5.36522e+007
+checkprops result -v 5.36522e+007 -s 1.02422e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 14 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
index c8f0bfeb058818eb9c368531f88b40efef1fcb54..7312beca05ee974f11931a50a05a1d1a9550f2ee 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s
 OFFSETSHAPE 3 {} $calcul $type
 
 checkprops result -v 5.53893e+008
+
+checknbshapes result -shell 1
index 0b94e3896ad82dab1f8a52f99c65ac01d8347b64..b396854907d2fb269a798c21a7c4443136a93f82 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s
 OFFSETSHAPE 6 {} $calcul $type
 
 checkprops result -v 5.70329e+008
+
+checknbshapes result -shell 1
index 5d0201313f763e775268e94ecd371cbe99779104..9083f02f0309f57d82078a125cb5b6441ce0341a 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s
 OFFSETSHAPE 10 {} $calcul $type
 
 checkprops result -v 5.92261e+008
+
+checknbshapes result -shell 1
index fc7348ad55b800ab99d9bf6635e4008affbef994..344874ff886e5898d60fc3a59514f81272baf12a 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s
 OFFSETSHAPE 13 {} $calcul $type
 
 checkprops result -v 6.08723e+008
+
+checknbshapes result -shell 1
index ecef8f91d627421d120a557b3b95d206b7a549e8..898fb8c2882d7a9c0e5dc29056b825bc69369029 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s
 OFFSETSHAPE 18 {} $calcul $type
 
 checkprops result -v 6.36191e+008
+
+checknbshapes result -shell 1
index 8a7bdbf76f88165da1f36eadee9d3ecf75cbfe06..ed886d86f7723f4508ed18ffe74c7c6d32746e10 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s
 OFFSETSHAPE 30 {} $calcul $type
 
 checkprops result -v 7.02144e+008
+
+checknbshapes result -shell 1
index 5e05d428113a9289714b4945096e16f88033a327..3695bc459b88afeb9ccfc942305d1c131f5d7c30 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s
 OFFSETSHAPE 40 {} $calcul $type
 
 checkprops result -v 7.58284e+008
+
+checknbshapes result -shell 1
index 87af153bb815c7dddda9050a8aabb48eba80d591..d4af9522b84c4e6cf3adad209fffd77422a83c53 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s
 OFFSETSHAPE 50 {} $calcul $type
 
 checkprops result -v 8.16e+008
+
+checknbshapes result -shell 1
index 7f00b39eb7e4bb96cf87de8ae325808dcc028649..ab559623367f3c61c7047f15b542a0164630e12d 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s
 OFFSETSHAPE 60 {} $calcul $type
 
 checkprops result -v 8.75772e+008
+
+checknbshapes result -shell 1
index 8810a895a445da01059f54955d0ec249c564f8fa..52a871ebef99894ef7a7af6c378db0d66f87cfa8 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_offset_shape_tc80_2_smaller.brep] s
 OFFSETSHAPE 5 {} $calcul $type
 
 checkprops result -v 3.03855e+008
+
+checknbshapes result -shell 1
index 51365e4ae678190120e28d8420e03154d34af9fe..3535387b7c49a73c8ed9b801f97c09c2f06e3859 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_offset_shape_tc80_2_smaller.brep] s
 OFFSETSHAPE 10 {} $calcul $type
 
 checkprops result -v 3.38527e+008
+
+checknbshapes result -shell 1
index 81698802cc7b8d1ddcdd7271e3c8a1a0c9d8ffa1..e4b461fd972a5e1e498296e2f8bed182f6583d98 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_offset_shape_tc80_2_smaller.brep] s
 OFFSETSHAPE 15 {} $calcul $type
 
 checkprops result -v 3.68177e+008
+
+checknbshapes result -shell 1
index 5e9f0591abf17e929f47fb1780c92e697015a33e..27bc4ec0ff4214181cb0ecf0984e04690438d9cb 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_offset_shape_tc80_3_smaller.brep] s
 OFFSETSHAPE 5 {} $calcul $type
 
 checkprops result -v 3.13188e+008
+
+checknbshapes result -shell 1
index a810550cc449d6be64b05876ed79949d60946574..f8b8d953dc39d74df12581e00e6562f14b089a3b 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_offset_shape_tc80_3_smaller.brep] s
 OFFSETSHAPE 10 {} $calcul $type
 
 checkprops result -v 3.44873e+008
+
+checknbshapes result -shell 1
index fbcafe26f3c32fe4c05132a77eab71c3af39b8b6..6de559500a3a2788f07f422c85edaefe16ba7071 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_offset_shape_tc80_3_smaller.brep] s
 OFFSETSHAPE 15 {} $calcul $type
 
 checkprops result -v 3.72139e+008
+
+checknbshapes result -shell 1
index 53f46bba2970cb323bac59a51c00c4b304119c04..bb06d3d5f1b9dd7a27c5d1d8b21e8106cc12c1f0 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_shape_input_tc80.2.brep] s
 OFFSETSHAPE 5 {} $calcul $type
 
 checkprops result -v 1.01936e+008
+
+checknbshapes result -shell 1
index e9789cf4192620b0b7ace56d47fe16146ca4f1f5..2ad83d3f7586cdce2b35c2710692014127dcb5eb 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_shape_input_tc80.2.brep] s
 OFFSETSHAPE 10 {} $calcul $type
 
 checkprops result -v 1.14248e+008
+
+checknbshapes result -shell 1
index 52d41ecf0e05a2f243853277e6cf9cfb29725327..38d3f4f317f701da110fdab02b6806fe830b1583 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_shape_input_tc80.2.brep] s
 OFFSETSHAPE 15 {} $calcul $type
 
 checkprops result -v 1.25498e+008
+
+checknbshapes result -shell 1
index 4cb5fb6bb0e0fe4c30d5785d01c5ddf81f7e617b..8336db28a2b3da7260e6c1e74d581c17d339e30b 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_shape_input_tc80.3.brep] s
 OFFSETSHAPE 5 {} $calcul $type
 
 checkprops result -v 1.05054e+008
+
+checknbshapes result -shell 1
index f9af91b888d43d8d7c379b0eb21247b407343387..5b8775d15ac6cd36fe602d6febbc8a3831d1d9e4 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_shape_input_tc80.3.brep] s
 OFFSETSHAPE 10 {} $calcul $type
 
 checkprops result -v 1.16522e+008
+
+checknbshapes result -shell 1
index bdda939b0de43026839383def1198b3541987980..34fc8755d710dbce0d4a6a7486e74efcf4a4d61f 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_shape_input_tc80.3.brep] s
 OFFSETSHAPE 15 {} $calcul $type
 
 checkprops result -v 1.27083e+008
+
+checknbshapes result -shell 1
index d6675c9024bf6e4ef53a9cf6827f3d49e4dd4693..f40ba76ec8c7e68d60d35bb4ca6b2cee5c459220 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_shape_fails.brep] s
 OFFSETSHAPE 5 {} $calcul $type
 
 checkprops result -v 2.1234e+007
+
+checknbshapes result -shell 1
index 3b560ce5b303127d8346065c270809fb365c2035..3f7e9cd1a032ff8b5b9e5bdf4f2129d72aed4920 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_shape_fails.brep] s
 OFFSETSHAPE 30 {} $calcul $type
 
 checkprops result -v 4.0384e+007
+
+checknbshapes result -shell 1
index 090cc0f932e17a8a272755ac085df719f38d4b32..91f6ace0a27d6f8f0f08fe167f98cd83d2954768 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_shape_fails.brep] s
 OFFSETSHAPE 60 {} $calcul $type
 
 checkprops result -v 7.15e+007
+
+checknbshapes result -shell 1
index 0e0c80b71a4650c16965468cf18c97fe44772540..fe10392b6da6c186468ddc176a1e864c6c48d98c 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_trapezoid_1.brep] s
 OFFSETSHAPE 10 {} $calcul $type
 
 checkprops result -v 244837
+
+checknbshapes result -shell 1
index 0534b7aaa14e8e7f2f28f4eb9809130a33e18391..3913b2dc46a74efd16e444a662d5abcbad45932c 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_spike_shape.brep] s
 OFFSETSHAPE 10 {} $calcul $type
 
 checkprops result -v 4.30309e+008
+
+checknbshapes result -shell 1
index f938da40fb98d398d997dbc68434e385a0e4055e..11835a9897f2bcbea1910d7b0793cd05acd8e111 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_spike_shape.brep] s
 OFFSETSHAPE 15 {} $calcul $type
 
 checkprops result -v 4.79673e+008
+
+checknbshapes result -shell 1
index 5d1637d29f53191988065312fa4448b185573bda..3e6f5037ae98a1077ce638fd8fed15ed8359113f 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_undercut_1.brep] s
 OFFSETSHAPE 5 {} $calcul $type
 
 checkprops result -v 2.7823e+007
+
+checknbshapes result -shell 1
index f098aaf26f9855f9ce7e7f7b2e9c39cafbc6723a..415d4ecb0f5a2fa69ffc7032c941aa25aa5b181c 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_undercut_1.brep] s
 OFFSETSHAPE 15 {} $calcul $type
 
 checkprops result -v 3.89013e+007
+
+checknbshapes result -shell 1
index 4b9812c969b7bc3e6b8ba981ffb4722eb46ca115..fb943e8e1e29fd0738357659a7b598740e463368 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_undercut_1.brep] s
 OFFSETSHAPE 25 {} $calcul $type
 
 checkprops result -v 5.10815e+007
+
+checknbshapes result -shell 1
index d5dac57e50645d29b832f90f6aeca11c085150cf..09012703ac8dc8450387f6d02509244f68f50e91 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_undercut_1.brep] s
 OFFSETSHAPE 30 {} $calcul $type
 
 checkprops result -v 5.7548e+007
+
+checknbshapes result -shell 1
index e7cfa25c8628d89753e2df3b2672e9812bd8912f..5621a860f501934b3fc1e46a0728552f1ce4815a 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_undercut_1.brep] s
 OFFSETSHAPE 40 {} $calcul $type
 
 checkprops result -v 7.1364e+007
+
+checknbshapes result -shell 1
index b900d3ab1969adbccf0d7abc26ca97169e5dc459..53c6cc0be1594cd2f90c5100d77bf6232ca687d0 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_unit_cell_grid.brep] s
 OFFSETSHAPE 5 {} $calcul $type
 
 checkprops result -v 2.46039e+008
+
+checknbshapes result -shell 1
index f8928869edaea225b18c0a05066da301967f593d..cb449b50e4365114dd39e76a691e2a3474cb8268 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_unit_cell_grid.brep] s
 OFFSETSHAPE 10 {} $calcul $type
 
 checkprops result -v 2.8855e+008
+
+checknbshapes result -shell 1
index 2809ba67f1d2aca2aa97db39cfb51c1d999b4921..10f34e26579ab7ecbcd66769a105ce4f4aa491af 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_unit_cell_grid.brep] s
 OFFSETSHAPE 25 {} $calcul $type
 
 checkprops result -v 4.21733e+008
+
+checknbshapes result -shell 1
index 316b5820780c3434aea6cc5173bfec5b6c5ba3e5..00b7a6cb913af450c2494647c5fd86b23f89e191 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_unit_cell_grid.brep] s
 OFFSETSHAPE 30 {} $calcul $type
 
 checkprops result -v 4.67244e+008
+
+checknbshapes result -shell 1
index 24e0e3e918cc7bc627bf829fd4b4737ff82f905e..fb3cd5ea160f68b1ed2a056188e1499157dd85bf 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys.brep] s
 OFFSETSHAPE 10 {} $calcul $type
 
 checkprops result -v 2.5576e+007
+
+checknbshapes result -shell 1
index 384052d84df463c625d30b69eafb32bc9185bb1f..8b903937d12fe1e9dd3b6f265612c8dc0350149a 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys.brep] s
 OFFSETSHAPE 20 {} $calcul $type
 
 checkprops result -v 3.2592e+007
+
+checknbshapes result -shell 1
index 3917d1ca9c8d90527133a66451fb30dbfb37171d..390af5827a10ad337547da558dccac6bc4c43c76 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys.brep] s
 OFFSETSHAPE 25 {} $calcul $type
 
 checkprops result -v 3.6439e+007
+
+checknbshapes result -shell 1
index 7bac2207804e310c6ec9f9cceb95ebcaff27be2e..8f0a3beba266e904bc4bacf7903a86e68858cac6 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys.brep] s
 OFFSETSHAPE 50 {} $calcul $type
 
 checkprops result -v 5.9724e+007
+
+checknbshapes result -shell 1
index e0a4c3abf95d40a2005556d3da7d26ad9f7e4560..1a0d28e589954fcd4b495826022ce30d46e03ea7 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys_duplicated.brep] s
 OFFSETSHAPE 10 {} $calcul $type
 
 checkprops result -v 2.11792e+008
+
+checknbshapes result -shell 1
index c4b2f8f473a784ea37c608aad6f06a8674d581a5..fedeff36387f2c7e542bd6685069597bd96f7e22 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys_duplicated.brep] s
 OFFSETSHAPE 20 {} $calcul $type
 
 checkprops result -v 2.51328e+008
+
+checknbshapes result -shell 1
index fc141f8f2fc979a33a2aa04dc36b2c813d3fa594..77ccf1f31e2b801bac647707a06d8d136b44f61b 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys_duplicated.brep] s
 OFFSETSHAPE 30 {} $calcul $type
 
 checkprops result -v 2.93724e+008
+
+checknbshapes result -shell 1
index 76ba3b7a608ddf5e4dfab641a417a5a45b6be359..541bdca9d5d339d6247de90f6fbbf042c741a369 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys_duplicated.brep] s
 OFFSETSHAPE 50 {} $calcul $type
 
 checkprops result -v 3.89556e+008
+
+checknbshapes result -shell 1
index 9474cfb66fc729edb10f34581c1982f52023749b..693050f62cc75d8e1f7ffc5af33c3bc0ca88c712 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys_duplicated.brep] s
 OFFSETSHAPE 60 {} $calcul $type
 
 checkprops result -v 4.33344e+008
+
+checknbshapes result -shell 1
index da96cb47ebfda1a7d378164f28475dc8b001e0f0..add5c5723a79e17314c3c2e7e0dad7ebae45adfe 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_example_1_side_10_top_10.brep] s
 OFFSETSHAPE 10 {} $calcul $type
 
 checkprops result -v 9.6408e+007
+
+checknbshapes result -shell 1
index c2b868198b82494410401fbeb2018ad8516fb8a3..4de28badd2f268b52c8dcf3bb7a884fd5045c7ea 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_example_1_side_10_top_10.brep] s
 OFFSETSHAPE 15 {} $calcul $type
 
 checkprops result -v 1.07272e+008
+
+checknbshapes result -shell 1
index f8d2f949126db189068d1c7dcfae337546677558..50b799fc259547ffe6c3fe7c0f723eda32ea8cd8 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_example_2_side_26_top_0.brep] s
 OFFSETSHAPE 26 {} $calcul $type
 
 checkprops result -v 3.14983e+007
+
+checknbshapes result -shell 1
index 1ebd6dfa543a75f3750df0c370f9b62a1d440e96..3ea0bf6373b613515f993c9b989311c73cac26df 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_example_3_side_30_top_0.brep] s
 OFFSETSHAPE 35 {} $calcul $type
 
 checkprops result -v 8.08679e+007
+
+checknbshapes result -shell 1
index 93a24319eb4a0c48bb077e502b4f882f83c4f036..c4a203d4d2b71dd4cdcd5b823ffecd39a161570d 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_example_3_side_30_top_0.brep] s
 OFFSETSHAPE 45 {} $calcul $type
 
 checkprops result -v 9.51489e+007
+
+checknbshapes result -shell 1
index 6dec956c22cb302f601b60c9e2cbfd5a3ba7b8ba..6e065f0ad39c196b1509039e0210cbe43954f2f6 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_example_4_side_30_top_10.brep] s
 OFFSETSHAPE 35 {} $calcul $type
 
 checkprops result -v 4.8893e+007
+
+checknbshapes result -shell 1
index 66ce5b248668c701df78ab3f29f0eea8dc0c1635..600b746479e3e24fff10e3e83d59da875c08ef2e 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_example_4_side_30_top_10.brep] s
 OFFSETSHAPE 45 {} $calcul $type
 
 checkprops result -v 5.89638e+007
+
+checknbshapes result -shell 1
index 167b1b4cae0e584eaf1466dfbb375cbd0dd42ab3..e489ca483bb8279be8b26637c2dca3e3b5fb3918 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_b5.brep] s
 OFFSETSHAPE 2 {} $calcul $type
 
 checkprops result -v 4580.57
+
+checknbshapes result -shell 1
index 048cc029452aa0e7ac9769f92657373a13e65808..ed8ee938fe61ec5b4d5fd67b1b6f47805a2aae3f 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_b5.brep] s
 OFFSETSHAPE 11 {} $calcul $type
 
 checkprops result -v 43008
+
+checknbshapes result -shell 1
index 3a73185ce1f89c6649a3f7e75b26e4db5b1c38dc..93e5a590272a5fb804ab6362c4f1342ee879cfa8 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_b1x.brep] s
 OFFSETSHAPE 2 {} $calcul $type
 
 checkprops result -v 1756.4
+
+checknbshapes result -shell 1
index 047541ac8c8ee828c7b4a8e19b3dc364e9a0e901..757c543e343f9b8368d2f8d1ad0fbbbadc852531 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_b1x.brep] s
 OFFSETSHAPE 5 {} $calcul $type
 
 checkprops result -v 6000
+
+checknbshapes result -shell 1
index 6f450654d466cfaf97664fca1e21507655f8444f..ad1fb6c7bf7d784e1119c2bf45ab98b812987e99 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_b1.brep] s
 OFFSETSHAPE 1 {} $calcul $type
 
 checkprops result -v 5328
+
+checknbshapes result -shell 1
index cbf3d795485bfa2077a0199a51fdabf87fc9e444..a079fb6510425be66fe52385987db2c9b1539d53 100644 (file)
@@ -5,3 +5,5 @@ prism s f 0 5 0
 OFFSETSHAPE 0.6 {} $calcul $type
 
 checkprops result -v 216.363
+
+checknbshapes result -shell 1
index e60c1a998a8467291e2ea46cf3554c99343ac94c..7d0bcb68595dc31b5c3427e0c554880d0d224149 100644 (file)
@@ -5,3 +5,5 @@ prism s f 0 5 0
 OFFSETSHAPE 1.2 {} $calcul $type
 
 checkprops result -v 394.982
+
+checknbshapes result -shell 1
index 9a3f0396761e8956115f942934c0e0acae921e0e..66ddcbee88302e2e750794a02a9c8d351b61e6b2 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_parasite_solid.brep] s
 OFFSETSHAPE 1 {} $calcul $type
 
 checkprops result -v 1450.99
+
+checknbshapes result -shell 1
index 644b5b550697cdc60d8ac68afa9bbb9ac36ecf26..83f87ff592a3ddb9b78387f9fab6ec727f3ed269 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_parasite_solid_s.brep] s
 OFFSETSHAPE 1 {} $calcul $type
 
 checkprops result -v 1304.43
+
+checknbshapes result -shell 1
index 88e1f41a1032240d13df4f08196937d4d450ad8a..a423723917c74dc1b26583f2ce0b562e899b6ae3 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_parasite_solid_s2.brep] s
 OFFSETSHAPE 1 {} $calcul $type
 
 checkprops result -v 1217.22
+
+checknbshapes result -shell 1
index 3d95d888b5f0c304aca4065de822c07a5d494aac..90a8cba22cb8b99f136a44cd6478b98847436280 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_parasite_solid_s2.brep] s
 OFFSETSHAPE 5 {} $calcul $type
 
 checkprops result -v 10761.4
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/J1 b/tests/offset/shape_type_i_c/J1
new file mode 100644 (file)
index 0000000..007206f
--- /dev/null
@@ -0,0 +1,17 @@
+restore [locate_data_file bug25926_input_slanted.brep] s
+
+set distance 1
+offsetparameter 1.e-7 $calcul $type
+offsetload s $distance
+explode s f
+# s_15 s_22
+offsetonface s_15 6
+offsetonface s_22 6
+offsetperform result
+
+checkprops result -v 1.87868e+007 -s 627294
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 24 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
index a2957ee33e3652628a63a2ab97c3aef55fd6ef5d..989a750547e3c96eddb4b92be058b62cd9ce3f14 100644 (file)
@@ -14,3 +14,5 @@ offsetonface s_14 0
 offsetperform result
 
 checkprops result -v 2.07856e+007
+
+checknbshapes result -shell 1
index 5ff30f3ea85026b3e347ad65203254b37846bf7e..cc9c670b3c45a3621d4e9ab470c69fb3587c37e3 100644 (file)
@@ -14,3 +14,5 @@ offsetonface s_14 0
 offsetperform result
 
 checkprops result -v 3.0278e+007
+
+checknbshapes result -shell 1
index c82122962a1d499aba169bbe72123354e3734623..d731f47e608c2d996de8232d5242bc7b844a2224 100644 (file)
@@ -14,3 +14,5 @@ offsetonface s_14 0
 offsetperform result
 
 checkprops result -v 3.2025e+007
+
+checknbshapes result -shell 1
index 4fcc4be34ff4668bb01ecf51211ae1d9af87e51a..b28bbf88e223ccdd1458a9fe45ca309bdad773dd 100644 (file)
@@ -14,3 +14,5 @@ offsetonface s_14 0
 offsetperform result
 
 checkprops result -v 3.5008e+007
+
+checknbshapes result -shell 1
index f133364e2998e1037c7ab3808347e6a0fad86f39..55f36f01138bf651544f50208791c99e86218115 100644 (file)
@@ -14,3 +14,5 @@ offsetonface s_26 0
 offsetperform result
 
 checkprops result -v 6.34674e+007
+
+checknbshapes result -shell 1
index 7528a994abe46c47bc1a60d846f4b091bea47fcb..b051724d5563233cad6fdb0e39aacb969e9db616 100644 (file)
@@ -14,3 +14,5 @@ offsetonface s_26 0
 offsetperform result
 
 checkprops result -v 7.63414e+007
+
+checknbshapes result -shell 1
index bab727e502903a53c9346bdaf0c109ef87fc2b68..e080207d6f4e57f771602b20f28bae409ec3c51b 100644 (file)
@@ -14,3 +14,5 @@ offsetonface s_26 0
 offsetperform result
 
 checkprops result -v 7.8625e+007
+
+checknbshapes result -shell 1
index 62e87121d0c14caf0de161c316178054c4cdd397..01f2389fb82050889bf5c2c986d4bf1a7a28059f 100644 (file)
@@ -14,3 +14,5 @@ offsetonface s_26 0
 offsetperform result
 
 checkprops result -v 8.2464e+007
+
+checknbshapes result -shell 1
index e98d5b5114ba0326e23d466192f185094f89280e..423c94466da46fcd43ba770800635ac17c69a585 100644 (file)
@@ -9,3 +9,5 @@ offsetonface s_3 50
 offsetperform result
 
 checkprops result -v 250676
+
+checknbshapes result -shell 1
index a0aa004d480d4be06fa3aceecfdf7d9b2747a350..0f378adfb1947678dd98f8b172e20443a8eeca2e 100644 (file)
@@ -9,3 +9,5 @@ offsetonface s_3 20
 offsetperform result
 
 checkprops result -v 250644
+
+checknbshapes result -shell 1
index 69f959c1e7e84424dfc962ec411e72f17ef89e97..59f82dc04ff51c3536225852fb883fe0cace2608 100644 (file)
@@ -10,3 +10,5 @@ offsetonface s_9 15
 offsetperform result
 
 checkprops result -v 269568
+
+checknbshapes result -shell 1
index eb87cdcc0f50a471f6f202e62c95204826de37ac..302fe9dfd23b2682cd1ff7510e120c6e1f114098 100644 (file)
@@ -10,3 +10,5 @@ offsetonface s_9 20
 offsetperform result
 
 checkprops result -v 269568
+
+checknbshapes result -shell 1
index c97a0579957e677ecfba5d04ade4310d2006a5b8..5a7c2f0678e434a3d270894d4b565e28f3a8f5a4 100644 (file)
@@ -10,3 +10,5 @@ offsetonface s_9 10
 offsetperform result
 
 checkprops result -v 263968
+
+checknbshapes result -shell 1
index 0a45cc9c5edf2799a29d1fa313600aadc91c4a5c..d17b303c2e52021ea035f35c9193ddc5334f709d 100644 (file)
@@ -3,3 +3,5 @@ restore  [locate_data_file bug25926_before_offset_small.brep] s
 OFFSETSHAPE 10 {} $calcul $type
 
 checkprops result -v 1.30684e+007
+
+checknbshapes result -shell 1
index 00c1fece1e19cf3e6c18815c20079d10dd2584e6..1c232aa0f0549d973cd7cb97fe1fda8a795ca682 100644 (file)
@@ -3,3 +3,5 @@ restore  [locate_data_file bug25926_before_offset_small.brep] s
 OFFSETSHAPE 30 {} $calcul $type
 
 checkprops result -v 2.20372e+007
+
+checknbshapes result -shell 1
index 7a1279ddf3964b87ffba52357cac1fb5625fcd4b..7adc08fecbfd2972562b6b5f941d4c725e2ff7cf 100644 (file)
@@ -3,3 +3,5 @@ restore  [locate_data_file bug25926_before_offset.brep] s
 OFFSETSHAPE 10 {} $calcul $type
 
 checkprops result -v 1.90913e+008
+
+checknbshapes result -shell 1
index f2b8e5cb63de7238f3ebee24b7cfd7efd7bf2a8c..d12e87d13b098d641fcb87554353ac8dd71636a6 100644 (file)
@@ -3,3 +3,5 @@ restore  [locate_data_file bug25926_before_offset.brep] s
 OFFSETSHAPE 50 {} $calcul $type
 
 checkprops result -v 3.68672e+008
+
+checknbshapes result -shell 1
index 9390a7a9faff47a24d35c19e443f10614a1cb42b..77aac7eb76fd0be7edede308ca1df0052d92375f 100644 (file)
@@ -3,3 +3,5 @@ restore  [locate_data_file bug25926_before_offset.brep] s
 OFFSETSHAPE 5 {} $calcul $type
 
 checkprops result -v 1.71595e+008
+
+checknbshapes result -shell 1
index 58a529ff11794229c2dc81826eb71a538459a2b5..b6438515e3e0b42cef68334e96cfa73684ce5b03 100644 (file)
@@ -9,3 +9,5 @@ offsetonface s_8 12
 offsetperform result
 
 checkprops result -v 20944
+
+checknbshapes result -shell 1
index 0a2f6443bb69a49e3ca2e34e692af82c78116f72..6527b8fa0ff1097ac326a88d41389f46ac72e3cc 100644 (file)
@@ -8,4 +8,7 @@ explode s f
 offsetonface s_8 15
 offsetperform result
 
-checkprops result -v 21364
+checkprops result -v 20944
+checkprops result -s 5176
+
+checknbshapes result -shell 1
index 0ebc9a8f590674a725e400e6afdc0a5caeba4d2f..939e329de077d3093b75780cf64abde3b1a740ea 100644 (file)
@@ -3,3 +3,5 @@ restore  [locate_data_file bug25926_box_cut_box.brep] s
 OFFSETSHAPE 5 {} $calcul $type
 
 checkprops result -v 32000
+
+checknbshapes result -shell 1
index affc3eed03b47e0ebb63eaf3f46305eae7e3421f..72b8740adbb13e8808d45eb0f1c73acb2efd7c79 100644 (file)
@@ -9,3 +9,5 @@ offsetonface s_8 -12
 offsetperform result
 
 checkprops result -v 15164
+
+checknbshapes result -shell 1
index 2d01e26a71fb5a59672c1a7cd38617fef6c55667..c5be7159c7cdd5016a69544bb9ab3caa24199999 100644 (file)
@@ -9,3 +9,5 @@ offsetonface s_8 -15
 offsetperform result
 
 checkprops result -v 15164
+
+checknbshapes result -shell 1
index 613c53f5cff9f4f63870d83815bba2b652b0ff74..7429ec91771864eaac7e4a3b728630f2dcd10598 100644 (file)
@@ -9,3 +9,5 @@ offsetonface s_8 -8
 offsetperform result
 
 checkprops result -v 2236
+
+checknbshapes result -shell 1
index 04ce0661beff1e28a5c3c4303455929135938767..571d237e1b2ad261a8f28b25f5f5b88b4c31d760 100644 (file)
@@ -9,3 +9,5 @@ offsetonface s_8 -10
 offsetperform result
 
 checkprops result -v 2236
+
+checknbshapes result -shell 1
index 1d7c9d71e57896d2b7c2c57d18cb791e40705809..bf967a282cfc6ab76c200507cd9518ef281e5031 100644 (file)
@@ -6,3 +6,5 @@ offsetload s $distance
 offsetperform result
 
 checkprops result -v 53629.1
+
+checknbshapes result -shell 1
index 8f2b71145a127c5b46f235ef927e5f5366ecb39a..0390687463dd0c84efcdbf4db148f45c422bf08c 100644 (file)
@@ -6,3 +6,5 @@ offsetload s $distance
 offsetperform result
 
 checkprops result -v 5.61324e+006
+
+checknbshapes result -shell 1
index a29b8ca5e7f47f47e05124c5ee4cd23ece81ffe0..b9121d41080b1dfdee98fb585afdc7b07dfca7b6 100644 (file)
@@ -6,3 +6,5 @@ offsetload s $distance
 offsetperform result
 
 checkprops result -v 4.1141e+006
+
+checknbshapes result -shell 1
index 867a4a18cea7351b7aca07d4c6743157757cebb6..256c1ee1226527786d7eb161f1ec9a9bb945efb9 100644 (file)
@@ -7,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 2.23108e+007
+checkprops result -v 2.22969e+007
+
+checknbshapes result -shell 1
index 19b56e02bf05512caf2c704cbda8e88436e536a1..da125708447397941ad9419d3097ab2efe7cfefa 100644 (file)
@@ -7,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 3.23447e+007
+checkprops result -v 3.23389e+007
+
+checknbshapes result -shell 1
index 9ebaaac150f01b275942537e95959779a20821d6..38631f3f8b40a951c9a9700adfd375043a52d527 100644 (file)
@@ -7,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 3.92994e+007
+checkprops result -v 3.92878e+007
+
+checknbshapes result -shell 1
index 39d3a3de23b835e74c91caecbbace40a396e11e7..903a065eeafd3e535c11aa387f90b51c9f2316b6 100644 (file)
@@ -7,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 4.37968e+007
+checkprops result -v 4.37572e+007
+
+checknbshapes result -shell 1
index 507c5015e029f444537e086fb3850f2f9cfcfc5a..f61e62aca89b18db09ac84fc07281fc3f9976237 100644 (file)
@@ -5,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 2.23108e+007
+checkprops result -v 2.22969e+007
+
+checknbshapes result -shell 1
index 1f6394fa069017cab301630d390b7ad8146b0ee7..10e5e2ba822ad1f128a7fc11c50a2c949b8bd108 100644 (file)
@@ -5,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 3.23447e+007
+checkprops result -v 3.23389e+007
+
+checknbshapes result -shell 1
index c52a6f2c097ee06256f1269a425a7b553aba7fc7..0fb1a0b442e954eb71d385c3904dce131f10cc8f 100644 (file)
@@ -5,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 3.92994e+007
+checkprops result -v 3.92878e+007
+
+checknbshapes result -shell 1
index a6bd3cbda2e33a8f222e84f82737d2345ae213c0..c934c162126b2e9c3324a0f0b9e74454c6918a76 100644 (file)
@@ -5,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 4.37968e+007
+checkprops result -v 4.37572e+007
+
+checknbshapes result -shell 1
index 006e743766bf6c60959a05a0fd19617e42561670..538c099bf363786b98aa7a8eaa01ebf2e79894e5 100644 (file)
@@ -7,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 2.19752e+007
+checkprops result -v 2.19753e+007
+
+checknbshapes result -shell 1
index b984d593eb951e2bff5f0812416bce9fea89354b..77f7c9dd6c95225feeff108f52cd18c2ad382cb5 100644 (file)
@@ -7,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 2.97224e+007
+checkprops result -v 2.97225e+007
+
+checknbshapes result -shell 1
index 773400f84a791eb4cc94e241838bde681b306d5a..6259221e252ab302ee8cbf459bc271ca8b7d48d9 100644 (file)
@@ -7,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 3.46916e+007
+checkprops result -v 3.46903e+007
+
+checknbshapes result -shell 1
index b975ea9f41cce75e2932564b531ce9e072b6ecd8..739d9529150ed3866824aada1b8b1e70315bdb17 100644 (file)
@@ -7,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 3.77839e+007
+checkprops result -v 3.77821e+007
+
+checknbshapes result -shell 1
index b55b9347c106e8da48a02d1d22883d16db124ec1..8319f060841f49a28b75c3743684d0786bce705e 100644 (file)
@@ -5,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 2.19752e+007
+checkprops result -v 2.19753e+007
+
+checknbshapes result -shell 1
index afa5e5381a532ae35c7e33c370eb4c8b4d3382f9..0e3b1aa0688fc762dd7877c0b9ee06f61fef501a 100644 (file)
@@ -5,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 2.97224e+007
+checkprops result -v 2.97225e+007
+
+checknbshapes result -shell 1
index 3edd941955c2dcf4eb24d3081c8d534aa38aeccb..ed45389386a14635863b528a1d2bed22b1478303 100644 (file)
@@ -5,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 3.46916e+007
+checkprops result -v 3.46903e+007
+
+checknbshapes result -shell 1
index 15734ce7ae76bdcb29f3fcf499bef6f65df167b6..cbafb88a4a9ba480ea8ca9c9a3c836fec102ff1d 100644 (file)
@@ -5,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 3.77839e+007
+checkprops result -v 3.77821e+007
+
+checknbshapes result -shell 1
index 26a101957dc6378a36235778234654c29fff7d0e..0b4df9059758acc9a862d4b6b99e4ae9fab2a767 100644 (file)
@@ -5,4 +5,9 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 814270
+checkprops result -v 815237 -s 72583.4
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 17
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
index 1201c78e2c02f45fd356add703d70df41904eef7..d7efa769ac81b3184eafe13bac53c9086eb7c74a 100644 (file)
@@ -5,4 +5,9 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 883901
+checkprops result -v 885485 -s 67848.9
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 17
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
index 5e567acffdb2d4c2d66889830a7b6a92e1d403fa..72301424f979339bb37f19493f633f43b158c40d 100644 (file)
@@ -5,4 +5,9 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 1.14694e+006
+checkprops result -v 1.14221e+006 -s 66668.3
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 10
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
index a9a473130e3c9d654edcc7928b361491810e56d0..a6ba7cb914b0990fdaeb8c733f562ce14de2e204 100644 (file)
@@ -1,5 +1,3 @@
-puts "TODO CR25926 ALL: Error : The volume of result shape is"
-
 restore [locate_data_file bug25926_issue22_trimmed.brep] s
 
 set distance 5
@@ -7,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 0
+checkprops result -v 448800
+
+checknbshapes result -shell 1
index f20fb90547522fd78cb13526f1ed907fdb22209d..a90400a22b810f52b34900164434770001a470a3 100644 (file)
@@ -1,5 +1,3 @@
-puts "TODO CR25926 ALL: Error : The volume of result shape is"
-
 restore [locate_data_file bug25926_input.brep] s
 
 set distance 5
@@ -7,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 0
+checkprops result -v 1.9741e+007
+
+checknbshapes result -shell 1
index f7f19ca12bf5fcc68fc870a4d686d485f566af3b..65edaca854d30f5ff3dbaaae256e48569189ced2 100644 (file)
@@ -6,3 +6,5 @@ offsetload s $distance
 offsetperform result
 
 checkprops result -v 7.9433e+007
+
+checknbshapes result -shell 1
index fbe4e9497b3b92c72b093445332b1d73a395a3cb..f8c5021333a0daabccc57c93a8258e172456c700 100644 (file)
@@ -6,3 +6,5 @@ offsetload s $distance
 offsetperform result
 
 checkprops result -v 8.99282e+007
+
+checknbshapes result -shell 1
index 4fd1c02993808bb410aba787f5861b238c09919c..edcb51ef24a9740235c56277bcd5115d60565424 100644 (file)
@@ -1,6 +1,3 @@
-puts "TODO CR25926 ALL: Error : The volume of result shape is"
-puts "TODO CR25926 ALL: Faulty shapes in variables faulty_"
-
 polyline p 0 0 0 10 0 0 10 0 7 6 0 7 6 0 3 5 0 5 0 0 5 0 0 0
 mkplane f p
 prism s f 0 10 0
@@ -10,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 0
+checkprops result -v 3136
+
+checknbshapes result -shell 1
index c6f9f4189d82b62c1339945614a2b8501b851b0b..670c9f11104b7d710b57a5476255b398a0fdef5b 100644 (file)
@@ -1,5 +1,3 @@
-puts "TODO CR25926 ALL: Error : The volume of result shape is"
-
 polyline p 0 0 0 10 0 0 10 0 7 6 0 7 6 0 3 5 0 5 0 0 5 0 0 0
 mkplane f p
 prism s f 0 10 0
@@ -9,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type
 offsetload s $distance
 offsetperform result
 
-checkprops result -v 0
+checkprops result -v 1152
+
+checknbshapes result -shell 1
index 847ed00bd92520c6e35fa4583a50cf32cc5dd257..518c2e20847bd23684ab405196e81ace19f43468 100644 (file)
@@ -1,5 +1,3 @@
-puts "TODO CR25926 ALL: Error : The volume of result shape is"
-
 polyline p 0 0 0 4 0 0 4 0 3 3 0 3 2 0 1 1 0 3 0 0 3 0 0 0
 mkplane f p
 prism s f 0 1 0
@@ -10,3 +8,5 @@ offsetload s $distance
 offsetperform result
 
 checkprops result -v 1188
+
+checknbshapes result -shell 1
index da1bfb243f90bb5d547c8ad773bf72d35855e917..639b4e66491e427683fc8f80b39705d3b48f5464 100644 (file)
@@ -1,5 +1,3 @@
-puts "TODO CR25926 ALL: Error : The volume of result shape is"
-
 polyline p 0 0 0 3 0 0 3 0 1 2 0 1 1 0 4 1 0 5 0 0 5 0 0 0
 mkplane f p
 prism s f 0 1 0
@@ -11,4 +9,6 @@ explode s f
 offsetonface s_4 2
 offsetperform result
 
-checkprops result -v 0
+checkprops result -v 94.2982
+
+checknbshapes result -shell 1
index 8cb82a60dedb4edab79779989a6a8841155a9b4c..5d05747bd5ff4ad169227d50cc4c11749e6e478a 100644 (file)
@@ -1,5 +1,3 @@
-puts "TODO CR25926 ALL: Error : The volume of result shape is"
-
 polyline p 0 0 0 2 0 0 2 0 1 1 0 1 1 0 2 0 0 2 0 0 0
 mkplane f p
 prism s f 0 1 0
@@ -11,4 +9,6 @@ explode s f
 offsetonface s_4 3
 offsetperform result
 
-checkprops result -v 0
+checkprops result -v 60
+
+checknbshapes result -shell 1
index 2a2eb74536bddd7f7cf2ad953b8092be9ae969ca..a39d3054a32989137fa1260ebea4ccab86baa852 100644 (file)
@@ -6,3 +6,5 @@ offsetload s $distance
 offsetperform result
 
 checkprops result -v 4.9414e+007
+
+checknbshapes result -shell 1
index 55b47c27fb528e06d9ca0e130265bc1d23d6b668..2b0a5ee45a9d54f179f64b37cc9ebe378c5895cc 100644 (file)
@@ -6,3 +6,5 @@ offsetload s $distance
 offsetperform result
 
 checkprops result -v 4.9414e+007
+
+checknbshapes result -shell 1
index f22fcef9ffcc60b8b265b71544126e8f7f82c685..f3ebe86af2374138eb52f296ad504a0d58d71890 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_TC503.61.t3_c0.input.brep] s
 OFFSETSHAPE 15 {} $calcul $type
 
 checkprops result -v 1.79632e+009
+
+checknbshapes result -shell 1
index 76a06166cc357fd25b17504742d57aae67b41c89..b9284c46a1b90fa9104e8747e6a5bb55d1dfb119 100644 (file)
@@ -3,3 +3,5 @@ restore [locate_data_file bug25926_TC503.51.t10_c0.input.brep] s
 OFFSETSHAPE 15 {} $calcul $type
 
 checkprops result -v 1.17632e+009
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/P8 b/tests/offset/shape_type_i_c/P8
new file mode 100644 (file)
index 0000000..278e3aa
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug25926_before_offset_trim1.brep] s
+
+OFFSETSHAPE 50 {} $calcul $type
+
+checkprops result -v 3.61993e+007
+checkprops result -s 696458
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/P9 b/tests/offset/shape_type_i_c/P9
new file mode 100644 (file)
index 0000000..68230d4
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_double_cave.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 2088
+checkprops result -s 1092
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Q1 b/tests/offset/shape_type_i_c/Q1
new file mode 100644 (file)
index 0000000..be4d566
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug27139_offset_shape_input.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 2.40965e+007 -s 1.24031e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Q2 b/tests/offset/shape_type_i_c/Q2
new file mode 100644 (file)
index 0000000..55e729f
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug27139_offset_shape_input_trim1.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 133958
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Q3 b/tests/offset/shape_type_i_c/Q3
new file mode 100644 (file)
index 0000000..5fe56f8
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug27139_offset_shape_input_trim2.brep] s
+
+OFFSETSHAPE 6 {} $calcul $type
+
+checkprops result -v 142685
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Q4 b/tests/offset/shape_type_i_c/Q4
new file mode 100644 (file)
index 0000000..5b67e8a
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug27139_offset_shape_input_trim3.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 1.19774e+007
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Q5 b/tests/offset/shape_type_i_c/Q5
new file mode 100644 (file)
index 0000000..2354528
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug27139_offset_shape_input_trim4.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 6.27981e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Q6 b/tests/offset/shape_type_i_c/Q6
new file mode 100644 (file)
index 0000000..38fc8ea
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug27139_offset_shape_input_trim5.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 37703
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Q7 b/tests/offset/shape_type_i_c/Q7
new file mode 100644 (file)
index 0000000..7325890
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug27139_offset_shape_input_trim6.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 1.2636e+007 -s 683604
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Q8 b/tests/offset/shape_type_i_c/Q8
new file mode 100644 (file)
index 0000000..ac094db
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug27139_offset_shape_input_trim7.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 8.87399e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Q9 b/tests/offset/shape_type_i_c/Q9
new file mode 100755 (executable)
index 0000000..e52a699
--- /dev/null
@@ -0,0 +1,14 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+restore [locate_data_file bug25926_offset_shape_trim3.brep]  s
+
+OFFSETSHAPE 12 {} $calcul $type
+
+checkprops result -v 948181 -s 66208.6 
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 14
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/R1 b/tests/offset/shape_type_i_c/R1
new file mode 100644 (file)
index 0000000..00b799f
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim1.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.22616e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/R2 b/tests/offset/shape_type_i_c/R2
new file mode 100644 (file)
index 0000000..746a3ef
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim2.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 852586
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/R3 b/tests/offset/shape_type_i_c/R3
new file mode 100644 (file)
index 0000000..9adae6f
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim3.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 844221
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/R4 b/tests/offset/shape_type_i_c/R4
new file mode 100644 (file)
index 0000000..66aa820
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim4.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.83245e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/R5 b/tests/offset/shape_type_i_c/R5
new file mode 100644 (file)
index 0000000..ebff140
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim5.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.10872e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/R6 b/tests/offset/shape_type_i_c/R6
new file mode 100644 (file)
index 0000000..93973b0
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim6.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 2.55029e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/R7 b/tests/offset/shape_type_i_c/R7
new file mode 100644 (file)
index 0000000..f98521a
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_M2_trim7.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.70906e+006 -s 119883
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 35
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/R8 b/tests/offset/shape_type_i_c/R8
new file mode 100644 (file)
index 0000000..06fe99c
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim8.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.66234e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/R9 b/tests/offset/shape_type_i_c/R9
new file mode 100644 (file)
index 0000000..b664e99
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim9.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.34317e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/S1 b/tests/offset/shape_type_i_c/S1
new file mode 100644 (file)
index 0000000..6bd1cba
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim10.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v  1.66075e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/S2 b/tests/offset/shape_type_i_c/S2
new file mode 100644 (file)
index 0000000..8df6378
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim11.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.34579e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/S3 b/tests/offset/shape_type_i_c/S3
new file mode 100644 (file)
index 0000000..5f2496d
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim12.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.1369e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/S4 b/tests/offset/shape_type_i_c/S4
new file mode 100644 (file)
index 0000000..fc74979
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim13.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.01996e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/S5 b/tests/offset/shape_type_i_c/S5
new file mode 100644 (file)
index 0000000..2aee116
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim14.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 762358
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/S6 b/tests/offset/shape_type_i_c/S6
new file mode 100644 (file)
index 0000000..44ff4b1
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim15.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 634826
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/S7 b/tests/offset/shape_type_i_c/S7
new file mode 100644 (file)
index 0000000..ab1f41d
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim16.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 514470
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/S8 b/tests/offset/shape_type_i_c/S8
new file mode 100644 (file)
index 0000000..39359fa
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim17.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 397694
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/S9 b/tests/offset/shape_type_i_c/S9
new file mode 100644 (file)
index 0000000..c4cfd27
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim18.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 280542
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/T1 b/tests/offset/shape_type_i_c/T1
new file mode 100644 (file)
index 0000000..7b49eee
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_M2_trim19.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.241e+006 -s 83210.4
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 31
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/T2 b/tests/offset/shape_type_i_c/T2
new file mode 100644 (file)
index 0000000..36d83dc
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim20.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.24613e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/T3 b/tests/offset/shape_type_i_c/T3
new file mode 100644 (file)
index 0000000..8df33ba
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim21.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.01973e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/T4 b/tests/offset/shape_type_i_c/T4
new file mode 100644 (file)
index 0000000..cf47534
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim22.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 885418
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/T5 b/tests/offset/shape_type_i_c/T5
new file mode 100644 (file)
index 0000000..7948fd9
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim23.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 96390.1
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/T6 b/tests/offset/shape_type_i_c/T6
new file mode 100644 (file)
index 0000000..d4d40a7
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim24.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.66075e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/T7 b/tests/offset/shape_type_i_c/T7
new file mode 100644 (file)
index 0000000..8639996
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim25.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 762358
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/T8 b/tests/offset/shape_type_i_c/T8
new file mode 100644 (file)
index 0000000..60cbf8a
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim26.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 634826
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/T9 b/tests/offset/shape_type_i_c/T9
new file mode 100644 (file)
index 0000000..964fb76
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim27.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 397694
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/U1 b/tests/offset/shape_type_i_c/U1
new file mode 100644 (file)
index 0000000..5cfed63
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_M2_trim28.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 197766 -s 32157.1
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 14
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/U2 b/tests/offset/shape_type_i_c/U2
new file mode 100644 (file)
index 0000000..96b0848
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim29.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 114117
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/U3 b/tests/offset/shape_type_i_c/U3
new file mode 100644 (file)
index 0000000..4b7422f
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim30.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 95219.5
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/U4 b/tests/offset/shape_type_i_c/U4
new file mode 100644 (file)
index 0000000..11f80ca
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim31.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 310499
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/U5 b/tests/offset/shape_type_i_c/U5
new file mode 100644 (file)
index 0000000..d4aa7f5
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim32.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.05429e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/U6 b/tests/offset/shape_type_i_c/U6
new file mode 100755 (executable)
index 0000000..50afd71
--- /dev/null
@@ -0,0 +1,16 @@
+##puts "TODO OCC27414 ALL: Error : The volume of result shape is"
+##puts "TODO OCC27414 ALL: Error : The area of result shape is"
+##puts "TODO OCC27414 ALL: Faulty shapes in variables faulty_"
+##puts "TODO OCC27414 ALL: Error : The area of face"
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_M2_trim33.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 0
+checkprops result -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/U7 b/tests/offset/shape_type_i_c/U7
new file mode 100644 (file)
index 0000000..633618d
--- /dev/null
@@ -0,0 +1,12 @@
+puts "TODO OCC27414 ALL: Error : The volume of result shape is"
+puts "TODO OCC27414 ALL: Error : The area of result shape is"
+
+restore [locate_data_file bug26917_M2_trim34.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+# real volume is 255962 
+checkprops result -v 0
+checkprops result -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/U8 b/tests/offset/shape_type_i_c/U8
new file mode 100644 (file)
index 0000000..3851883
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim35.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 201004
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/U9 b/tests/offset/shape_type_i_c/U9
new file mode 100644 (file)
index 0000000..05aba95
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim36.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 66256.1
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/V1 b/tests/offset/shape_type_i_c/V1
new file mode 100644 (file)
index 0000000..b4751ff
--- /dev/null
@@ -0,0 +1,9 @@
+polyline p 4 0 0 10 0 0 10 0 10 8 0 10 8 0 4 6 0 4 6 0 6 4 0 6 4 0 0
+mkplane f p
+prism s f 0 5 0
+
+OFFSETSHAPE 2 {} $calcul $type
+
+checkprops result -v 1116
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/V2 b/tests/offset/shape_type_i_c/V2
new file mode 100644 (file)
index 0000000..caf252a
--- /dev/null
@@ -0,0 +1,15 @@
+polyline p 4 0 0 10 0 0 10 0 10 8 0 10 8 0 4 6 0 4 6 0 6 4 0 6 4 0 0
+mkplane f p
+prism s1 f 0 5 0
+polyline p 6 0 4 6 5 4 6 2.5 5 6 0 4
+mkplane f p
+prism s2 f 2 0 0
+bfuse s s1 s2
+explode s so; copy s_1 s
+donly s
+
+OFFSETSHAPE 2 {} $calcul $type
+
+checkprops result -v 1116
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/V3 b/tests/offset/shape_type_i_c/V3
new file mode 100644 (file)
index 0000000..f4be41e
--- /dev/null
@@ -0,0 +1,16 @@
+polyline p 4 0 0 10 0 0 10 0 10 8 0 10 8 0 4 6 0 4 6 0 6 4 0 6 4 0 0
+mkplane f p
+prism s1 f 0 5 0
+polyline p 6 0 4 6 5 4 6 2.5 3 6 0 4
+mkplane f p
+prism s2 f 2 0 0
+bcut s s1 s2
+explode s so; copy s_1 s
+unifysamedom s s
+donly s
+
+OFFSETSHAPE 2 {} $calcul $type
+
+checkprops result -v 1116
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/V4 b/tests/offset/shape_type_i_c/V4
new file mode 100644 (file)
index 0000000..c43abc2
--- /dev/null
@@ -0,0 +1,13 @@
+polyline p 0 0 0 5 0 0 5 0 3 3 0 3 3 0 5 0 0 5 0 0 0
+mkplane f p
+prism s f 0 5 0
+explode s f
+donly s
+offsetparameter 1e-7 c i 
+offsetload s 1 
+offsetonface s_4 5
+offsetperform result
+
+checkprops result -v 441
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/V5 b/tests/offset/shape_type_i_c/V5
new file mode 100644 (file)
index 0000000..1a0784b
--- /dev/null
@@ -0,0 +1,13 @@
+box b1 10 10 4
+polyline p 0 0.5 4 0 2.5 4 10 9.5 4 10 7.5 4 0 0.5 4
+mkplane f p
+prism b2 f 0 0 4
+bfuse s b1 b2
+unifysamedom s s
+donly s
+
+OFFSETSHAPE 3 {} $calcul $type
+
+checkprops result -v 3229.82
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/V6 b/tests/offset/shape_type_i_c/V6
new file mode 100644 (file)
index 0000000..ec0ca64
--- /dev/null
@@ -0,0 +1,12 @@
+restore [locate_data_file bug26917_b1_slanted.brep] s
+explode s f
+donly s
+offsetparameter 1e-7 c i
+offsetload s 1
+offsetonface s_8 3
+offsetonface s_10 3
+offsetperform result
+
+checkprops result -v 1007.8
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/V7 b/tests/offset/shape_type_i_c/V7
new file mode 100644 (file)
index 0000000..5c24465
--- /dev/null
@@ -0,0 +1,12 @@
+box b1 10 6 10
+polyline p 2 0 5  2 2 5  2 3 3  2 3 10 2 0 10  2 0 5
+mkplane f p
+prism b2 f 6 0 0
+bcut s b1 b2
+donly s
+
+OFFSETSHAPE 2.5 {} $calcul $type
+
+checkprops result -v 2460
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/V8 b/tests/offset/shape_type_i_c/V8
new file mode 100644 (file)
index 0000000..cad6c4d
--- /dev/null
@@ -0,0 +1,12 @@
+box b1 10 6 10
+polyline p 2 0 5  2 2 5  2 3 3  2 3 10 2 0 10  2 0 5
+mkplane f p
+prism b2 f 6 0 0
+bcut s b1 b2
+donly s
+
+OFFSETSHAPE 4 {} $calcul $type
+
+checkprops result -v 4536
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/V9 b/tests/offset/shape_type_i_c/V9
new file mode 100644 (file)
index 0000000..f05d780
--- /dev/null
@@ -0,0 +1,12 @@
+box b1 10 6 10
+polyline p 2 0 5  2 2 5  2 2.5 3  2 3 5  2 3 10 2 0 10  2 0 5
+mkplane f p
+prism b2 f 6 0 0
+bcut s b1 b2
+donly s
+
+OFFSETSHAPE 2.5 {} $calcul $type
+
+checkprops result -v 2460
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/W1 b/tests/offset/shape_type_i_c/W1
new file mode 100644 (file)
index 0000000..d601f87
--- /dev/null
@@ -0,0 +1,12 @@
+box b1 10 6 10
+polyline p 2 0 5  2 2 5  2 2.5 3  2 3 5  2 3 10 2 0 10  2 0 5
+mkplane f p
+prism b2 f 6 0 0
+bcut s b1 b2
+donly s
+
+OFFSETSHAPE 4 {} $calcul $type
+
+checkprops result -v 4536
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/W2 b/tests/offset/shape_type_i_c/W2
new file mode 100644 (file)
index 0000000..c005f9a
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_issue25_trimmed.brep] s
+
+OFFSETSHAPE 2 {} $calcul $type
+
+checkprops result -v 22857.5
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/W3 b/tests/offset/shape_type_i_c/W3
new file mode 100644 (file)
index 0000000..44f4ce5
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_issue25_trimmed.brep] s
+
+OFFSETSHAPE 3 {} $calcul $type
+
+checkprops result -v 31471
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/W4 b/tests/offset/shape_type_i_c/W4
new file mode 100644 (file)
index 0000000..58d151e
--- /dev/null
@@ -0,0 +1,9 @@
+polyline p 0 0 0 11 0 0 11 0 4 10 0 4 10 0 3 9 0 2 8 0 2 7 0 3 7 0 4 4 0 4 4 0 3 3 0 2 2 0 2 1 0 3 1 0 4 0 0 4 0 0 0
+mkplane f p
+prism s f 0 5 0
+
+OFFSETSHAPE 1.2 {} $calcul $type
+
+checkprops result -v 618.17
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/W5 b/tests/offset/shape_type_i_c/W5
new file mode 100644 (file)
index 0000000..a8e9e16
--- /dev/null
@@ -0,0 +1,9 @@
+polyline p 0 0 0 11 0 0 11 0 4 10 0 4 10 0 3 9 0 2 8 0 2 7 0 3 7 0 4 4 0 4 4 0 3 3 0 2 2 0 2 1 0 3 1 0 4 0 0 4 0 0 0
+mkplane f p
+prism s f 0 5 0
+
+OFFSETSHAPE 1.5 {} $calcul $type
+
+checkprops result -v 784
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/W6 b/tests/offset/shape_type_i_c/W6
new file mode 100644 (file)
index 0000000..4aa3049
--- /dev/null
@@ -0,0 +1,9 @@
+polyline p 0 0 0 11 0 0 11 0 4 10 0 4 10 0 3 9 0 2 8 0 2 7 0 3 7 0 4 4 0 4 4 0 3 3 0 2 2 0 2 1 0 3 1 0 4 0 0 4 0 0 0
+mkplane f p
+prism s f 0 5 0
+
+OFFSETSHAPE 1.8 {} $calcul $type
+
+checkprops result -v 954.256
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/W7 b/tests/offset/shape_type_i_c/W7
new file mode 100644 (file)
index 0000000..17ac9ca
--- /dev/null
@@ -0,0 +1,10 @@
+polyline p 0 0 0 4 0 0 4 0 3 3 0 3 2 0 1 1 0 3 0 0 3 0 0 0
+mkplane f p
+prism s f 0 1 0
+donly s
+
+OFFSETSHAPE 3 {} $calcul $type
+
+checkprops result -v 630
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/W8 b/tests/offset/shape_type_i_c/W8
new file mode 100644 (file)
index 0000000..93e5a59
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug25926_b1x.brep] s
+
+OFFSETSHAPE 2 {} $calcul $type
+
+checkprops result -v 1756.4
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/W9 b/tests/offset/shape_type_i_c/W9
new file mode 100644 (file)
index 0000000..757c543
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug25926_b1x.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 6000
+
+checknbshapes result -shell 1
index 60329f019fc81a267129689efe0d74e12c0d6709..afc9d03cab7fb593e6b87f7a27bad3b27f29326f 100644 (file)
@@ -5,3 +5,5 @@ restore [locate_data_file bug25926_b3.brep] s
 OFFSETSHAPE 1 {} $calcul $type
 
 checkprops result -v 0
+
+checknbshapes result -shell 1
index b3097f33a35662f8fa509941fcd653a1755f85c8..9306a8490cc0b16ad27ae218b273e553e04d1ee1 100644 (file)
@@ -5,3 +5,5 @@ restore [locate_data_file bug25926_b3.brep] s
 OFFSETSHAPE 2 {} $calcul $type
 
 checkprops result -v 0
+
+checknbshapes result -shell 1
index 08221cc304a4ec6485dff0cd76ea884e0b0bd447..665c3b3bad11e2b9f252034030c67e51ea42626a 100644 (file)
@@ -5,3 +5,5 @@ restore [locate_data_file bug25926_b3x.brep] s
 OFFSETSHAPE 1.5 {} $calcul $type
 
 checkprops result -v 0
+
+checknbshapes result -shell 1
index 78c416fb2043d2b11a14df63b47158376d3128f4..c20369c7a56095cd2d7e8fe12e6e90969f963995 100644 (file)
@@ -5,3 +5,5 @@ restore [locate_data_file bug25926_box_to_hole2.brep] s
 OFFSETSHAPE 1 {} $calcul $type
 
 checkprops result -v 0
+
+checknbshapes result -shell 1
index a08d3e0f01073a8be3737df05d47ddc563af0a00..22741abf8826f1262b85b345ec9839acfac8956b 100644 (file)
@@ -5,3 +5,5 @@ restore [locate_data_file bug25926_box_to_hole_valid.brep] s
 OFFSETSHAPE 1 {} $calcul $type
 
 checkprops result -v 0
+
+checknbshapes result -shell 1
index 7e8b9968966bef539876c0798e722dd9c4b025be..7f3536d0890c1c01026ec7baf567ec60878f2bb4 100644 (file)
@@ -5,3 +5,5 @@ restore [locate_data_file bug25926_box_to_hole_valid.brep] s
 OFFSETSHAPE 2 {} $calcul $type
 
 checkprops result -v 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XA1 b/tests/offset/shape_type_i_c/XA1
new file mode 100644 (file)
index 0000000..e2bd9ab
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom6819.input.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.95782e+009
+checkprops result -s 1.40488e+007
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XA2 b/tests/offset/shape_type_i_c/XA2
new file mode 100644 (file)
index 0000000..19b9cad
--- /dev/null
@@ -0,0 +1,11 @@
+restore [locate_data_file bug26917_rm082_input.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.7879e+007
+checkprops result -s 1.7055e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 60 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XA3 b/tests/offset/shape_type_i_c/XA3
new file mode 100644 (file)
index 0000000..972f9b3
--- /dev/null
@@ -0,0 +1,11 @@
+restore [locate_data_file bug26917_rm083_dom-8757.brep] s
+
+OFFSETSHAPE 38 {} $calcul $type
+
+checkprops result -v 3.82353e+008
+checkprops result -s 4.60971e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 41 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XA4 b/tests/offset/shape_type_i_c/XA4
new file mode 100644 (file)
index 0000000..3ff406c
--- /dev/null
@@ -0,0 +1,24 @@
+restore [locate_data_file bug26917_rm083_dom-8757.brep] s
+
+offsetparameter 1e-7 c i
+offsetload s 1
+
+set faces [explode s f]
+foreach f $faces {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs($z - 1) < 1.e-7} {
+    offsetonface $f 32.5
+  } else {
+    offsetonface $f 38
+  }
+}
+offsetperform result
+
+checkprops result -v 3.67874e+008
+checkprops result -s 4.52001e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 41 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XA5 b/tests/offset/shape_type_i_c/XA5
new file mode 100644 (file)
index 0000000..005abe0
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_rm083_dom-8757_trim1.brep] s
+
+OFFSETSHAPE 25 {} $calcul $type
+
+checkprops result -v 6.43076e+007
+checkprops result -s 1.16296e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XA6 b/tests/offset/shape_type_i_c/XA6
new file mode 100644 (file)
index 0000000..2b721c8
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_rm084_dom8810.input.brep] s
+
+OFFSETSHAPE 15.6 {} $calcul $type
+
+checkprops result -v 9.96466e+008
+checkprops result -s 7.69294e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XA7 b/tests/offset/shape_type_i_c/XA7
new file mode 100644 (file)
index 0000000..7b83f72
--- /dev/null
@@ -0,0 +1,11 @@
+restore [locate_data_file bug26917_dom8810_2.input.brep] s
+
+OFFSETSHAPE 100 {} $calcul $type
+
+checkprops result -v 6.98714e+009
+checkprops result -s 4.89166e+007
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 26 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XA8 b/tests/offset/shape_type_i_c/XA8
new file mode 100644 (file)
index 0000000..1a72c09
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_rm082_input_trim1.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.02611e+006
+checkprops result -s 81141.2
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XA9 b/tests/offset/shape_type_i_c/XA9
new file mode 100644 (file)
index 0000000..ca966d7
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_rm084_dom8810.input_trim1.brep] s
+
+OFFSETSHAPE 15.6 {} $calcul $type
+
+checkprops result -v 2.72597e+007
+checkprops result -s 742046
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XB1 b/tests/offset/shape_type_i_c/XB1
new file mode 100644 (file)
index 0000000..594ebf2
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom8810_2.input_trim1.brep] s
+
+OFFSETSHAPE 100 {} $calcul $type
+
+checkprops result -v 3.67674e+008
+checkprops result -s 3.2582e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XB2 b/tests/offset/shape_type_i_c/XB2
new file mode 100644 (file)
index 0000000..b6e5482
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-8092.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 1.01003e+008
+checkprops result -s 5.29379e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XB3 b/tests/offset/shape_type_i_c/XB3
new file mode 100644 (file)
index 0000000..9224dfc
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-8092_trim1.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 1.43479e+007
+checkprops result -s 831097
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XB4 b/tests/offset/shape_type_i_c/XB4
new file mode 100644 (file)
index 0000000..5fc2ee4
--- /dev/null
@@ -0,0 +1,21 @@
+restore [locate_data_file bug26917_dom-8092_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+offsetperform result
+
+checkprops result -v 7.26594e+007 -s 5.19731e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 613 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XB5 b/tests/offset/shape_type_i_c/XB5
new file mode 100644 (file)
index 0000000..849dec2
--- /dev/null
@@ -0,0 +1,19 @@
+restore [locate_data_file bug26917_dom-8092_trim1.brep] s
+
+offsetparameter 1e-7 $calcul $type
+offsetload s 10
+foreach f [explode s f] {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 9.87183e+006 -s 784012
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 89 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XB6 b/tests/offset/shape_type_i_c/XB6
new file mode 100644 (file)
index 0000000..d125585
--- /dev/null
@@ -0,0 +1,19 @@
+restore [locate_data_file bug26917_dom-8092_trim2.brep] s
+
+offsetparameter 1e-7 $calcul $type
+offsetload s 10
+foreach f [explode s f] {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 4.95561e+006 -s 378181
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 50 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XB7 b/tests/offset/shape_type_i_c/XB7
new file mode 100644 (file)
index 0000000..d00ec1d
--- /dev/null
@@ -0,0 +1,21 @@
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+restore [locate_data_file bug26917_dom-8092_trim3.brep] s
+
+offsetparameter 1e-7 $calcul $type
+offsetload s 10
+foreach f [explode s f] {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 2.39493e+006 -s 156207
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 32 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XB8 b/tests/offset/shape_type_i_c/XB8
new file mode 100644 (file)
index 0000000..1fa5bda
--- /dev/null
@@ -0,0 +1,21 @@
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+restore [locate_data_file bug26917_dom-8092_trim4.brep] s
+
+offsetparameter 1e-7 $calcul $type
+offsetload s 10
+foreach f [explode s f] {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 678794 -s 50525.6
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 8 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XB9 b/tests/offset/shape_type_i_c/XB9
new file mode 100644 (file)
index 0000000..0b53c26
--- /dev/null
@@ -0,0 +1,22 @@
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+restore [locate_data_file bug26917_dom-8092_simple.brep] s
+
+offsetparameter 1e-7 $calcul $type
+offsetload s 1
+foreach f [explode s f] {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 64.4702
+checkprops result -s 104.508
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 8 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XC1 b/tests/offset/shape_type_i_c/XC1
new file mode 100644 (file)
index 0000000..5f11858
--- /dev/null
@@ -0,0 +1,12 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_input.dom7742_trim1.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 486350
+checkprops result -s 43589.5
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XC2 b/tests/offset/shape_type_i_c/XC2
new file mode 100755 (executable)
index 0000000..4deae08
--- /dev/null
@@ -0,0 +1,12 @@
+puts "TODO OCC27414 ALL: Error : The volume of result shape is"
+puts "TODO OCC27414 ALL: Error : The area of result shape is"
+puts "TODO OCC27414 ALL: is not equal to zero"
+
+restore [locate_data_file bug26917_input.dom7742_trim2.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 367339
+checkprops result -s 34789.6
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XC3 b/tests/offset/shape_type_i_c/XC3
new file mode 100644 (file)
index 0000000..ad8a758
--- /dev/null
@@ -0,0 +1,11 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_input.dom7742_trim3.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 0
+checkprops result -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XC4 b/tests/offset/shape_type_i_c/XC4
new file mode 100644 (file)
index 0000000..047fc08
--- /dev/null
@@ -0,0 +1,10 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_input.dom7742_simple.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 2238.67 -s 1045.99
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XC5 b/tests/offset/shape_type_i_c/XC5
new file mode 100644 (file)
index 0000000..3eabe75
--- /dev/null
@@ -0,0 +1,11 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_input.dom7742_simple.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 0
+checkprops result -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XC6 b/tests/offset/shape_type_i_c/XC6
new file mode 100644 (file)
index 0000000..c966422
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-8092_trim5.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 3.33671e+007
+checkprops result -s 1.86576e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XC7 b/tests/offset/shape_type_i_c/XC7
new file mode 100644 (file)
index 0000000..116f060
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom8909.brep] s
+
+OFFSETSHAPE 30 {} $calcul $type
+
+checkprops result -v 2.8244e+008
+checkprops result -s 4.14136e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XC8 b/tests/offset/shape_type_i_c/XC8
new file mode 100644 (file)
index 0000000..7298b1a
--- /dev/null
@@ -0,0 +1,11 @@
+restore [locate_data_file bug26917_rm083_dom-8757_trim1.brep] s
+
+OFFSETSHAPE 38 {} $calcul $type
+
+checkprops result -v 8.054e+007
+checkprops result -s 1.31993e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 9 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XC9 b/tests/offset/shape_type_i_c/XC9
new file mode 100644 (file)
index 0000000..99d5970
--- /dev/null
@@ -0,0 +1,11 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_ZE6_simple.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 0
+checkprops result -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XD1 b/tests/offset/shape_type_i_c/XD1
new file mode 100644 (file)
index 0000000..2e90e6c
--- /dev/null
@@ -0,0 +1,11 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_small_face.brep] s
+
+OFFSETSHAPE 4 {} $calcul $type
+
+checkprops result -v 0
+checkprops result -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XD2 b/tests/offset/shape_type_i_c/XD2
new file mode 100644 (file)
index 0000000..4055bb7
--- /dev/null
@@ -0,0 +1,11 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_small_face.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 0
+checkprops result -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XD3 b/tests/offset/shape_type_i_c/XD3
new file mode 100755 (executable)
index 0000000..05655de
--- /dev/null
@@ -0,0 +1,14 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: Tcl Exception"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_25926_offset_shape_trim4.brep] s
+
+OFFSETSHAPE 12 {} $calcul $type
+
+checkprops result -v 0 -s 0
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XD4 b/tests/offset/shape_type_i_c/XD4
new file mode 100644 (file)
index 0000000..826ca26
--- /dev/null
@@ -0,0 +1,14 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+restore [locate_data_file bug26917_box_triangle.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 119.09 -s 165.708
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 12
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XD5 b/tests/offset/shape_type_i_c/XD5
new file mode 100644 (file)
index 0000000..1282d9e
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_dom-6827_1.recipe_trim5.brep] s
+
+OFFSETSHAPE 9 {} $calcul $type
+
+checkprops result -v 644772 -s 53880.6
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 11
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XD6 b/tests/offset/shape_type_i_c/XD6
new file mode 100644 (file)
index 0000000..73cd415
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_dom-6827_1.recipe_trim5.brep] s
+
+OFFSETSHAPE 11 {} $calcul $type
+
+checkprops result -v 758171 -s 59557.2
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 11
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XD7 b/tests/offset/shape_type_i_c/XD7
new file mode 100644 (file)
index 0000000..8ec0f2f
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input-step17_trim5.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 279714 -s 29357.2
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 5
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XD8 b/tests/offset/shape_type_i_c/XD8
new file mode 100644 (file)
index 0000000..c072cd6
--- /dev/null
@@ -0,0 +1,14 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+restore [locate_data_file bug26917_input-step17_trim6.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 0 -s 0
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XD9 b/tests/offset/shape_type_i_c/XD9
new file mode 100644 (file)
index 0000000..54a2a63
--- /dev/null
@@ -0,0 +1,14 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+restore [locate_data_file bug26917_input-step17_trim6.brep] s
+
+OFFSETSHAPE 20 {} $calcul $type
+
+checkprops result -v 0 -s 0
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XE1 b/tests/offset/shape_type_i_c/XE1
new file mode 100644 (file)
index 0000000..310b76c
--- /dev/null
@@ -0,0 +1,25 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+restore [locate_data_file bug26917_rm084_dom8810_3.input.brep] s
+
+offsetparameter 1e-7 c i
+offsetload s 105.8
+
+set faces [explode s f]
+foreach f $faces {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs($z - 1) < 1.e-7} {
+    offsetonface $f 100
+  }
+}
+offsetperform result
+
+checkprops result -v 0 -s 0
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XE2 b/tests/offset/shape_type_i_c/XE2
new file mode 100644 (file)
index 0000000..dcd1516
--- /dev/null
@@ -0,0 +1,14 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+restore [locate_data_file bug26917_rm084_dom8810_3.input.brep] s
+
+OFFSETSHAPE 100 {} $calcul $type
+
+checkprops result -v 0 -s 0
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XE3 b/tests/offset/shape_type_i_c/XE3
new file mode 100644 (file)
index 0000000..8c3ddb5
--- /dev/null
@@ -0,0 +1,11 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_dom-7724_trim1.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 0 -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XE4 b/tests/offset/shape_type_i_c/XE4
new file mode 100644 (file)
index 0000000..dbdd518
--- /dev/null
@@ -0,0 +1,11 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_dom-7724_trim2.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 0 -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XE5 b/tests/offset/shape_type_i_c/XE5
new file mode 100644 (file)
index 0000000..005acc3
--- /dev/null
@@ -0,0 +1,10 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_dom-7724_trim3.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 0 -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XE6 b/tests/offset/shape_type_i_c/XE6
new file mode 100644 (file)
index 0000000..ec54bea
--- /dev/null
@@ -0,0 +1,10 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_dom-7724_trim5.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 0 -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XE7 b/tests/offset/shape_type_i_c/XE7
new file mode 100644 (file)
index 0000000..40a1e66
--- /dev/null
@@ -0,0 +1,10 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_dom-7724_trim6.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 0 -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XE8 b/tests/offset/shape_type_i_c/XE8
new file mode 100644 (file)
index 0000000..7f3a765
--- /dev/null
@@ -0,0 +1,10 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_dom-7724_trim7.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 0 -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XE9 b/tests/offset/shape_type_i_c/XE9
new file mode 100644 (file)
index 0000000..67979f7
--- /dev/null
@@ -0,0 +1,11 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_dom-7724_trim8.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 0 -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XF1 b/tests/offset/shape_type_i_c/XF1
new file mode 100644 (file)
index 0000000..b609a31
--- /dev/null
@@ -0,0 +1,10 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_dom-7724_trim9.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 0 -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XF2 b/tests/offset/shape_type_i_c/XF2
new file mode 100644 (file)
index 0000000..797b497
--- /dev/null
@@ -0,0 +1,10 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_dom-7724_trim10.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 0 -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XF3 b/tests/offset/shape_type_i_c/XF3
new file mode 100644 (file)
index 0000000..bf19737
--- /dev/null
@@ -0,0 +1,19 @@
+restore [locate_data_file bug26917_dom-8092_simple6.brep] s
+
+offsetparameter 1e-7 $calcul $type
+offsetload s 1
+foreach f [explode s f] {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 115.152 -s 171.74
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 12 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XF4 b/tests/offset/shape_type_i_c/XF4
new file mode 100644 (file)
index 0000000..5ad9a32
--- /dev/null
@@ -0,0 +1,19 @@
+restore [locate_data_file bug26917_dom-8092_trim6.brep] s
+
+offsetparameter 1e-7 $calcul $type
+offsetload s 10
+foreach f [explode s f] {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 7.3871e+006 -s 549219
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 70 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XF5 b/tests/offset/shape_type_i_c/XF5
new file mode 100644 (file)
index 0000000..5ce80a7
--- /dev/null
@@ -0,0 +1,21 @@
+restore [locate_data_file bug26917_dom-8092_trim7_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+offsetperform result
+
+checkprops result -v 4.15571e+007 -s 2.96614e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 333 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XF6 b/tests/offset/shape_type_i_c/XF6
new file mode 100644 (file)
index 0000000..13f4acc
--- /dev/null
@@ -0,0 +1,19 @@
+restore [locate_data_file bug26917_dom-8092_trim8.brep] s
+
+offsetparameter 1e-7 $calcul $type
+offsetload s 10
+foreach f [explode s f] {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 2.24922e+007 -s 1.69552e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 182 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XF7 b/tests/offset/shape_type_i_c/XF7
new file mode 100644 (file)
index 0000000..b47649e
--- /dev/null
@@ -0,0 +1,19 @@
+restore [locate_data_file bug26917_dom-8092_trim9.brep] s
+
+offsetparameter 1e-7 $calcul $type
+offsetload s 10
+foreach f [explode s f] {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 1.44209e+007 -s 1.06577e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 120 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XF8 b/tests/offset/shape_type_i_c/XF8
new file mode 100644 (file)
index 0000000..da45f42
--- /dev/null
@@ -0,0 +1,19 @@
+restore [locate_data_file bug26917_dom-8092_trim10.brep] s
+
+offsetparameter 1e-7 $calcul $type
+offsetload s 10
+foreach f [explode s f] {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 1.02049e+007 -s 727784
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 83 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XF9 b/tests/offset/shape_type_i_c/XF9
new file mode 100644 (file)
index 0000000..b853eb0
--- /dev/null
@@ -0,0 +1,19 @@
+restore [locate_data_file bug26917_dom-8092_trim11.brep] s
+
+offsetparameter 1e-7 $calcul $type
+offsetload s 10
+foreach f [explode s f] {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 3.68147e+006 -s 205693 
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 32 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XG1 b/tests/offset/shape_type_i_c/XG1
new file mode 100644 (file)
index 0000000..b7af2f1
--- /dev/null
@@ -0,0 +1,18 @@
+restore [locate_data_file bug26917_dom-7724.brep] s
+
+offsetparameter 1e-7 c i
+offsetload s 15
+
+set faces [explode s f]
+foreach f $faces {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs($z - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 8.52723e+008 -s 6.06025e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XG2 b/tests/offset/shape_type_i_c/XG2
new file mode 100644 (file)
index 0000000..ad576bc
--- /dev/null
@@ -0,0 +1,23 @@
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+restore [locate_data_file bug26917_dom-7724_trim1.brep] s
+
+offsetparameter 1e-7 c i
+offsetload s 15
+
+set faces [explode s f]
+foreach f $faces {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs($z - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v  9.24815e+006 -s 523194
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 27 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XG3 b/tests/offset/shape_type_i_c/XG3
new file mode 100644 (file)
index 0000000..2475710
--- /dev/null
@@ -0,0 +1,18 @@
+restore [locate_data_file bug26917_dom-7724_trim8.brep] s
+
+offsetparameter 1e-7 c i
+offsetload s 15
+
+set faces [explode s f]
+foreach f $faces {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs($z - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 3.60205e+006 -s 254682
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XG4 b/tests/offset/shape_type_i_c/XG4
new file mode 100644 (file)
index 0000000..8cf5a3e
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_rm-095_input.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.3834e+007 -s 2.63386e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XG5 b/tests/offset/shape_type_i_c/XG5
new file mode 100644 (file)
index 0000000..9331950
--- /dev/null
@@ -0,0 +1,18 @@
+restore [locate_data_file bug26917_rm-095_input_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 5
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+offsetperform result
+
+checkprops result -v 2.91628e+007 -s 2.58238e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XG6 b/tests/offset/shape_type_i_c/XG6
new file mode 100644 (file)
index 0000000..a11429f
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_rm-095_input_trim1.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 8.17694e+006 -s 769867
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XG7 b/tests/offset/shape_type_i_c/XG7
new file mode 100644 (file)
index 0000000..c0ba213
--- /dev/null
@@ -0,0 +1,18 @@
+restore [locate_data_file bug26917_rm-095_input_trim1.brep] s
+
+offsetparameter 1e-7 c i
+offsetload s 5
+
+set faces [explode s f]
+foreach f $faces {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 6.74813e+006 -s 751157
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XG8 b/tests/offset/shape_type_i_c/XG8
new file mode 100644 (file)
index 0000000..9e5f67f
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_rm-095_input_trim2.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 2.57933e+007 -s 1.9054e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XG9 b/tests/offset/shape_type_i_c/XG9
new file mode 100644 (file)
index 0000000..e95923a
--- /dev/null
@@ -0,0 +1,18 @@
+restore [locate_data_file bug26917_rm-095_input_trim2_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 5
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+offsetperform result
+
+checkprops result -v 2.25226e+007 -s 1.86675e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XH1 b/tests/offset/shape_type_i_c/XH1
new file mode 100644 (file)
index 0000000..1708523
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_rm-095_input_trim3.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.22726e+006 -s 247903
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XH2 b/tests/offset/shape_type_i_c/XH2
new file mode 100644 (file)
index 0000000..b9aeede
--- /dev/null
@@ -0,0 +1,18 @@
+restore [locate_data_file bug26917_rm-095_input_trim3.brep] s
+
+offsetparameter 1e-7 c i
+offsetload s 5
+
+set faces [explode s f]
+foreach f $faces {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 2.83253e+006 -s 238219
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XH3 b/tests/offset/shape_type_i_c/XH3
new file mode 100644 (file)
index 0000000..6dac9cd
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_rm-095_input_trim4.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 236367 -s 30788.4
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XH4 b/tests/offset/shape_type_i_c/XH4
new file mode 100644 (file)
index 0000000..99ca637
--- /dev/null
@@ -0,0 +1,18 @@
+restore [locate_data_file bug26917_rm-095_input_trim4.brep] s
+
+offsetparameter 1e-7 c i
+offsetload s 5
+
+set faces [explode s f]
+foreach f $faces {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 210428 -s 28315.7
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XH5 b/tests/offset/shape_type_i_c/XH5
new file mode 100644 (file)
index 0000000..4bbaa9c
--- /dev/null
@@ -0,0 +1,13 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+restore [locate_data_file bug26917_M2_trim7_trim1.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 1.00013e+006 -s 66432.5
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 9
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XH6 b/tests/offset/shape_type_i_c/XH6
new file mode 100644 (file)
index 0000000..2ddfcfb
--- /dev/null
@@ -0,0 +1,21 @@
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+restore [locate_data_file bug26917_dom-8092_simple2.brep] s
+
+offsetparameter 1e-7 $calcul $type
+offsetload s 1
+foreach f [explode s f] {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 70.4702 -s 114.508
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 10 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XH7 b/tests/offset/shape_type_i_c/XH7
new file mode 100644 (file)
index 0000000..8daf612
--- /dev/null
@@ -0,0 +1,19 @@
+restore [locate_data_file bug26917_dom-8092_simple3.brep] s
+
+offsetparameter 1e-7 $calcul $type
+offsetload s 1
+foreach f [explode s f] {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 70.4702 -s 114.508
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 10 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XH8 b/tests/offset/shape_type_i_c/XH8
new file mode 100644 (file)
index 0000000..1167f16
--- /dev/null
@@ -0,0 +1,19 @@
+restore [locate_data_file bug26917_dom-8092_simple4.brep] s
+
+offsetparameter 1e-7 $calcul $type
+offsetload s 1
+foreach f [explode s f] {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 70.4702 -s 114.508
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 10 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XH9 b/tests/offset/shape_type_i_c/XH9
new file mode 100644 (file)
index 0000000..9c2ae30
--- /dev/null
@@ -0,0 +1,19 @@
+restore [locate_data_file bug26917_dom-8092_trim12.brep] s
+
+offsetparameter 1e-7 $calcul $type
+offsetload s 10
+foreach f [explode s f] {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs(abs($z) - 1) < 1.e-7} {
+    offsetonface $f 0
+  }
+}
+offsetperform result
+
+checkprops result -v 4.67737e+006 -s 364455 
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 42 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XI1 b/tests/offset/shape_type_i_c/XI1
new file mode 100644 (file)
index 0000000..25d384e
--- /dev/null
@@ -0,0 +1,25 @@
+restore [locate_data_file bug26917_dom-8092_with_diff_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+foreach f [explode c_3 f] {
+  offsetonface $f 9.96195
+}
+
+offsetperform result
+
+checkprops result -v 7.26156e+007 -s 5.19666e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 613 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XI2 b/tests/offset/shape_type_i_c/XI2
new file mode 100644 (file)
index 0000000..098624e
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_dom-8092.new.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 9.7511e+007 -s 5.12881e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XI3 b/tests/offset/shape_type_i_c/XI3
new file mode 100644 (file)
index 0000000..19343c1
--- /dev/null
@@ -0,0 +1,21 @@
+restore [locate_data_file bug26917_dom-8092.new_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+offsetperform result
+
+checkprops result -v 6.99928e+007 -s 5.03322e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 613 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XI4 b/tests/offset/shape_type_i_c/XI4
new file mode 100755 (executable)
index 0000000..7faaedb
--- /dev/null
@@ -0,0 +1,28 @@
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+puts "TODO OCC27414 ALL: the resulting shape is negative"
+
+restore [locate_data_file bug26917_dom-8092.new_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+foreach f [explode c_3 f] {
+  offsetonface $f 9.96195
+}
+
+offsetperform result
+
+checkprops result -v 6.99508e+007 -s 5.03259e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 613 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XI5 b/tests/offset/shape_type_i_c/XI5
new file mode 100644 (file)
index 0000000..867c5df
--- /dev/null
@@ -0,0 +1,25 @@
+restore [locate_data_file bug26917_dom-8092.new_trim1_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+foreach f [explode c_3 f] {
+  offsetonface $f 9.96195
+}
+
+offsetperform result
+
+checkprops result -v 4.00462e+007 -s 2.87488e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 333 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XI6 b/tests/offset/shape_type_i_c/XI6
new file mode 100644 (file)
index 0000000..76863f0
--- /dev/null
@@ -0,0 +1,28 @@
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+puts "TODO OCC27414 ALL: the resulting shape is negative"
+
+restore [locate_data_file bug26917_dom-8092.new_trim2_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+foreach f [explode c_3 f] {
+  offsetonface $f 9.96195
+}
+
+offsetperform result
+
+checkprops result -v 3.01916e+007 -s 2.24322e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 280 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XI7 b/tests/offset/shape_type_i_c/XI7
new file mode 100644 (file)
index 0000000..f3028ad
--- /dev/null
@@ -0,0 +1,25 @@
+restore [locate_data_file bug26917_dom-8092.new_trim3_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+foreach f [explode c_3 f] {
+  offsetonface $f 9.96195
+}
+
+offsetperform result
+
+checkprops result -v 4.8408e+007 -s 3.4436e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 410 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XI8 b/tests/offset/shape_type_i_c/XI8
new file mode 100644 (file)
index 0000000..346b70b
--- /dev/null
@@ -0,0 +1,28 @@
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+puts "TODO OCC27414 ALL: the resulting shape is negative"
+
+restore [locate_data_file bug26917_dom-8092.new_trim4_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+foreach f [explode c_3 f] {
+  offsetonface $f 9.96195
+}
+
+offsetperform result
+
+checkprops result -v 2.26105e+007 -s 1.76469e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 223 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XI9 b/tests/offset/shape_type_i_c/XI9
new file mode 100644 (file)
index 0000000..402f71a
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_dom-8092.t6c1.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 9.7511e+007 -s 5.12881e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/XJ1 b/tests/offset/shape_type_i_c/XJ1
new file mode 100644 (file)
index 0000000..9594e8c
--- /dev/null
@@ -0,0 +1,21 @@
+restore [locate_data_file bug26917_dom-8092.t6c1_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+offsetperform result
+
+checkprops result -v 6.99928e+007 -s 5.03322e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 613 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XJ2 b/tests/offset/shape_type_i_c/XJ2
new file mode 100755 (executable)
index 0000000..f4e41e7
--- /dev/null
@@ -0,0 +1,29 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: Tcl Exception"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_dom-8092.t6c1_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+foreach f [explode c_3 f] {
+  offsetonface $f 9.96195
+}
+
+offsetperform result
+
+checkprops result -v 0 -s 0
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 1 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XJ3 b/tests/offset/shape_type_i_c/XJ3
new file mode 100644 (file)
index 0000000..c5137ce
--- /dev/null
@@ -0,0 +1,25 @@
+restore [locate_data_file bug26917_dom-8092.t6c1_trim1_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+foreach f [explode c_3 f] {
+  offsetonface $f 9.96195
+}
+
+offsetperform result
+
+checkprops result -v 3.15651e+007 -s 2.29267e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 278 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XJ4 b/tests/offset/shape_type_i_c/XJ4
new file mode 100644 (file)
index 0000000..eaca5c3
--- /dev/null
@@ -0,0 +1,29 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: Tcl Exception"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_dom-8092.t6c1_trim2_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+foreach f [explode c_3 f] {
+  offsetonface $f 9.96195
+}
+
+offsetperform result
+
+checkprops result -v 0 -s 0
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 1 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XJ5 b/tests/offset/shape_type_i_c/XJ5
new file mode 100644 (file)
index 0000000..33b7be9
--- /dev/null
@@ -0,0 +1,29 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: Tcl Exception"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_dom-8092.t6c1_trim3_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+foreach f [explode c_3 f] {
+  offsetonface $f 9.96195
+}
+
+offsetperform result
+
+checkprops result -v 0 -s 0
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 1 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XJ6 b/tests/offset/shape_type_i_c/XJ6
new file mode 100644 (file)
index 0000000..78b3de4
--- /dev/null
@@ -0,0 +1,29 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: Tcl Exception"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_dom-8092.t6c1_trim4_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+foreach f [explode c_3 f] {
+  offsetonface $f 9.96195
+}
+
+offsetperform result
+
+checkprops result -v 0 -s 0
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 1 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XJ7 b/tests/offset/shape_type_i_c/XJ7
new file mode 100644 (file)
index 0000000..3d8ab32
--- /dev/null
@@ -0,0 +1,29 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: Tcl Exception"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_dom-8092.t6c1_trim5_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+foreach f [explode c_3 f] {
+  offsetonface $f 9.96195
+}
+
+offsetperform result
+
+checkprops result -v 0 -s 0
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 1 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XJ8 b/tests/offset/shape_type_i_c/XJ8
new file mode 100644 (file)
index 0000000..85a655b
--- /dev/null
@@ -0,0 +1,25 @@
+restore [locate_data_file bug26917_dom-8092.new_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+foreach f [explode c_3 f] {
+  offsetonface $f 9.961946980917456
+}
+
+offsetperform result
+
+checkprops result -v 6.99508e+007 -s 5.03259e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 571 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XJ9 b/tests/offset/shape_type_i_c/XJ9
new file mode 100644 (file)
index 0000000..dc573f3
--- /dev/null
@@ -0,0 +1,25 @@
+restore [locate_data_file bug26917_dom-8092.t6c1_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+foreach f [explode c_3 f] {
+  offsetonface $f 9.961946980917456
+}
+
+offsetperform result
+
+checkprops result -v 6.99508e+007 -s 5.03259e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 571 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XK1 b/tests/offset/shape_type_i_c/XK1
new file mode 100644 (file)
index 0000000..0c262b8
--- /dev/null
@@ -0,0 +1,25 @@
+restore [locate_data_file bug26917_dom-8092.new_trim5_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+foreach f [explode c_3 f] {
+  offsetonface $f 9.961946980917456
+}
+
+offsetperform result
+
+checkprops result -v 1.45342e+007 -s 1.07942e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 122 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XK2 b/tests/offset/shape_type_i_c/XK2
new file mode 100644 (file)
index 0000000..0ce908d
--- /dev/null
@@ -0,0 +1,25 @@
+restore [locate_data_file bug26917_dom-8092.new_trim6_with_faces.brep] c
+
+# get the shape
+explode c
+copy c_1 s
+
+offsetparameter 1e-7 c i
+offsetload s 10
+
+foreach f [explode c_2 f] {
+  offsetonface $f 0
+}
+
+foreach f [explode c_3 f] {
+  offsetonface $f 9.961946980917456
+}
+
+offsetperform result
+
+checkprops result -v 5.099e+006 -s 360528
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 46 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/Y1 b/tests/offset/shape_type_i_c/Y1
new file mode 100644 (file)
index 0000000..ef62eac
--- /dev/null
@@ -0,0 +1,9 @@
+polyline p 0 0 0 10 0 0 10 0 7 6 0 7 6 0 3 5 0 5 0 0 5 0 0 0
+mkplane f p
+prism s f 0 10 0
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 1152
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Y2 b/tests/offset/shape_type_i_c/Y2
new file mode 100644 (file)
index 0000000..adb3167
--- /dev/null
@@ -0,0 +1,9 @@
+polyline p 0 0 0 10 0 0 10 0 7 6 0 7 6 0 3 5 0 5 0 0 5 0 0 0
+mkplane f p
+prism s f 0 10 0
+
+OFFSETSHAPE 3 {} $calcul $type
+
+checkprops result -v 3136
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Y3 b/tests/offset/shape_type_i_c/Y3
new file mode 100644 (file)
index 0000000..2029a16
--- /dev/null
@@ -0,0 +1,13 @@
+polyline p 0 0 0 4 0 0 4 0 2 2 0 4 0 0 4 0 0 0
+mkplane f p
+prism s f 0 5 0
+explode s f
+donly s
+offsetparameter 1e-7 c i
+offsetload s 1 
+offsetonface s_3 5
+offsetperform result
+
+checkprops result -v 252
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Y4 b/tests/offset/shape_type_i_c/Y4
new file mode 100644 (file)
index 0000000..5dbe57a
--- /dev/null
@@ -0,0 +1,13 @@
+polyline p 0 0 0 4 0 0 4 0 2 2 0 4 0 0 4 0 0 0
+mkplane f p
+prism s f 0 5 0
+explode s f
+donly s
+offsetparameter 1e-7 c i
+offsetload s 1 
+offsetonface s_2 5
+offsetperform result
+
+checkprops result -v 269.397
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Y5 b/tests/offset/shape_type_i_c/Y5
new file mode 100644 (file)
index 0000000..45230eb
--- /dev/null
@@ -0,0 +1,13 @@
+polyline p 0 0 0 4 0 0 4 0 1 2 0 1 1 0 3 1 0 4 0 0 4 0 0 0
+mkplane f p
+prism s f 0 5 0
+explode s f
+donly s
+offsetparameter 1e-7 c i 
+offsetload s 1
+offsetonface s_4 3
+offsetperform result
+
+checkprops result -v 233.186
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Y6 b/tests/offset/shape_type_i_c/Y6
new file mode 100644 (file)
index 0000000..52ea28a
--- /dev/null
@@ -0,0 +1,12 @@
+polyline p 0 0 0 4 0 0 4 0 1 2 0 1 1 0 3 1 0 4 0 0 4 0 0 0
+mkplane f p
+prism s f 0 5 0
+explode s f
+offsetparameter 1e-7 c i
+offsetload s 1
+offsetonface s_4 3.5
+offsetperform result
+
+checkprops result -v 243.731
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Y7 b/tests/offset/shape_type_i_c/Y7
new file mode 100644 (file)
index 0000000..c4bc071
--- /dev/null
@@ -0,0 +1,13 @@
+polyline p 0 0 0 5 0 0 5 0 1 1 0 1 5 0 5 0 0 5 0 0 0
+mkplane f p
+prism s f 0 5 0
+explode s f
+donly s
+offsetparameter 1e-7 c i 
+offsetload s 1
+offsetonface s_4 4
+offsetperform result
+
+checkprops result -v 455
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Y8 b/tests/offset/shape_type_i_c/Y8
new file mode 100644 (file)
index 0000000..292ef8c
--- /dev/null
@@ -0,0 +1,13 @@
+polyline p 0 0 0 5 0 0 5 0 1 1 0 1 5 0 5 0 0 5 0 0 0
+mkplane f p
+prism s f 0 5 0
+explode s f
+donly s
+offsetparameter 1e-7 c i 
+offsetload s 1
+offsetonface s_4 6
+offsetperform result
+
+checkprops result -v 587.279
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Y9 b/tests/offset/shape_type_i_c/Y9
new file mode 100644 (file)
index 0000000..f2f425a
--- /dev/null
@@ -0,0 +1,13 @@
+restore [locate_data_file bug26917_double_cave_2.brep] s
+
+offsetparameter 1e-7 c i
+offsetload s 1
+explode s f
+offsetonface s_6 6
+offsetonface s_12 6
+offsetperform result
+
+checkprops result -v 2376
+checkprops result -s 1140
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Z1 b/tests/offset/shape_type_i_c/Z1
new file mode 100644 (file)
index 0000000..c95210c
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim1.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 1.4954e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Z2 b/tests/offset/shape_type_i_c/Z2
new file mode 100644 (file)
index 0000000..1c5c2b2
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim2.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v  1.05462e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Z3 b/tests/offset/shape_type_i_c/Z3
new file mode 100644 (file)
index 0000000..e2c94fc
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim3.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 1.04443e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Z4 b/tests/offset/shape_type_i_c/Z4
new file mode 100644 (file)
index 0000000..708afe4
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim4.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 4.65244e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Z5 b/tests/offset/shape_type_i_c/Z5
new file mode 100644 (file)
index 0000000..cfced92
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim5.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 3.79891e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Z6 b/tests/offset/shape_type_i_c/Z6
new file mode 100644 (file)
index 0000000..778e708
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim6.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 3.17639e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Z7 b/tests/offset/shape_type_i_c/Z7
new file mode 100644 (file)
index 0000000..b759eb9
--- /dev/null
@@ -0,0 +1,12 @@
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+restore [locate_data_file bug26917_M2_trim7.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 2.08264e+006 -s 129633
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 30
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/Z8 b/tests/offset/shape_type_i_c/Z8
new file mode 100644 (file)
index 0000000..f0c1acf
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim8.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 2.05947e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/Z9 b/tests/offset/shape_type_i_c/Z9
new file mode 100644 (file)
index 0000000..ce1006c
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim9.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 1.69324e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZA1 b/tests/offset/shape_type_i_c/ZA1
new file mode 100644 (file)
index 0000000..5e725a9
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim10.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 2.00962e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZA2 b/tests/offset/shape_type_i_c/ZA2
new file mode 100644 (file)
index 0000000..1b62e39
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim11.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 1.62816e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZA3 b/tests/offset/shape_type_i_c/ZA3
new file mode 100644 (file)
index 0000000..741d983
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim12.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 1.38812e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZA4 b/tests/offset/shape_type_i_c/ZA4
new file mode 100644 (file)
index 0000000..3dfa759
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim13.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 1.25727e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZA5 b/tests/offset/shape_type_i_c/ZA5
new file mode 100644 (file)
index 0000000..d34dd20
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim14.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 974376
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZA6 b/tests/offset/shape_type_i_c/ZA6
new file mode 100644 (file)
index 0000000..89f68d5
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim15.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 828156
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZA7 b/tests/offset/shape_type_i_c/ZA7
new file mode 100644 (file)
index 0000000..19a7ea9
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim16.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 690977
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZA8 b/tests/offset/shape_type_i_c/ZA8
new file mode 100644 (file)
index 0000000..2cc4ed4
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim17.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 556376
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZA9 b/tests/offset/shape_type_i_c/ZA9
new file mode 100644 (file)
index 0000000..cec4863
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim18.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 401748
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZB1 b/tests/offset/shape_type_i_c/ZB1
new file mode 100644 (file)
index 0000000..84efad0
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_M2_trim19.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 1.50286e+006 -s 91555.8
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 25
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZB2 b/tests/offset/shape_type_i_c/ZB2
new file mode 100644 (file)
index 0000000..2ba9540
--- /dev/null
@@ -0,0 +1,10 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_M2_trim20.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 1.5516e+006 -s 88978
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZB3 b/tests/offset/shape_type_i_c/ZB3
new file mode 100644 (file)
index 0000000..7da95b1
--- /dev/null
@@ -0,0 +1,10 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_M2_trim21.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 1.28505e+006 -s 75557.2
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZB4 b/tests/offset/shape_type_i_c/ZB4
new file mode 100644 (file)
index 0000000..63cfa23
--- /dev/null
@@ -0,0 +1,10 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_M2_trim22.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 1.1318e+006 -s 69137.2
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZB5 b/tests/offset/shape_type_i_c/ZB5
new file mode 100644 (file)
index 0000000..469edbb
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim23.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 156212
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZB6 b/tests/offset/shape_type_i_c/ZB6
new file mode 100644 (file)
index 0000000..bec62e3
--- /dev/null
@@ -0,0 +1,9 @@
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_M2_trim24.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZB7 b/tests/offset/shape_type_i_c/ZB7
new file mode 100644 (file)
index 0000000..faf85dd
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim25.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 974376
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZB8 b/tests/offset/shape_type_i_c/ZB8
new file mode 100644 (file)
index 0000000..7c50e80
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim26.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 828156
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZB9 b/tests/offset/shape_type_i_c/ZB9
new file mode 100644 (file)
index 0000000..6e5d896
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim27.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 556376
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZC1 b/tests/offset/shape_type_i_c/ZC1
new file mode 100644 (file)
index 0000000..336ea34
--- /dev/null
@@ -0,0 +1,12 @@
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+restore [locate_data_file bug26917_M2_trim28.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 301147 -s 37303.1
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 12
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZC2 b/tests/offset/shape_type_i_c/ZC2
new file mode 100644 (file)
index 0000000..cb4e042
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim29.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 193026
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZC3 b/tests/offset/shape_type_i_c/ZC3
new file mode 100644 (file)
index 0000000..fd42e9d
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim30.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 161664
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZC4 b/tests/offset/shape_type_i_c/ZC4
new file mode 100644 (file)
index 0000000..e9a1f53
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim31.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 435343
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZC5 b/tests/offset/shape_type_i_c/ZC5
new file mode 100644 (file)
index 0000000..5d12f64
--- /dev/null
@@ -0,0 +1,12 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_M2_trim32.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 1.27733e+006
+checkprops result -s 79757.5
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZC6 b/tests/offset/shape_type_i_c/ZC6
new file mode 100644 (file)
index 0000000..7ac9472
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim33.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 434203 -s 43436.6
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZC7 b/tests/offset/shape_type_i_c/ZC7
new file mode 100644 (file)
index 0000000..eb86413
--- /dev/null
@@ -0,0 +1,11 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_M2_trim34.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZC8 b/tests/offset/shape_type_i_c/ZC8
new file mode 100644 (file)
index 0000000..ad84f93
--- /dev/null
@@ -0,0 +1,11 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_M2_trim35.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZC9 b/tests/offset/shape_type_i_c/ZC9
new file mode 100644 (file)
index 0000000..d6d7177
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim36.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 117176
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZD1 b/tests/offset/shape_type_i_c/ZD1
new file mode 100644 (file)
index 0000000..a448d8e
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_M2_trim1.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 2.1938e+006 -s 108076
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 16
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZD2 b/tests/offset/shape_type_i_c/ZD2
new file mode 100644 (file)
index 0000000..87fa201
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_M2_trim2.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 1.60096e+006 -s 85212.6
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 12
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZD3 b/tests/offset/shape_type_i_c/ZD3
new file mode 100644 (file)
index 0000000..678edac
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_M2_trim3.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 1.58761e+006 -s 84716.7
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 12
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZD4 b/tests/offset/shape_type_i_c/ZD4
new file mode 100644 (file)
index 0000000..461edc4
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_M2_trim4.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 6.49981e+006
+checkprops result -s 266495
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZD5 b/tests/offset/shape_type_i_c/ZD5
new file mode 100644 (file)
index 0000000..21db96f
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim5.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 5.34468e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZD6 b/tests/offset/shape_type_i_c/ZD6
new file mode 100644 (file)
index 0000000..cc04db8
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim6.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 4.84412e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZD7 b/tests/offset/shape_type_i_c/ZD7
new file mode 100644 (file)
index 0000000..35dd17e
--- /dev/null
@@ -0,0 +1,12 @@
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+restore [locate_data_file bug26917_M2_trim7.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 2.9919e+006 -s 138455
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 16
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZD8 b/tests/offset/shape_type_i_c/ZD8
new file mode 100644 (file)
index 0000000..ace7747
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_M2_trim8.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 3.27183e+006 -s 214411
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 17
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZD9 b/tests/offset/shape_type_i_c/ZD9
new file mode 100755 (executable)
index 0000000..7a00c42
--- /dev/null
@@ -0,0 +1,9 @@
+puts "TODO CR27414 ALL: Error : The command is not valid. The volume is 0."
+
+restore [locate_data_file bug26917_M2_trim9.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZE1 b/tests/offset/shape_type_i_c/ZE1
new file mode 100644 (file)
index 0000000..52ea827
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_M2_trim10.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 2.86758e+006 -s 132343
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 16
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZE2 b/tests/offset/shape_type_i_c/ZE2
new file mode 100644 (file)
index 0000000..44067ad
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_M2_trim11.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 2.35558e+006
+checkprops result -s 113213
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZE3 b/tests/offset/shape_type_i_c/ZE3
new file mode 100644 (file)
index 0000000..f8d1d8a
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim12.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 2.039e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZE4 b/tests/offset/shape_type_i_c/ZE4
new file mode 100644 (file)
index 0000000..a64005c
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim13.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 1.87334e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZE5 b/tests/offset/shape_type_i_c/ZE5
new file mode 100644 (file)
index 0000000..5f6b13f
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim14.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 1.53693e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZE6 b/tests/offset/shape_type_i_c/ZE6
new file mode 100644 (file)
index 0000000..74252a6
--- /dev/null
@@ -0,0 +1,9 @@
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_M2_trim15.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZE7 b/tests/offset/shape_type_i_c/ZE7
new file mode 100644 (file)
index 0000000..992768c
--- /dev/null
@@ -0,0 +1,9 @@
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_M2_trim16.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZE8 b/tests/offset/shape_type_i_c/ZE8
new file mode 100644 (file)
index 0000000..0b1cc75
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim17.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 977601
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZE9 b/tests/offset/shape_type_i_c/ZE9
new file mode 100644 (file)
index 0000000..ef89c4b
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim18.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 748491
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZF1 b/tests/offset/shape_type_i_c/ZF1
new file mode 100644 (file)
index 0000000..059dbee
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_M2_trim19.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 2.18735e+006 -s 106891
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 14
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZF2 b/tests/offset/shape_type_i_c/ZF2
new file mode 100644 (file)
index 0000000..9a36439
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim20.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 2.15206e+006 -s 104716
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZF3 b/tests/offset/shape_type_i_c/ZF3
new file mode 100644 (file)
index 0000000..dd9bfd9
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim21.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 1.80154e+006 -s 92297.3
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZF4 b/tests/offset/shape_type_i_c/ZF4
new file mode 100644 (file)
index 0000000..e4eab7f
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim22.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 1.61981e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZF5 b/tests/offset/shape_type_i_c/ZF5
new file mode 100644 (file)
index 0000000..0177393
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_M2_trim23.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 357987
+checkprops result -s 35362.4 
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZF6 b/tests/offset/shape_type_i_c/ZF6
new file mode 100644 (file)
index 0000000..709abd8
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_M2_trim24.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 2.86758e+006 -s 132343
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 16
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZF7 b/tests/offset/shape_type_i_c/ZF7
new file mode 100644 (file)
index 0000000..88ef759
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim25.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 1.53693e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZF8 b/tests/offset/shape_type_i_c/ZF8
new file mode 100644 (file)
index 0000000..62c8c19
--- /dev/null
@@ -0,0 +1,9 @@
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_M2_trim26.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZF9 b/tests/offset/shape_type_i_c/ZF9
new file mode 100644 (file)
index 0000000..3e31d67
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim27.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 977601
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZG1 b/tests/offset/shape_type_i_c/ZG1
new file mode 100644 (file)
index 0000000..e5be42d
--- /dev/null
@@ -0,0 +1,13 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+restore [locate_data_file bug26917_M2_trim28.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 599808 -s 50247.4
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 9
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZG2 b/tests/offset/shape_type_i_c/ZG2
new file mode 100644 (file)
index 0000000..4a7a957
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim29.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 432971
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZG3 b/tests/offset/shape_type_i_c/ZG3
new file mode 100644 (file)
index 0000000..414babc
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim30.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 360182
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZG4 b/tests/offset/shape_type_i_c/ZG4
new file mode 100644 (file)
index 0000000..3aac097
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_M2_trim31.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 815560 -s 64052.4
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 7
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZG5 b/tests/offset/shape_type_i_c/ZG5
new file mode 100644 (file)
index 0000000..beb2671
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_M2_trim32.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 1.87061e+006
+checkprops result -s 95780.7
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZG6 b/tests/offset/shape_type_i_c/ZG6
new file mode 100644 (file)
index 0000000..e06176c
--- /dev/null
@@ -0,0 +1,10 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_M2_trim33.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 779008 -s 57287.4
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZG7 b/tests/offset/shape_type_i_c/ZG7
new file mode 100644 (file)
index 0000000..48873c4
--- /dev/null
@@ -0,0 +1,9 @@
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_M2_trim34.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZG8 b/tests/offset/shape_type_i_c/ZG8
new file mode 100644 (file)
index 0000000..d899645
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim35.brep] s
+
+OFFSETSHAPE 15  {} $calcul $type
+
+checkprops result -v 518244
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZG9 b/tests/offset/shape_type_i_c/ZG9
new file mode 100644 (file)
index 0000000..899834c
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_M2_trim36.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 300148
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZH1 b/tests/offset/shape_type_i_c/ZH1
new file mode 100644 (file)
index 0000000..b06282c
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_rm37_input_3.brep] s
+
+OFFSETSHAPE 20 {} $calcul $type
+
+checkprops result -v 2.46955e+007
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZH2 b/tests/offset/shape_type_i_c/ZH2
new file mode 100644 (file)
index 0000000..8f0c903
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_rm37_input.brep] s
+
+OFFSETSHAPE 20 {} $calcul $type
+
+checkprops result -v 4.41962e+007
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZH3 b/tests/offset/shape_type_i_c/ZH3
new file mode 100644 (file)
index 0000000..6dcef1b
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_rm37_input_5.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 3.5068e+007
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZH4 b/tests/offset/shape_type_i_c/ZH4
new file mode 100644 (file)
index 0000000..ec68367
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_center.input.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 3.00178e+007
+checkprops result -s 1.65736e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZH5 b/tests/offset/shape_type_i_c/ZH5
new file mode 100644 (file)
index 0000000..d494a5a
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_center.input.brep] s
+
+OFFSETSHAPE 4 {} $calcul $type
+
+checkprops result -v 3.50011e+007
+checkprops result -s 1.66483e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZH6 b/tests/offset/shape_type_i_c/ZH6
new file mode 100644 (file)
index 0000000..aaa2b62
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_center.input.brep] s
+
+OFFSETSHAPE 6 {} $calcul $type
+
+checkprops result -v 3.83362e+007
+checkprops result -s 1.67082e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZH7 b/tests/offset/shape_type_i_c/ZH7
new file mode 100644 (file)
index 0000000..8b66066
--- /dev/null
@@ -0,0 +1,11 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_fills_center.input.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 0
+checkprops result -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZH8 b/tests/offset/shape_type_i_c/ZH8
new file mode 100644 (file)
index 0000000..3fb0c8b
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_center.input_trim1.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 1.57879e+007
+checkprops result -s 913277
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZH9 b/tests/offset/shape_type_i_c/ZH9
new file mode 100644 (file)
index 0000000..f21fd2e
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_center.input_trim1.brep] s
+
+OFFSETSHAPE 4 {} $calcul $type
+
+checkprops result -v 1.85458e+007
+checkprops result -s 925480
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZI1 b/tests/offset/shape_type_i_c/ZI1
new file mode 100644 (file)
index 0000000..b8a6a97
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_center.input_trim1.brep] s
+
+OFFSETSHAPE 6 {} $calcul $type
+
+checkprops result -v 2.0404e+007
+checkprops result -s 933824
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZI2 b/tests/offset/shape_type_i_c/ZI2
new file mode 100644 (file)
index 0000000..2ea95d1
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_center.input_trim2.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 2.47496e+006
+checkprops result -s 210148
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZI3 b/tests/offset/shape_type_i_c/ZI3
new file mode 100644 (file)
index 0000000..a402b8a
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_center.input_trim2.brep] s
+
+OFFSETSHAPE 4 {} $calcul $type
+
+checkprops result -v 3.1206e+006
+checkprops result -s 220438
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZI4 b/tests/offset/shape_type_i_c/ZI4
new file mode 100644 (file)
index 0000000..aa2c974
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_center.input_trim2.brep] s
+
+OFFSETSHAPE 6 {} $calcul $type
+
+checkprops result -v 3.56869e+006
+checkprops result -s 227700
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZI5 b/tests/offset/shape_type_i_c/ZI5
new file mode 100644 (file)
index 0000000..acbf955
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_center.input_trim3.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 1.17846e+007
+checkprops result -s 568858
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZI6 b/tests/offset/shape_type_i_c/ZI6
new file mode 100644 (file)
index 0000000..29fb3ad
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_center.input_trim3.brep] s
+
+OFFSETSHAPE 4 {} $calcul $type
+
+checkprops result -v 1.35173e+007
+checkprops result -s 586135
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZI7 b/tests/offset/shape_type_i_c/ZI7
new file mode 100644 (file)
index 0000000..6ecf51e
--- /dev/null
@@ -0,0 +1,12 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_fills_center.input_trim3.brep] s
+
+OFFSETSHAPE 6 {} $calcul $type
+
+checkprops result -v 0
+checkprops result -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZI8 b/tests/offset/shape_type_i_c/ZI8
new file mode 100644 (file)
index 0000000..08e9965
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_center.input_trim4.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 3.80942e+006
+checkprops result -s 324961
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZI9 b/tests/offset/shape_type_i_c/ZI9
new file mode 100644 (file)
index 0000000..5e23701
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_center.input_trim4.brep] s
+
+OFFSETSHAPE 4 {} $calcul $type
+
+checkprops result -v 4.79692e+006
+checkprops result -s 333591
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZJ1 b/tests/offset/shape_type_i_c/ZJ1
new file mode 100644 (file)
index 0000000..b79c8a5
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_center.input_trim4.brep] s
+
+OFFSETSHAPE 6 {} $calcul $type
+
+checkprops result -v 5.47027e+006
+checkprops result -s 339810
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZJ2 b/tests/offset/shape_type_i_c/ZJ2
new file mode 100644 (file)
index 0000000..8ad55fa
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_M4_trim2.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 5.16422e+006
+checkprops result -s 353116
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZJ3 b/tests/offset/shape_type_i_c/ZJ3
new file mode 100644 (file)
index 0000000..c3fc5ed
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_M4_trim2.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 6.2463e+006
+checkprops result -s 367400
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZJ4 b/tests/offset/shape_type_i_c/ZJ4
new file mode 100644 (file)
index 0000000..270562e
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_M4_trim2.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 8.66985e+006 -s 347407
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 25
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZJ5 b/tests/offset/shape_type_i_c/ZJ5
new file mode 100644 (file)
index 0000000..fa2988c
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_M4_trim1.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 2.26758e+007
+checkprops result -s 1.48174e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZJ6 b/tests/offset/shape_type_i_c/ZJ6
new file mode 100644 (file)
index 0000000..3fe54cf
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_M4_trim1.brep] s
+
+OFFSETSHAPE 8 {} $calcul $type
+
+checkprops result -v 2.71827e+007
+checkprops result -s 1.51518e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZJ7 b/tests/offset/shape_type_i_c/ZJ7
new file mode 100644 (file)
index 0000000..f55d9d9
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_M4_trim1.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 3.6481e+007
+checkprops result -s 1.23723e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZJ8 b/tests/offset/shape_type_i_c/ZJ8
new file mode 100644 (file)
index 0000000..d07b73b
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom7761_1.brep] s
+
+OFFSETSHAPE 25 {} $calcul $type
+
+checkprops result -v 2.34736e+007
+checkprops result -s 562100
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZJ9 b/tests/offset/shape_type_i_c/ZJ9
new file mode 100644 (file)
index 0000000..f43c6cc
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom7761_1.brep] s
+
+OFFSETSHAPE 30 {} $calcul $type
+
+checkprops result -v 2.6346e+007
+checkprops result -s 568100
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZK1 b/tests/offset/shape_type_i_c/ZK1
new file mode 100644 (file)
index 0000000..7609bad
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom7761_1.brep] s
+
+OFFSETSHAPE 45 {} $calcul $type
+
+checkprops result -v 3.5754e+007
+checkprops result -s 688100
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZK2 b/tests/offset/shape_type_i_c/ZK2
new file mode 100644 (file)
index 0000000..1b0adfd
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_outside.bad.brep] s
+
+OFFSETSHAPE 2 {} $calcul $type
+
+checkprops result -v 5.18828e+007
+checkprops result -s 1.79884e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZK3 b/tests/offset/shape_type_i_c/ZK3
new file mode 100644 (file)
index 0000000..495ceee
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_outside.bad.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 5.7394e+007
+checkprops result -s 1.8753e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZK4 b/tests/offset/shape_type_i_c/ZK4
new file mode 100644 (file)
index 0000000..f5c852d
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_outside.bad.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 6.45048e+007
+checkprops result -s 1.4087e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZK5 b/tests/offset/shape_type_i_c/ZK5
new file mode 100644 (file)
index 0000000..d000593
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_outside.bad_trim1.brep] s
+
+OFFSETSHAPE 2 {} $calcul $type
+
+checkprops result -v 1.92643e+007
+checkprops result -s 625460
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZK6 b/tests/offset/shape_type_i_c/ZK6
new file mode 100644 (file)
index 0000000..4d4c37b
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_outside.bad_trim1.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 2.1184e+007
+checkprops result -s 654445
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZK7 b/tests/offset/shape_type_i_c/ZK7
new file mode 100644 (file)
index 0000000..bd37821
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_outside.bad_trim1.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 2.40907e+007
+checkprops result -s 592868
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZK8 b/tests/offset/shape_type_i_c/ZK8
new file mode 100644 (file)
index 0000000..142feab
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_outside.bad_trim2.brep] s
+
+OFFSETSHAPE 2 {} $calcul $type
+
+checkprops result -v 3.26867e+007
+checkprops result -s 1.21039e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZK9 b/tests/offset/shape_type_i_c/ZK9
new file mode 100644 (file)
index 0000000..1b6010f
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_outside.bad_trim2.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.64028e+007
+checkprops result -s 1.26707e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZL1 b/tests/offset/shape_type_i_c/ZL1
new file mode 100644 (file)
index 0000000..b6a7d19
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_outside.bad_trim2.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 4.11508e+007
+checkprops result -s 941694
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZL2 b/tests/offset/shape_type_i_c/ZL2
new file mode 100644 (file)
index 0000000..0c4e0e6
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_outside.good.brep] s
+
+OFFSETSHAPE 2 {} $calcul $type
+
+checkprops result -v 5.18828e+007
+checkprops result -s 1.79884e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZL3 b/tests/offset/shape_type_i_c/ZL3
new file mode 100644 (file)
index 0000000..2011f05
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_outside.good.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 5.7394e+007
+checkprops result -s 1.8753e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZL4 b/tests/offset/shape_type_i_c/ZL4
new file mode 100644 (file)
index 0000000..7ab6d75
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_fills_outside.good.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 6.45048e+007
+checkprops result -s 1.4087e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZL5 b/tests/offset/shape_type_i_c/ZL5
new file mode 100644 (file)
index 0000000..d4dad6e
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom6820_2.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.57194e+007
+checkprops result -s 1.93747e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZL6 b/tests/offset/shape_type_i_c/ZL6
new file mode 100644 (file)
index 0000000..6389282
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom6820_2.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 4.41031e+007
+checkprops result -s 1.61801e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZL7 b/tests/offset/shape_type_i_c/ZL7
new file mode 100644 (file)
index 0000000..47f4b57
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom6820_2.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 5.24959e+007
+checkprops result -s 1.7393e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZL8 b/tests/offset/shape_type_i_c/ZL8
new file mode 100644 (file)
index 0000000..d5fe7b3
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom6806_8.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.41034e+007
+checkprops result -s 1.46326e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZL9 b/tests/offset/shape_type_i_c/ZL9
new file mode 100644 (file)
index 0000000..c1f7e82
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom6806_8.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 4.14054e+007
+checkprops result -s 1.47744e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZM1 b/tests/offset/shape_type_i_c/ZM1
new file mode 100644 (file)
index 0000000..0ee4973
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom6806_8.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 4.80822e+007
+checkprops result -s 1.30141e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZM2 b/tests/offset/shape_type_i_c/ZM2
new file mode 100644 (file)
index 0000000..a64204c
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom6806_8_trim1.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 2.44799e+007
+checkprops result -s 1.13837e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZM3 b/tests/offset/shape_type_i_c/ZM3
new file mode 100644 (file)
index 0000000..f13e0e7
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom6806_8_trim1.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 3.0126e+007
+checkprops result -s 1.13863e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZM4 b/tests/offset/shape_type_i_c/ZM4
new file mode 100644 (file)
index 0000000..38c4e9d
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom6806_8_trim1.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 3.51351e+007
+checkprops result -s 963709
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZM5 b/tests/offset/shape_type_i_c/ZM5
new file mode 100644 (file)
index 0000000..afc5dc5
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom6806_8_trim2.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.20376e+006
+checkprops result -s 99243.4
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZM6 b/tests/offset/shape_type_i_c/ZM6
new file mode 100644 (file)
index 0000000..d0d6bf6
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom6806_8_trim2.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 1.73931e+006
+checkprops result -s 116356
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZM7 b/tests/offset/shape_type_i_c/ZM7
new file mode 100644 (file)
index 0000000..76e7e74
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom6806_8_trim2.brep] s
+
+OFFSETSHAPE 12 {} $calcul $type
+
+checkprops result -v 1.96981e+006
+checkprops result -s 103555
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZM8 b/tests/offset/shape_type_i_c/ZM8
new file mode 100644 (file)
index 0000000..36d7b96
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom6806_8_trim2.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 2.29484e+006
+checkprops result -s 113204
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZM9 b/tests/offset/shape_type_i_c/ZM9
new file mode 100644 (file)
index 0000000..560fde1
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input_dom6806_8_trim2.brep] s
+
+OFFSETSHAPE 20 {} $calcul $type
+
+checkprops result -v 2.90296e+006
+checkprops result -s 130246
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZN1 b/tests/offset/shape_type_i_c/ZN1
new file mode 100644 (file)
index 0000000..09bc7c3
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.74428e+007
+checkprops result -s 2.06949e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZN2 b/tests/offset/shape_type_i_c/ZN2
new file mode 100644 (file)
index 0000000..fae86b7
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 4.65202e+007
+checkprops result -s 1.66989e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZN3 b/tests/offset/shape_type_i_c/ZN3
new file mode 100644 (file)
index 0000000..c83eece
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 5.51738e+007
+checkprops result -s 1.79175e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZN4 b/tests/offset/shape_type_i_c/ZN4
new file mode 100644 (file)
index 0000000..a44c77f
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input_trim1.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 2.64721e+007
+checkprops result -s 1.36783e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZN5 b/tests/offset/shape_type_i_c/ZN5
new file mode 100644 (file)
index 0000000..b52fe11
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input_trim1.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 3.26641e+007
+checkprops result -s 1.16916e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZN6 b/tests/offset/shape_type_i_c/ZN6
new file mode 100644 (file)
index 0000000..00ab646
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input_trim1.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 3.8735e+007
+checkprops result -s 1.25942e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZN7 b/tests/offset/shape_type_i_c/ZN7
new file mode 100644 (file)
index 0000000..2e60a9a
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input_trim2.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 6.17183e+006
+checkprops result -s 345990
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZN8 b/tests/offset/shape_type_i_c/ZN8
new file mode 100644 (file)
index 0000000..748aa00
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input_trim2.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 7.8039e+006
+checkprops result -s 321244
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZN9 b/tests/offset/shape_type_i_c/ZN9
new file mode 100644 (file)
index 0000000..1d795de
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input_trim2.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 9.49715e+006
+checkprops result -s 356830
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZO1 b/tests/offset/shape_type_i_c/ZO1
new file mode 100644 (file)
index 0000000..27c6b4c
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input_trim3.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 5.02138e+006
+checkprops result -s 418816
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZO2 b/tests/offset/shape_type_i_c/ZO2
new file mode 100644 (file)
index 0000000..ff6efd8
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input_trim3.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 6.76301e+006
+checkprops result -s 296335
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZO3 b/tests/offset/shape_type_i_c/ZO3
new file mode 100644 (file)
index 0000000..accd9a3
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input_trim3.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 8.32594e+006
+checkprops result -s 329078
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZO4 b/tests/offset/shape_type_i_c/ZO4
new file mode 100644 (file)
index 0000000..286c084
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input_trim4.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 5.62025e+006
+checkprops result -s 304647
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZO5 b/tests/offset/shape_type_i_c/ZO5
new file mode 100644 (file)
index 0000000..a8d8de2
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input_trim4.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 7.09931e+006
+checkprops result -s 299449
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZO6 b/tests/offset/shape_type_i_c/ZO6
new file mode 100644 (file)
index 0000000..5dc85ca
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input_trim4.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 8.68147e+006
+checkprops result -s 333739
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZO7 b/tests/offset/shape_type_i_c/ZO7
new file mode 100644 (file)
index 0000000..6041542
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input_trim5.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 4.5933e+006
+checkprops result -s 238531
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZO8 b/tests/offset/shape_type_i_c/ZO8
new file mode 100644 (file)
index 0000000..3a02142
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input_trim5.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 5.81035e+006
+checkprops result -s 249031
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZO9 b/tests/offset/shape_type_i_c/ZO9
new file mode 100644 (file)
index 0000000..752df25
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_32.input_trim5.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 7.12993e+006
+checkprops result -s 279084
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZP1 b/tests/offset/shape_type_i_c/ZP1
new file mode 100644 (file)
index 0000000..7feeae7
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input_dom6820_1.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.59138e+007 -s 1.93504e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 256
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZP2 b/tests/offset/shape_type_i_c/ZP2
new file mode 100644 (file)
index 0000000..7186c6f
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input_dom6820_1.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 4.43005e+007 -s 1.61972e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 42
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZP3 b/tests/offset/shape_type_i_c/ZP3
new file mode 100644 (file)
index 0000000..296d33d
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input_dom6820_1.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 5.27018e+007 -s 1.74101e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 42
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZP4 b/tests/offset/shape_type_i_c/ZP4
new file mode 100644 (file)
index 0000000..81e1f99
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input_dom6820_1_trim1.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 2.21604e+007 -s 1.17663e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 172
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZP5 b/tests/offset/shape_type_i_c/ZP5
new file mode 100644 (file)
index 0000000..d59253c
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input_dom6820_1_trim1.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 2.73476e+007 -s 1.00976e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 29
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZP6 b/tests/offset/shape_type_i_c/ZP6
new file mode 100644 (file)
index 0000000..7cf3792
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input_dom6820_1_trim1.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 3.25964e+007 -s 1.08996e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 29
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZP7 b/tests/offset/shape_type_i_c/ZP7
new file mode 100644 (file)
index 0000000..0d279c2
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input_dom6820_1_trim2.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 9.04792e+006 -s 440273
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 59
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZP8 b/tests/offset/shape_type_i_c/ZP8
new file mode 100644 (file)
index 0000000..7dcddea
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input_dom6820_1_trim2.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 1.11857e+007 -s 437085
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 18
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZP9 b/tests/offset/shape_type_i_c/ZP9
new file mode 100644 (file)
index 0000000..187d4be
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input_dom6820_1_trim2.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 1.34793e+007 -s 480796
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 18
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZQ1 b/tests/offset/shape_type_i_c/ZQ1
new file mode 100644 (file)
index 0000000..aeb1634
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_dom-6820_0.recipe.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.72476e+007 -s 2.002e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 280
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZQ2 b/tests/offset/shape_type_i_c/ZQ2
new file mode 100644 (file)
index 0000000..dcf1f91
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_0.recipe.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.82329e+007
+checkprops result -s 2.15719e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZQ3 b/tests/offset/shape_type_i_c/ZQ3
new file mode 100644 (file)
index 0000000..99ba56a
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_1.recipe.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.88724e+007
+checkprops result -s 2.14567e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZQ4 b/tests/offset/shape_type_i_c/ZQ4
new file mode 100644 (file)
index 0000000..5ce3aaa
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_12.recipe.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.67018e+007
+checkprops result -s 2.08278e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZQ5 b/tests/offset/shape_type_i_c/ZQ5
new file mode 100644 (file)
index 0000000..0644c20
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_14.recipe.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.93383e+007
+checkprops result -s 2.14966e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZQ6 b/tests/offset/shape_type_i_c/ZQ6
new file mode 100644 (file)
index 0000000..9335dea
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_16.recipe.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.88724e+007
+checkprops result -s 2.14567e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZQ7 b/tests/offset/shape_type_i_c/ZQ7
new file mode 100644 (file)
index 0000000..77888dc
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_18.recipe.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.76832e+007
+checkprops result -s 2.16631e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZQ8 b/tests/offset/shape_type_i_c/ZQ8
new file mode 100644 (file)
index 0000000..9c95d48
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_19.recipe.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.82314e+007
+checkprops result -s 2.07479e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZQ9 b/tests/offset/shape_type_i_c/ZQ9
new file mode 100644 (file)
index 0000000..1520247
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_27.recipe.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.71562e+007
+checkprops result -s 2.08037e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZR1 b/tests/offset/shape_type_i_c/ZR1
new file mode 100644 (file)
index 0000000..047b136
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_28.recipe.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.70779e+007
+checkprops result -s 2.07431e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZR2 b/tests/offset/shape_type_i_c/ZR2
new file mode 100644 (file)
index 0000000..5ebdcea
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_29.recipe.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.82329e+007
+checkprops result -s 2.15719e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZR3 b/tests/offset/shape_type_i_c/ZR3
new file mode 100644 (file)
index 0000000..d159334
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-7491.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 2.37178e+007
+checkprops result -s 1.26461e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZR4 b/tests/offset/shape_type_i_c/ZR4
new file mode 100644 (file)
index 0000000..4d5baff
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6820_1.recipe.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.70437e+007
+checkprops result -s 2.0041e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZR5 b/tests/offset/shape_type_i_c/ZR5
new file mode 100644 (file)
index 0000000..fa4f8b4
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_dom-6827_1.recipe.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.87021e+007 -s 2.07859e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 289
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZR6 b/tests/offset/shape_type_i_c/ZR6
new file mode 100644 (file)
index 0000000..dbf049c
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_10.recipe.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.83785e+007
+checkprops result -s 2.14935e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZR7 b/tests/offset/shape_type_i_c/ZR7
new file mode 100644 (file)
index 0000000..fe9f29c
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_13.recipe.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.91845e+007
+checkprops result -s 2.14332e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZR8 b/tests/offset/shape_type_i_c/ZR8
new file mode 100644 (file)
index 0000000..598fd40
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-6849_26.recipe.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.80776e+007
+checkprops result -s 2.0707e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZR9 b/tests/offset/shape_type_i_c/ZR9
new file mode 100644 (file)
index 0000000..40b69a9
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-7259.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 7.09283e+007
+checkprops result -s 4.49093e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZS1 b/tests/offset/shape_type_i_c/ZS1
new file mode 100644 (file)
index 0000000..2aeebfc
--- /dev/null
@@ -0,0 +1,11 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_dom-7724.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 8.95633e+008 -s 6.22693e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZS2 b/tests/offset/shape_type_i_c/ZS2
new file mode 100644 (file)
index 0000000..ddf8a56
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_dom-6820_0.recipe_trim1.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.12903e+007 -s 717150
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 93
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZS3 b/tests/offset/shape_type_i_c/ZS3
new file mode 100644 (file)
index 0000000..86c4f23
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_dom-6820_0.recipe_trim2.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 2.61249e+007 -s 1.32973e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 191
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZS4 b/tests/offset/shape_type_i_c/ZS4
new file mode 100644 (file)
index 0000000..21a7a06
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_dom-6820_0.recipe_trim3.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 4.58096e+006 -s 247335
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 54
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZS5 b/tests/offset/shape_type_i_c/ZS5
new file mode 100644 (file)
index 0000000..2c82134
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_dom-6820_0.recipe_trim4.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 7.09306e+006 -s 594789
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 48
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZS6 b/tests/offset/shape_type_i_c/ZS6
new file mode 100644 (file)
index 0000000..2cfed3a
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_dom-7491_trim1.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 97182.3 -s 17648.3
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 15
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZS7 b/tests/offset/shape_type_i_c/ZS7
new file mode 100644 (file)
index 0000000..5d2be40
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-7491_trim2.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 76254.4
+checkprops result -s 11907.1
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZS8 b/tests/offset/shape_type_i_c/ZS8
new file mode 100644 (file)
index 0000000..4cfc1d5
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_dom-6827_1.recipe_trim1.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.59088e+007 -s 922700
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 133
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZS9 b/tests/offset/shape_type_i_c/ZS9
new file mode 100644 (file)
index 0000000..0942f8d
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_dom-6827_1.recipe_trim2.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 7.21325e+006 -s 324219
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 37
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZT1 b/tests/offset/shape_type_i_c/ZT1
new file mode 100644 (file)
index 0000000..2205058
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_dom-6827_1.recipe_trim3.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.59147e+007 -s 921616
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 131
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZT2 b/tests/offset/shape_type_i_c/ZT2
new file mode 100644 (file)
index 0000000..d743c09
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_dom-6827_1.recipe_trim4.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 4.17586e+006 -s 244403
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 37
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZT3 b/tests/offset/shape_type_i_c/ZT3
new file mode 100644 (file)
index 0000000..acae4d8
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom7772.input.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.16252e+007
+checkprops result -s 1.74461e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZT4 b/tests/offset/shape_type_i_c/ZT4
new file mode 100644 (file)
index 0000000..0d83e7b
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom6884.t3c0.input.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.69758e+007
+checkprops result -s 2.07457e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZT5 b/tests/offset/shape_type_i_c/ZT5
new file mode 100644 (file)
index 0000000..2528fe8
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_dom-6820_0.recipe_trim5.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 283511 -s 39150.9
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 15
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZT6 b/tests/offset/shape_type_i_c/ZT6
new file mode 100644 (file)
index 0000000..fb08ab7
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom7772.input_simple.brep] s
+
+OFFSETSHAPE 1 {} $calcul $type
+
+checkprops result -v 176.308
+checkprops result -s 218.729
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZT7 b/tests/offset/shape_type_i_c/ZT7
new file mode 100644 (file)
index 0000000..8d20743
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input_dom6820_1_trim3.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.08733e+007 -s 692538
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 88
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZT8 b/tests/offset/shape_type_i_c/ZT8
new file mode 100644 (file)
index 0000000..2ee9d4d
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input_dom6820_1_trim4.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 9.20163e+006 -s 572981
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 75
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZT9 b/tests/offset/shape_type_i_c/ZT9
new file mode 100644 (file)
index 0000000..c616604
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input-step17_trim4.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 2.76771e+006 -s 141436
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 7
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZU1 b/tests/offset/shape_type_i_c/ZU1
new file mode 100644 (file)
index 0000000..76adc7b
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input-step17.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 3.18132e+007
+checkprops result -s 1.98704e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZU2 b/tests/offset/shape_type_i_c/ZU2
new file mode 100644 (file)
index 0000000..7292997
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input-step17.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 4.02375e+007 -s 1.59238e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 65
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZU3 b/tests/offset/shape_type_i_c/ZU3
new file mode 100644 (file)
index 0000000..c5c2355
--- /dev/null
@@ -0,0 +1,21 @@
+restore [locate_data_file bug26917_input-step17.brep] s
+
+offsetparameter 1e-7 c i
+offsetload s 5
+
+# set offset 2 for top faces (normal direction 0 0 1)
+set faces [explode s f]
+foreach f $faces {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found && abs($z - 1) < 1.e-7} {
+    offsetonface $f 2
+  }
+}
+
+offsetperform result
+
+checkprops result -v 2.95041e+007
+checkprops result -s 1.96287e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZU4 b/tests/offset/shape_type_i_c/ZU4
new file mode 100644 (file)
index 0000000..22be2aa
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input-step17_trim1.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.92793e+006
+checkprops result -s 185382
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZU5 b/tests/offset/shape_type_i_c/ZU5
new file mode 100644 (file)
index 0000000..43015f7
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input-step17_trim2.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 2.99457e+007
+checkprops result -s 1.82036e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZU6 b/tests/offset/shape_type_i_c/ZU6
new file mode 100644 (file)
index 0000000..3e3243a
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input-step17_trim2.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 3.78029e+007
+checkprops result -s 1.50768e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZU7 b/tests/offset/shape_type_i_c/ZU7
new file mode 100644 (file)
index 0000000..85bb6e0
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input-step17_trim3.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 6.73873e+006
+checkprops result -s 555298
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZU8 b/tests/offset/shape_type_i_c/ZU8
new file mode 100644 (file)
index 0000000..d21ccf6
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input-step17_trim3.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 8.89259e+006 -s 388784
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 26
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZU9 b/tests/offset/shape_type_i_c/ZU9
new file mode 100644 (file)
index 0000000..761d789
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input-step3.brep] s
+
+OFFSETSHAPE 22 {} $calcul $type
+
+checkprops result -v 9.15368e+007 -s 2.59391e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 57
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZV1 b/tests/offset/shape_type_i_c/ZV1
new file mode 100644 (file)
index 0000000..d4d4f41
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-7259_trim1.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 6.64061e+007
+checkprops result -s 4.02575e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZV2 b/tests/offset/shape_type_i_c/ZV2
new file mode 100644 (file)
index 0000000..f0f0c45
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-7259_trim2.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 3.67479e+007
+checkprops result -s 1.23956e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZV3 b/tests/offset/shape_type_i_c/ZV3
new file mode 100644 (file)
index 0000000..8d081e1
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_dom-7259_trim3.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 3.99934e+007 -s 2.0166e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 420
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZV4 b/tests/offset/shape_type_i_c/ZV4
new file mode 100644 (file)
index 0000000..2f68772
--- /dev/null
@@ -0,0 +1,11 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_dom-7259_trim3.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 0
+checkprops result -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZV5 b/tests/offset/shape_type_i_c/ZV5
new file mode 100644 (file)
index 0000000..e1d7005
--- /dev/null
@@ -0,0 +1,11 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_dom-7259_trim3.brep] s
+
+OFFSETSHAPE 20 {} $calcul $type
+
+checkprops result -v 0
+checkprops result -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZV6 b/tests/offset/shape_type_i_c/ZV6
new file mode 100644 (file)
index 0000000..d11e311
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-7259_trim4.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 4.14625e+007
+checkprops result -s 2.56822e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZV7 b/tests/offset/shape_type_i_c/ZV7
new file mode 100644 (file)
index 0000000..9512290
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-7259_trim5.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 1.44383e+007
+checkprops result -s 1.15897e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZV8 b/tests/offset/shape_type_i_c/ZV8
new file mode 100644 (file)
index 0000000..a8472ef
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-7259_trim5.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 2.03268e+007
+checkprops result -s 1.19747e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZV9 b/tests/offset/shape_type_i_c/ZV9
new file mode 100644 (file)
index 0000000..ca630c2
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom-7259_trim6.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 7.05257e+006
+checkprops result -s 545249
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZW1 b/tests/offset/shape_type_i_c/ZW1
new file mode 100644 (file)
index 0000000..ed536b1
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom8036.input.brep] s
+
+OFFSETSHAPE 43.7 {} $calcul $type
+
+checkprops result -v 2.70147e+009
+checkprops result -s 1.63922e+007
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZW2 b/tests/offset/shape_type_i_c/ZW2
new file mode 100644 (file)
index 0000000..de81d16
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom8036.input_trim1.brep] s
+
+OFFSETSHAPE 43.7 {} $calcul $type
+
+checkprops result -v 4.55952e+006
+checkprops result -s 178524
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZW3 b/tests/offset/shape_type_i_c/ZW3
new file mode 100644 (file)
index 0000000..5f78441
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom8036.input_trim3.brep] s
+
+OFFSETSHAPE 14 {} $calcul $type
+
+checkprops result -v 702756
+checkprops result -s 58381.3
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZW4 b/tests/offset/shape_type_i_c/ZW4
new file mode 100644 (file)
index 0000000..cae34a8
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom8036.input_trim3.brep] s
+
+OFFSETSHAPE 43.7 {} $calcul $type
+
+checkprops result -v 3.77467e+006
+checkprops result -s 155537
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZW5 b/tests/offset/shape_type_i_c/ZW5
new file mode 100644 (file)
index 0000000..61a523e
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom8036.input_art1.brep] s
+
+OFFSETSHAPE 4 {} $calcul $type
+
+checkprops result -v 3771.44
+checkprops result -s 1506.76
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZW6 b/tests/offset/shape_type_i_c/ZW6
new file mode 100644 (file)
index 0000000..ce6fc96
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom8036.input_art4.brep] s
+
+OFFSETSHAPE 5 {} $calcul $type
+
+checkprops result -v 5453.96
+checkprops result -s 1912.14
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZW7 b/tests/offset/shape_type_i_c/ZW7
new file mode 100644 (file)
index 0000000..1ae6cf9
--- /dev/null
@@ -0,0 +1,12 @@
+restore [locate_data_file bug26917_dom8036.input_art4.brep] s
+
+offsetparameter 1e-7 c i
+offsetload s 5
+explode s f
+offsetonface s_6 7
+offsetperform result
+
+checkprops result -v 5530.7
+checkprops result -s 1919.49
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZW8 b/tests/offset/shape_type_i_c/ZW8
new file mode 100644 (file)
index 0000000..b47a296
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom8036.input_art2.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 48955.7
+checkprops result -s 8048.95
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZW9 b/tests/offset/shape_type_i_c/ZW9
new file mode 100644 (file)
index 0000000..c97b3d6
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_dom8036.input_art5.brep] s
+
+OFFSETSHAPE 6 {} $calcul $type
+
+checkprops result -v 7543.63
+checkprops result -s 2359.85
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZX1 b/tests/offset/shape_type_i_c/ZX1
new file mode 100644 (file)
index 0000000..3910b68
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_t104_c1.recipe.brep] s
+
+OFFSETSHAPE 43 {} $calcul $type
+
+checkprops result -v 7.05903e+008
+checkprops result -s 5.59084e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZX2 b/tests/offset/shape_type_i_c/ZX2
new file mode 100644 (file)
index 0000000..6bd9877
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_t107_c1.recipe.brep] s
+
+OFFSETSHAPE 35 {} $calcul $type
+
+checkprops result -v 7.94674e+008
+checkprops result -s 6.11963e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZX3 b/tests/offset/shape_type_i_c/ZX3
new file mode 100644 (file)
index 0000000..5936be0
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_t11_c1.recipe.brep] s
+
+OFFSETSHAPE 43 {} $calcul $type
+
+checkprops result -v 7.05903e+008
+checkprops result -s 5.59084e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZX4 b/tests/offset/shape_type_i_c/ZX4
new file mode 100644 (file)
index 0000000..de7b0af
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_t111_c2.recipe.brep] s
+
+OFFSETSHAPE 43 {} $calcul $type
+
+checkprops result -v 9.12393e+008
+checkprops result -s 7.01321e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZX5 b/tests/offset/shape_type_i_c/ZX5
new file mode 100644 (file)
index 0000000..9f7f54b
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_t112_c1.recipe.brep] s
+
+OFFSETSHAPE 6 {} $calcul $type
+
+checkprops result -v 5.70228e+008 -s 5.04268e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 39 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZX6 b/tests/offset/shape_type_i_c/ZX6
new file mode 100644 (file)
index 0000000..49bb858
--- /dev/null
@@ -0,0 +1,12 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_t114_c2.recipe.brep] s
+
+OFFSETSHAPE 35 {} $calcul $type
+
+checkprops result -v 7.93275e+008
+checkprops result -s 6.15377e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZX7 b/tests/offset/shape_type_i_c/ZX7
new file mode 100644 (file)
index 0000000..4b84273
--- /dev/null
@@ -0,0 +1,12 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_t115_c2.recipe.brep] s
+
+OFFSETSHAPE 35 {} $calcul $type
+
+checkprops result -v 7.93275e+008
+checkprops result -s 6.15377e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZX8 b/tests/offset/shape_type_i_c/ZX8
new file mode 100644 (file)
index 0000000..6ec303d
--- /dev/null
@@ -0,0 +1,12 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_t116_c2.recipe.brep] s
+
+OFFSETSHAPE 35 {} $calcul $type
+
+checkprops result -v 8.96742e+008
+checkprops result -s 6.85555e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZX9 b/tests/offset/shape_type_i_c/ZX9
new file mode 100644 (file)
index 0000000..86445e1
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_t121_c1.recipe.brep] s
+
+OFFSETSHAPE 43 {} $calcul $type
+
+checkprops result -v 5.23391e+008
+checkprops result -s 4.7898e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZY1 b/tests/offset/shape_type_i_c/ZY1
new file mode 100644 (file)
index 0000000..070bfda
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_t129_c1.recipe.brep] s
+
+OFFSETSHAPE 43 {} $calcul $type
+
+checkprops result -v 1.58077e+009
+checkprops result -s 1.04396e+007
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZY2 b/tests/offset/shape_type_i_c/ZY2
new file mode 100644 (file)
index 0000000..3d26240
--- /dev/null
@@ -0,0 +1,12 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_t130_c2.recipe.brep] s
+
+OFFSETSHAPE 35 {} $calcul $type
+
+checkprops result -v 6.89789e+008
+checkprops result -s 5.45195e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZY3 b/tests/offset/shape_type_i_c/ZY3
new file mode 100644 (file)
index 0000000..63a4e30
--- /dev/null
@@ -0,0 +1,12 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_t137_c2.recipe.brep] s
+
+OFFSETSHAPE 35 {} $calcul $type
+
+checkprops result -v 8.96742e+008
+checkprops result -s 6.85555e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZY4 b/tests/offset/shape_type_i_c/ZY4
new file mode 100644 (file)
index 0000000..c96b9e0
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_t138_c2.recipe.brep] s
+
+OFFSETSHAPE 43 {} $calcul $type
+
+checkprops result -v 2.09462e+009
+checkprops result -s 1.32364e+007
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZY5 b/tests/offset/shape_type_i_c/ZY5
new file mode 100644 (file)
index 0000000..a6b5f5d
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_t139_c2.recipe.brep] s
+
+OFFSETSHAPE 43 {} $calcul $type
+
+checkprops result -v 7.05903e+008
+checkprops result -s 5.59084e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZY6 b/tests/offset/shape_type_i_c/ZY6
new file mode 100644 (file)
index 0000000..0b63ea5
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_t143_c1.recipe.brep] s
+
+OFFSETSHAPE 43 {} $calcul $type
+
+checkprops result -v 5.23391e+008
+checkprops result -s 4.7898e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZY7 b/tests/offset/shape_type_i_c/ZY7
new file mode 100644 (file)
index 0000000..a93a424
--- /dev/null
@@ -0,0 +1,7 @@
+restore [locate_data_file bug26917_t112_c1.recipe_trim1.brep] s
+
+OFFSETSHAPE 6 {} $calcul $type
+
+checkprops result -v 813077 -s 70451.1
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZY8 b/tests/offset/shape_type_i_c/ZY8
new file mode 100644 (file)
index 0000000..d97a141
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_t112_c1.recipe_art.brep] s
+
+OFFSETSHAPE 3 {} $calcul $type
+
+checkprops result -v 4422.98
+checkprops result -s 1736.95
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZY9 b/tests/offset/shape_type_i_c/ZY9
new file mode 100644 (file)
index 0000000..1196319
--- /dev/null
@@ -0,0 +1,12 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_t114_c2.recipe_art1.brep] s
+
+OFFSETSHAPE 2 {} $calcul $type
+
+checkprops result -v 475
+checkprops result -s 454.58
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZZ1 b/tests/offset/shape_type_i_c/ZZ1
new file mode 100755 (executable)
index 0000000..afa9394
--- /dev/null
@@ -0,0 +1,12 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+puts "TODO CR27414 ALL: is not equal to zero"
+
+restore [locate_data_file bug26917_input_segfault.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 0
+checkprops result -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZZ2 b/tests/offset/shape_type_i_c/ZZ2
new file mode 100755 (executable)
index 0000000..40a4617
--- /dev/null
@@ -0,0 +1,13 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+puts "TODO CR27414 ALL: Error :  is WRONG because number of SHELL entities in shape"
+puts "TODO CR27414 ALL: is not equal to zero"
+
+restore [locate_data_file bug26917_offset_topology.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 0
+checkprops result -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZZ3 b/tests/offset/shape_type_i_c/ZZ3
new file mode 100644 (file)
index 0000000..2072226
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input.TC504.9.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 5.83441e+007
+checkprops result -s 1.61063e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZZ4 b/tests/offset/shape_type_i_c/ZZ4
new file mode 100644 (file)
index 0000000..9debe2b
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input.TC506.73.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 4.50915e+008
+checkprops result -s 1.13645e+007
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZZ5 b/tests/offset/shape_type_i_c/ZZ5
new file mode 100644 (file)
index 0000000..911278b
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input.TC508.3.brep] s
+
+OFFSETSHAPE 22 {} $calcul $type
+
+checkprops result -v 1.14538e+008
+checkprops result -s 3.2344e+006
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZZ6 b/tests/offset/shape_type_i_c/ZZ6
new file mode 100644 (file)
index 0000000..b95d6ac
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug26917_input.TC505.1.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 6.68116e+007 -s 3.03706e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -shell 1 -face 116
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/ZZ7 b/tests/offset/shape_type_i_c/ZZ7
new file mode 100644 (file)
index 0000000..4c8d349
--- /dev/null
@@ -0,0 +1,12 @@
+puts "TODO OCC27414 ALL: Error: The command cannot be built"
+puts "TODO OCC27414 ALL: gives an empty result"
+puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+
+restore [locate_data_file bug26917_input.dom7742.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 0
+checkprops result -s 0
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZZ8 b/tests/offset/shape_type_i_c/ZZ8
new file mode 100644 (file)
index 0000000..f8669eb
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug26917_input.TC501.43.brep] s
+
+OFFSETSHAPE 12 {} $calcul $type
+
+checkprops result -v 9.59005e+008
+checkprops result -s 3.05311e+007
+
+checknbshapes result -shell 1
diff --git a/tests/offset/shape_type_i_c/ZZ9 b/tests/offset/shape_type_i_c/ZZ9
new file mode 100644 (file)
index 0000000..5b5baee
--- /dev/null
@@ -0,0 +1,11 @@
+puts "TODO CR27414 ALL: Error : The area of result shape is"
+puts "TODO CR27414 ALL: Error : The volume of result shape is"
+
+restore [locate_data_file bug26917_t114_c2.recipe_art2.brep] s
+
+OFFSETSHAPE 2 {} $calcul $type
+
+checkprops result -v 484.855
+checkprops result -s 458.883
+
+checknbshapes result -shell 1