Computing the Newton polytope of the discriminant from the fiber polytope. Tetrahedron equation and quantum \(R\) matrices for spin representations of \(B^{(1)}_n\), \(D^{(1)}_n\) and \(D^{(2)}_{n+1}\) 