I am trying to write a program to chamfer a given polyhedron, but I got stuck, and would like some help.
My understanding of the process of chamfering is like so:
- shrink the given polyhedron's faces by a factor $r$, $0<r<1$
- translate the shrunken faces outward, so that their edges are coplanar with the original polyhedron's edges
- construct the required hexagons from the original polyhedron's vertices and the vertices of the shrunk faces.
My problem is with step 2. I understand that I need to translate the shrunken faces in the direction of their respective normals, but I am unable to derive the equations representing the coplanarity requirement, much less the translation needed. I believe the dihedral angle of two adjacent faces is somehow involved, but I am not sure how. I will be grateful for any ideas, references, or both.
I am not an expert at this, so I can only tell you my intuition.
Say you have a polyhedron (e.g. a cube). Instead of shrinking the face and translating it, you can imagine starting from each vertex $v$, there are three vectors growing from $v$, symmetrically and with the same speed (This ensures $|\overrightarrow{vv_1}|=|\overrightarrow{vv_2}|=|\overrightarrow{vv_3}|$). That is, you do not need to translate the face manually. You just control such vectors and let the endpoint of the vectors form the desired face for you.
As long as we set up appropriate directions for $\overrightarrow{vv_1}$, $\overrightarrow{vv_2}$, and $\overrightarrow{vv_3}$ (so as for $\overrightarrow{uu_1}$, $\overrightarrow{uu_2}$, and $\overrightarrow{uu_3}$), we can make sure that $u,u_1,u_2,v,v_1,v_2$ coplanar. Imagine we connect $u$ and $v$ in the following plot. Then we have $|u_1v_1|/|uv|=r\in(0,1)$. I hope this would help.
(Please forgive my bad drawing and poor English. T_T)
P.S. I just realized that if you extend all such vector to the end, i.e., set $r\to 0$, in the following figure, you can obtain a larger polyhedron (perhaps a larger cube). Such so-called chamfering can somewhat be regarded as cutting the vertices of the larger cube?! with the cut faces squares.