Typical airplane has many different holes, in its fuselage and wings. Blender has some Boolean commands. You can use them, to create a hole in a mesh, but they can sometimes produce not exactly the results, you want. Usually there are problems with the faces around the new (crossing) edge. I have found myself many times on deleting the ones, originally created by the Boolean operation. After their removal, I had to create manually a more “regular” face pattern around such hole.
Ultimately, I concluded, that I need a tool, which would produce just the common edge of two crossing meshes. It was more practical to create the new faces around it manually, not spending time on removing the automatically created ones. So, here is such tool. I have found it useful, maybe you also utilize it.
Here you can download the CrossSection.py script file.
To follow this tutorial, you should place the Cross Section script into your Blender script directory (here is the tutorial, which explains how to do that).
To the default Blender cube I have added a second mesh object – a cylinder:
If you want to repeat exactly what I have done: I have just added new cylinder it in the "three-quarters" isometric view (Fig. 1.2.). It was created using Add=>Mesh=>Cylinder command, with following parameters: vertices: 32, radius: 1, depth: 2, no cap ends.
Now:
Do not change anything on the dialog box. Just click the OK button.
Almost immediately (because both meshes are rather simple) the active object has been switched into Edit mode. The new edge – containing the vertices of the cross section – has been added to it. Do with the cross-section edge what you want. If you are not satisfied with this result – just press [X] to remove it, and then [Tab] to switch back into Object mode.
The dialog box of the Cross Section script contains a short description of operation, and two option toggles.
Description of the operation informs about the number of the faces, that will be examined, in each mesh. The “A” mesh is the mesh of the active object – the object, which you have selected as the second one. The cross section edge is always added to the “A” mesh. From the operation description you can also learn the name of the “A” mesh (in Fig. 2.1 – Cube). The second mesh is called “B”. This dialog box presents analogical information for it, like for the “A” mesh: number of triangle faces, mesh name (in Fig. 2.1. – Tube).
Use B edges option. If you switch it off, the result will contain the vertices found along the “A” mesh edges, only. It is turned on by default, what means that the result will contain vertices obtained from both meshes;
Use diagonals option. During the calculations every four-vertex face is turned into two triangles, along the shorter diagonal. If you want to have include the results of crossing such diagonals with opposite mesh faces, turn this option on. Usually you will need it in special cases, only (like calculation of the cross section of two cubes).
It is possible to calculate the common edge for selected fragments of the object's meshes, only. To do it, in Edit mode just select the faces, you want to use for these calculations, in each mesh. Then select both objects for the Cross Section operation, like in the previous section:
Issue the Object=>Scripts=>Cross Section command. A dialog box will appear. Compare it to the one from Fig. 3.3. Have you noticed, that the one from Fig. 3.3 declares smaller number of the faces?
When you click the OK button, you will see the result:
I have worked hard on the algorithm that connects properly the cross-section vertices, which have been found. Anyway, sometimes it may happen, that you will miss some important fragment of this edge. It is usually a problem of the script with determining the order of the vertices along the cross edge. Such case you can see in Fig. 4.1.
There are two possible workarounds: