5 #######################################################
6 # Boolean operation: Bug in Fuse
7 #######################################################
9 # Step 1: Create surface wing
11 # Create sections as ellipses 2D (possible to create directly in 3D)
16 # Convert 2d Curves in 3d Curves, and place them along Z axis
18 to3d ee2 e2; translate ee2 0 0 100
19 to3d ee3 e3; translate ee3 0 0 200
21 rotate ee2 0 0 100 0 1 0 10
22 rotate ee3 0 0 200 0 1 0 20
24 #Approximate the ellipses by Bsplines
29 #Make a surface by approximation passing throught a set of curves
34 #Make a surface by approximation passing throught a set of ellipse
36 appsurf s2 ee1 ee2 ee3
39 # Step 2: Create surface for fuselage
41 #Create circles in 3D along axe X
42 circle c1 -100 0 0 1 0 0 10
43 circle c2 -50 0 0 1 0 0 30
44 circle c3 50 0 0 1 0 0 29
45 circle c4 100 0 0 1 0 0 20
46 circle c5 150 0 0 1 0 0 10
48 #Make a surface by approximation passing throught a set of circles
50 appsurf s3 c1 c2 c3 c4 c5
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
74 # The shape so1 is valid
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
81 #nexplode give same order of exploration in different sessions
88 mkvolume so2 f3 f7 f8 -ni
91 # Step 5: Fuse the Wing to the fuselage
97 checknbshapes rrr -face 5 -wire 5 -shell 1 -solid 1
98 checkprops rrr -s 57448.9 -v 664969
100 # Step 6: Create the othe wing using copy and rotation
102 trotate so3 0 0 0 1 0 0 180
104 # Step 7: Fuse the Wing to the fuselage
109 checknbshapes result -wire 8 -face 7 -shell 1 -solid 1
110 checkprops result -s 73752.9 -v 784375
112 checkview -display result -2d -path ${imagedir}/${test_image}-2d.png