CAD is based on mathematics. The formula I was impressed by the most when I joined the CAD industry was Euler's formula.
v - e + f = 2(1 - g)
Where 'v' is the number of vertices, 'e' is the number of edges, and 'f' is the number of faces. 'g' means 'genus', which I will explain later.
I was surprised by the fact that every polyhedral object satisfies this formula. In this entry, we will verify this formula with some concrete examples. Let's begin with a simple cube.
First, you should keep in mind that the genus of a cube is zero. You will know why later. Then, we can simplify the formula as below.
v - e + f = 2
What we should do is to count vertices, edges, and faces in a cube. It's really easy work. The 'v'(the number of vertices in a cube) is 8. The 'e'(the number of edges in a cube) is 12, and the 'f'(the number of faces in a cube) is 6. Substitute these numbers in the formula.
v - e + f = 8 - 12 + 6 = 2
Bingo! This simple cube satisfies Euler's formula indeed.
Next, you might wonder what will happen if each quadrangle face of the cube is split into 2 triangles. Let's verify this case.
In this case, e becomes 18(= 12 + 6) and f becomes 12(= 2 * 6) because each face is split into two triangles with one diagonal edge. v remains 8, of course. Substitute these numbers in the formula.
v - e + f = 8 - 18 + 12 = 2
Bingo! This is amazing, isn't it?
Next example is a little complex. Can you count v, e, and f in this object?
v is 16, e is 32, and f is 16. Let's substitute these numbers.
v - e + f = 16 - 32 + 16 = 0
Oops! What is wrong?
Now, you need to know what the 'genus' is. The genus means the number of holes in an object. Because there is one hole in the above object like a doughnut, the genus 'g' is 1. Now you can understand why the genus of a cube is zero. So, In this case, Euler's formula must be written as below.
v - e + f = 0
So, the doughnut satisfies Euler's formula indeed.
This theory is categorized as topology. Note that geometrical shapes don't matter in topology. Only linkages between vertices, edges, and faces matter. Topology interested me because it's really different from geometry I learned at high school.
Every solid kernel, which is a calculation engine of 3D CAD, is equipped with 2 kinds of operations. The one is a kind of geometrical operations, and the other is a kind of topological operations, which is called Euler operations. I feel it's amazing that such abstract mathematics is alive in CAD software. Don't you think so?
0 件のコメント:
コメントを投稿