From 939eeb88d81b173ff7582a1e5612ec77805562c4 Mon Sep 17 00:00:00 2001 From: Eulalie Coevoet Date: Mon, 29 Jan 2024 12:19:54 +0100 Subject: [PATCH] [model] missing normalize force direction --- .../component/constraint/model/CableModel.inl | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/SoftRobots/component/constraint/model/CableModel.inl b/src/SoftRobots/component/constraint/model/CableModel.inl index f113e1f5..638dee2b 100644 --- a/src/SoftRobots/component/constraint/model/CableModel.inl +++ b/src/SoftRobots/component/constraint/model/CableModel.inl @@ -208,7 +208,6 @@ void CableModel::bwdInit() return; } - // The initial length of the cable is set or computed in bwdInit so the mapping (if there is any) // will be considered @@ -443,7 +442,6 @@ void CableModel::computePointsActionArea() computeBarycentric(closestTriangle, closestProjectionOnTriangle, m_alphaBarycentric[i], m_betaBarycentric[i]); m_closestTriangle[i] = closestTriangle; - } else { @@ -646,7 +644,6 @@ void CableModel::buildConstraintMatrix(const ConstraintParams* cParam if(!m_hasSlidingPoint) { - if ( d_hasPullPoint.getValue()) { Deriv direction = DataTypes::coordDifference(d_pullPoint.getValue(),positions[d_indices.getValue()[0]]); @@ -678,7 +675,6 @@ void CableModel::buildConstraintMatrix(const ConstraintParams* cParam for(unsigned int j=0; j::buildConstraintMatrix(const ConstraintParams* cParam directionAhead.normalize(); Deriv slidingDirection = directionBeyond - directionAhead; + slidingDirection.normalize(); if (d_hasPullPoint.getValue()) { if (id_method == 0) @@ -749,6 +746,7 @@ void CableModel::buildConstraintMatrix(const ConstraintParams* cParam directionAhead.normalize(); Deriv slidingDirection = directionBeyond - directionAhead; + slidingDirection.normalize(); if (id_method == 0) rowIterator.setCol(currentIndex, slidingDirection); @@ -756,9 +754,7 @@ void CableModel::buildConstraintMatrix(const ConstraintParams* cParam { for(unsigned int j=0; j