17 template <
typename Real>
40 std::shared_ptr<ParametricSurface<3, Real>>
mSurface;
44 template <
typename Real>
52 template <
typename Real>
64 tangent1 =
Cross(normal, tangent0);
67 template <
typename Real>
104 metricTensor(0, 0) =
Dot(values[1], values[1]);
105 metricTensor(0, 1) =
Dot(values[1], values[2]);
106 metricTensor(1, 0) = metricTensor(0, 1);
107 metricTensor(1, 1) =
Dot(values[2], values[2]);
112 curvatureTensor(0, 0) = -
Dot(normal, derUU);
113 curvatureTensor(0, 1) = -
Dot(normal, derUV);
114 curvatureTensor(1, 0) = curvatureTensor(0, 1);
115 curvatureTensor(1, 1) = -
Dot(normal, derVV);
119 Real c1 = ((Real)2) * curvatureTensor(0, 1) * metricTensor(0, 1) -
120 curvatureTensor(0, 0) * metricTensor(1, 1) -
121 curvatureTensor(1, 1) * metricTensor(0, 0);
125 Real temp = sqrt(
std::abs(c1 * c1 - ((Real)4) * c0 * c2));
126 Real mult = ((Real)0.5) / c2;
127 curvature0 = -mult * (c1 + temp);
128 curvature1 = -mult * (c1 - temp);
132 Real a0 = curvatureTensor(0, 1) - curvature0 * metricTensor(0, 1);
133 Real a1 = curvature0 * metricTensor(0, 0) - curvatureTensor(0, 0);
134 Real
length = sqrt(a0 * a0 + a1 * a1);
135 if (length > (Real)0)
137 direction0 = a0 * derU + a1 * derV;
141 a0 = curvatureTensor(1, 1) - curvature0 * metricTensor(1, 1);
142 a1 = curvature0 * metricTensor(0, 1) - curvatureTensor(0, 1);
143 length = sqrt(a0 * a0 + a1 * a1);
144 if (length > (Real)0)
146 direction0 = a0*derU + a1*derV;
157 direction1 =
Cross(direction0, normal);
gte::BSNumber< UIntegerType > abs(gte::BSNumber< UIntegerType > const &number)
void GetPrincipalInformation(Real u, Real v, Real &curvature0, Real &curvature1, Vector3< Real > &direction0, Vector3< Real > &direction1) const
Vector< N, Real > UnitCross(Vector< N, Real > const &v0, Vector< N, Real > const &v1, bool robust=false)
std::shared_ptr< ParametricSurface< 3, Real > > mSurface
GLenum GLsizei GLsizei GLint * values
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
Real Normalize(GVector< Real > &v, bool robust=false)
DualQuaternion< Real > Cross(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
GLuint GLsizei GLsizei * length
void operator()(Real u, Real v, Vector3< Real > &position, Vector3< Real > &tangent0, Vector3< Real > &tangent1, Vector3< Real > &normal) const
DarbouxFrame3(std::shared_ptr< ParametricSurface< 3, Real >> const &surface)
Real Determinant(GMatrix< Real > const &M)