0025138: SIGSEGV when sweeping along helix
[occt.git] / tests / bugs / modalg_2 / bug23174
CommitLineData
3bea4c16 1puts "================"
2puts "OCC23174"
3puts "================"
4puts ""
5##############################################################################
6# BRepLib_MakeFace(Wire) creates an invalid face on a wire of cylinder bottom
7##############################################################################
8
9set BugNumber OCC23174
10
11catch {pload XDE}
12
13set status 0
14
15# make a cylinder
16pcylinder cyl 50 150
17
18# get wires
19explode cyl W
20
21# make a face from the 3-d wire (planar bottom of the cylinder)
22mkplane f cyl_3 0
23
24# BUG: face is built on a cylindrical face of the cylinder instead of
25# a bottom face
26set reslog [checkshape f -short]
27puts $reslog
28if { $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
36nexplode cyl E
37
38# get its 3D curve
39mkcurve c3D cyl_1
40
41# split cyl_1 into 3 edges
42mkedge e1 c3D 0 2
43mkedge e2 c3D 2 4
44mkedge e3 c3D 4 6.28318530717959
45
46# make a reversed seam
47copy cyl_3 cyl_3_r
48treverse cyl_3_r
49
50# make a new wire for a new cylindrical face
51wire w e1 e2 e3 cyl_3 cyl_2 cyl_3_r
52
53# get a surface for a new face
54nexplode cyl F
55mksurface cyl_surf cyl_3
56
57# make a new cylindrical face
58mkface cyl_face_0 cyl_surf w
59fixshape cyl_face cyl_face_0
60
61# make a wire of 3 bottom edges to check the fix
62explode cyl_face E
63wire 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
66mkplane f w 0
67donly f
68set res_log [checkshape f -short]
69puts $reslog
70if { $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
76explode cyl_face W
77mkplane f cyl_face_1 0
78
79# get surface of f
80mksurface cyl_surf_2 f
81
82# compare points of 2 surfaces at same UV
83svalue cyl_surf 1 1 x1 y1 z1
84svalue cyl_surf_2 1 1 x2 y2 z2
85
86if { [ expr [dval x1] - [dval x2] ] > 0.0 } { set status 1 }
87if { [ expr [dval y1] - [dval y2] ] > 0.0 } { set status 1 }
88if { [ expr [dval z1] - [dval z2] ] > 0.0 } { set status 1 }
89
90# Resume
91puts ""
92if { ${status} != 0 } {
93 puts "Faulty ${BugNumber}"
94} else {
95 puts "OK ${BugNumber}"
96}
97renamevar f result
58cf74e0 98checkprops result -s 47123.9
99checkshape result
5747059b 100checkview -display result -2d -path ${imagedir}/${test_image}.png
3bea4c16 101
102
103
104