3bea4c16 |
1 | puts "================" |
2 | puts "OCC23174" |
3 | puts "================" |
4 | puts "" |
5 | ############################################################################## |
6 | # BRepLib_MakeFace(Wire) creates an invalid face on a wire of cylinder bottom |
7 | ############################################################################## |
8 | |
9 | set BugNumber OCC23174 |
10 | |
11 | catch {pload XDE} |
12 | |
13 | set status 0 |
14 | |
15 | # make a cylinder |
16 | pcylinder cyl 50 150 |
17 | |
18 | # get wires |
19 | explode cyl W |
20 | |
21 | # make a face from the 3-d wire (planar bottom of the cylinder) |
22 | mkplane f cyl_3 0 |
23 | |
24 | # BUG: face is built on a cylindrical face of the cylinder instead of |
25 | # a bottom face |
26 | set reslog [checkshape f -short] |
27 | puts $reslog |
28 | if { $reslog != "This shape seems to be valid" } { set status 1 } |
29 | |
30 | # ======================================================================== |
31 | # Make a new cylindrical face from a wire composed from more than 3 edges |
32 | # to check that the bug fix is valid for a wire of more than 1 edge |
33 | # ======================================================================== |
34 | |
35 | # get a bottom edge cyl_1; cyl_2 is a top edge; cyl_3 is a seam edge |
36 | nexplode cyl E |
37 | |
38 | # get its 3D curve |
39 | mkcurve c3D cyl_1 |
40 | |
41 | # split cyl_1 into 3 edges |
42 | mkedge e1 c3D 0 2 |
43 | mkedge e2 c3D 2 4 |
44 | mkedge e3 c3D 4 6.28318530717959 |
45 | |
46 | # make a reversed seam |
47 | copy cyl_3 cyl_3_r |
48 | treverse cyl_3_r |
49 | |
50 | # make a new wire for a new cylindrical face |
51 | wire w e1 e2 e3 cyl_3 cyl_2 cyl_3_r |
52 | |
53 | # get a surface for a new face |
54 | nexplode cyl F |
55 | mksurface cyl_surf cyl_3 |
56 | |
57 | # make a new cylindrical face |
58 | mkface cyl_face_0 cyl_surf w |
59 | fixshape cyl_face cyl_face_0 |
60 | |
61 | # make a wire of 3 bottom edges to check the fix |
62 | explode cyl_face E |
63 | wire w cyl_face_2 cyl_face_1 cyl_face_3 |
64 | |
65 | # check the fix, i.e. that cylindrical surface is rejected and thus a valid face is built |
66 | mkplane f w 0 |
67 | donly f |
68 | set res_log [checkshape f -short] |
69 | puts $reslog |
70 | if { $reslog != "This shape seems to be valid" } { set status 1 } |
71 | |
72 | # ================================================================= |
73 | #check that mkplane finds cyl_surf if the wire of cyl_face is given |
74 | # ================================================================= |
75 | |
76 | explode cyl_face W |
77 | mkplane f cyl_face_1 0 |
78 | |
79 | # get surface of f |
80 | mksurface cyl_surf_2 f |
81 | |
82 | # compare points of 2 surfaces at same UV |
83 | svalue cyl_surf 1 1 x1 y1 z1 |
84 | svalue cyl_surf_2 1 1 x2 y2 z2 |
85 | |
86 | if { [ expr [dval x1] - [dval x2] ] > 0.0 } { set status 1 } |
87 | if { [ expr [dval y1] - [dval y2] ] > 0.0 } { set status 1 } |
88 | if { [ expr [dval z1] - [dval z2] ] > 0.0 } { set status 1 } |
89 | |
90 | # Resume |
91 | puts "" |
92 | if { ${status} != 0 } { |
93 | puts "Faulty ${BugNumber}" |
94 | } else { |
95 | puts "OK ${BugNumber}" |
96 | } |
97 | renamevar f result |
98 | set square 47123.9 |
99 | set 2dviewer 0 |
100 | |
101 | |
102 | |
103 | |