0029322: Unify faces classification procedures in Boolean Operations
[occt.git] / tests / bugs / modalg_7 / bug22750
CommitLineData
2508ca8e 1puts "========"
2puts "OCC22750"
3puts "========"
4puts ""
5#######################################################
6# Boolean operation: Bug in Fuse
7#######################################################
8
9# Step 1: Create surface wing
10
11# Create sections as ellipses 2D (possible to create directly in 3D)
12ellipse e1 0 0 30 20
13ellipse e2 0 0 20 10
14ellipse e3 0 0 16 8
15
16# Convert 2d Curves in 3d Curves, and place them along Z axis
17to3d ee1 e1
18to3d ee2 e2; translate ee2 0 0 100
19to3d ee3 e3; translate ee3 0 0 200
20
21rotate ee2 0 0 100 0 1 0 10
22rotate ee3 0 0 200 0 1 0 20
23
24#Approximate the ellipses by Bsplines
25appro c1 16 ee1
26appro c2 16 ee2
27appro c3 16 ee3
28
29#Make a surface by approximation passing throught a set of curves
30# and create a face
31appsurf s1 c1 c2 c3
32mkface f1 s1
33
34#Make a surface by approximation passing throught a set of ellipse
35# and create a face
36appsurf s2 ee1 ee2 ee3
37mkface f2 s2
38
39# Step 2: Create surface for fuselage
40
41#Create circles in 3D along axe X
42circle c1 -100 0 0 1 0 0 10
43circle c2 -50 0 0 1 0 0 30
44circle c3 50 0 0 1 0 0 29
45circle c4 100 0 0 1 0 0 20
46circle c5 150 0 0 1 0 0 10
47
48#Make a surface by approximation passing throught a set of circles
49# and create a face
50appsurf s3 c1 c2 c3 c4 c5
51mkface f3 s3
52
53
54# Step 3: Create a Solid for the Wing
55# Build edges from ellipse, wires with edges, faces on wires
56# It's necessary to sew the faces to create the Shell, because the faces don't shared the same edge
57#sewing will create a shell, it remains to create the solid from the shell
58
59mkedge ed1 ee1
60mkedge ed3 ee3
61
62wire w1 ed1
63wire w3 ed3
64
65mkplane f5 w1
66mkplane f6 w3
67
68sewing r f2 f5 f6
69###mksol so1 r
70shape so1 So
71add r so1
72
73checkshape so1
74# The shape so1 is valid
75
76#Step 4: Create a Solid for fuselage
77# We will extract the edge from the face f3, and use them to buid faces, the edge will be shared and we
78# can rebuild a sh and a solid with the basic and fast method
79
80nexplode f3 e
81#nexplode give same order of exploration in different sessions
82
83wire w1 f3_1
84wire w3 f3_3
85mkplane f7 w1 1
86mkplane f8 w3 1
87
b7cd7c2b 88mkvolume so2 f3 f7 f8 -ni
2508ca8e 89checkshape so2
2508ca8e 90
91# Step 5: Fuse the Wing to the fuselage
92ttranslate so1 0 0 10
93bop so1 so2
94bopfuse rrr
95
b7cd7c2b 96checkshape rrr
97checknbshapes rrr -face 5 -wire 5 -shell 1 -solid 1
98checkprops rrr -s 57448.9 -v 664969
99
2508ca8e 100# Step 6: Create the othe wing using copy and rotation
101tcopy so1 so3
102trotate so3 0 0 0 1 0 0 180
103
104# Step 7: Fuse the Wing to the fuselage
105bop rrr so3
b7cd7c2b 106bopfuse result
107
108checkshape result
109checknbshapes result -wire 8 -face 7 -shell 1 -solid 1
110checkprops result -s 73752.9 -v 784375
2508ca8e 111
b7cd7c2b 112checkview -display result -2d -path ${imagedir}/${test_image}-2d.png