You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/ElementCorotationalFEMForceField.h
Copy file name to clipboardExpand all lines: Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/ElementLinearSmallStrainFEMForceField.h
if (normalNorm2 > std::numeric_limits<T>::epsilon())
200
+
{
201
+
constauto d = sofa::type::dot(p0 - n0, normal);
202
+
if (d * d / normalNorm2 > std::numeric_limits<T>::epsilon())
203
+
returnfalse;
204
+
}
205
+
206
+
returntrue;
207
+
}
208
+
else
209
+
{
210
+
// all points are trivially in the same plane
211
+
returntrue;
212
+
}
213
+
}
214
+
153
215
/**
154
216
* @brief Test if input point is inside Triangle (n0, n1, n2) using Triangle @sa getBarycentricCoordinates . The point is inside the Triangle if and only if Those coordinates are all positive.
155
217
* @tparam Node iterable container
156
218
* @tparam T scalar
157
219
* @param p0: position of the point to test
158
220
* @param n0, n1, n2: nodes of the triangle
159
221
* @param output parameter: sofa::type::Vec<3, T> barycentric coordinates of the input point in Triangle
222
+
* @param assumePointIsOnPlane: optional bool to avoid testing if the point is on the plane defined by the triangle
160
223
* @return bool result if point is inside Triangle.
161
224
*/
162
225
template<typename Node,
163
226
typename T = std::decay_t<decltype(*std::begin(std::declval<Node>()))>,
0 commit comments