Wings uses the winged-edge data structure to represent all models. It means that all the models are represented as manifolds. Each model is a collection of objects homeomorphic to 2-spheres. Non-manifold parts are represented as folded manifold surfaces. Here, we observe how non-manifold properties are represented through studying a simple model created by wings3D.

The non-manifold properties we want to study are:

- non-manifold compartments
- dangling faces
- wire edges

- create a simple object
- inset
- extrude
- cut edge
- connect vertices
- loop cut
- extrude
- bridge
- intrude

Step 1, we want to create a simple model. So we create a cube. The cube is homeomorphic to a 2-sphere. Now, examine the obj file created by wings for this cube: 1-cube.obj. We can see that this model has just one object, called "cube1". This object has 8 vertices and 6 faces. (In this tutorial, an object is equivalent to a shell.)

Step 2, we inset the top face of the cube. The inset operation creates a face of the same shape as the top face. Then it connects each vertex of the top face to the corresponding vertex on the new face. Thus it partitions the original face into 5 new faces on the same plane. If we examine the obj file of this object: 2-inset.obj, we can see that the model is defined by just one object homeomorphic to a 2-sphere. Now this object has 12 vertices and 10 faces.

Step 3, we extrude the center face on the top of the cube. The extrude operator pull the face outward and creates new faces that connects the boundary of the extruded face to the original object. The object is still homeomorphic to a 2-sphere, but it has 4 more vertices and 4 more faces. An examination of the 3-extrude.obj file shows us that the model is still one object, with 16 vertices and 14 faces.

Step 4, we select the vertical edges on the extruded part of the cube, and cut each edge into two. So we have added 4 more vertices and 4 new edges to the model, which is still one object. See the obj file 4-cutedgesTo2.obj for the details of this model.

Step 5, we connect the vertices created in step 4. The connect operation create 4 new edges; each new edge partition one face into two. They form a loop (cycle) around the upper cube. See the obj file 5-connectmidpoints.obj to see that this model is now one object with 20 vertices and 18 faces.

Step 6, we want to create non-manifold compartments. To do so, we select this loop of edges and do a loop cut. The model is cut into two pieces along the loop. Here is an example of non-manifold two compartments. The model now has two objects connected together. The bottom face of the upper object touches the top face of the lower object. Examine the obj file: 6-loopcut.obj, and we can see that the upper object is a cube with 8 vertices and 6 faces, while the lower object has 16 vertices and 14 faces. Notice that 4 vertices and 1 face are duplicates.

Step 7, we want to create dangling faces. We do so through an extrude operation. To understand what happens when we extrude an edge, let us see a simple example here. When we extrude an edge e defined by two vertices u and v, each edge (except e itself) that incident at vertex u or vertex v is cut to two. The cutting points are connected together to form a loop as follows. If there are m such edges, then an extrude operation will create m new vertices m new edges and m new faces. The following diagram illustrates this operation. The new edges and vertices are shown in red, but the new faces are not coloured.

When we extrude a loop of edges, the operation is similar, except that the new edges that are created will form two loops. But if we extrude a loop of edges e1, e2, ..., ek that bound a face f, then the operation creates an inner face and connect the vertices of the inner face with the outer face. See the following diagram for an illustration. The new edges and vertices are shown in red.

Now back to our model created up to step 6, in this step, we select the 4 edges on the top of the model, and extrude them. This operation creates 8 new vertices, 8 new edges and 8 new faces. We can shrink the thickness of the extruded part until it becomes a sheet of zero thickness. It means that the two sides of the extruded parts become identical to each other. Thus, we have created four dangling faces but folding up the extruded part of the object. If we examine the obj file 7-extrudeTopEdges.obj, we can see that the upper object has 16 vertices and 14 faces, but 4 vertices and 4 faces are duplicates.

Step 8, now we study what happens when we create a wire edge. We do so by extruding a vertex. See here for a simple example of extruding a vertex. Suppose v is the vertex we want to extrude, then all the edges incident at v are cut. The newly created vertices at the cuts are connected to form a loop around v. Thus, if there are m edges incident at v, then m new vertices, 3m new edges, and m new faces are created as shown in red in the following illustration. When we shrink the thickness of the extruded part to zero, we get a wire edge. Because of the m new faces have zero area, 2m new edges are all identical to the wire edge, the remaining m new edges have zero length. The m new vertices are identical to the original vertex before its extrusion.

Now we create a wire edge at one top corner of our model. We choose a corner of two dangling faces. Remember that the dangling faces are a folded surface. Therefore, there are actually 4 edges (that is, 3 unique one and one duplicate) incident at the corner. When we extrude the vertex,

we create 4 more faces, 12 more edges and 4 more vertices than step 7. Now if we examine the obj file: 8-extrudeTopCorner.obj, we can see that we have 20 vertices and 18 faces in the upper object.

Step 9, move the two objects apart and select the bottom face of the upper object and the top face of the lower object. This is a preparation to the next step. Moving the two objects apart does not change the topology of the model. We can see this in the obj file: 9-moveapart.obj.

Step 10, we are going to connect the two objects together using a bridge operation. The bridge operation requires that the two selected faces have the same number of edges on their boundary. It pair up each edge on one face with one edge on the other face. The two selected faces are then removed, and each pair of edges are connected by a new face. If the original 2 selected faces have m edges each, then m new faces and m new edges are created. If the two faces belong to two different object, then the two objects become one. We can see this when we examine the obj file 10-bridge.obj. The model now has just one object.

Step 11, so far, we have created just one model with cavity. Now we prepare ourselves to create holes in the model. A hole is topologically equivalent to a handle. It is created by the intrude operation. In this step, we want to select the faces that we want to intrude. Here we have selected 4 faces: one on the top and three at one side. Since we have done nothing more than selecting the faces, the model is not changed in this step. The obj file 11-selectintrude.obj is the same as that in the previous step.

Step 12, we intrude the model at the selected faces. To understand what intrude does, let us examine a simple example here, in which we select the top face of a cube and perform an intrude on the cube. In this operation, the selected face is removed. After the removal, a duplicate of the cube is created. The duplicate is smaller than the original, and its size can be adjusted. Then, four new faces are created to connect the boundary of the original open cube and the boundary of its duplicate. If you adjust the size of the duplicate so that it is as big as the original, then these new faces have zero area. You can use intrude to create a topological handle. Here is an example, in which the top and the bottom facse of the cube are selected for intrusion. After intruding, you have a hollow piller (its genus is 2).

In general, suppose you have one object with F faces and V vertices. You select m faces for intrusion, and the boundaries of these m faces have n vertices in total. Then, the resultant object will have 2(F-m)+n faces and 2V vertices. Back to our example in step 11, we have selected 4 faces for intrusion. The top face has 4 vertices, and the three connected faces at the side has 8 vertices on their boundary. When we perform intrude, the 4 faces are removed. 12 new faces are created. We make the duplicate as big as the original, so these 12 new faces have zero areas. You can compare the obj file 12-intrude4faces.obj with that of step 11. The final object has 72 vertices and 72 faces.