Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/CollisionAlgorithm/algorithm/InsertionAlgorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ class InsertionAlgorithm : public BaseAlgorithm
auto projectOnSurf = Operations::Project::Operation::get(l_surfGeom);
auto projectOnTip = Operations::Project::Operation::get(l_tipGeom);

const bool isProjective = d_projective.getValue();
const SReal punctureForceThreshold = d_punctureForceThreshold.getValue();
for (auto itTip = l_tipGeom->begin(); itTip != l_tipGeom->end(); itTip++)
{
Expand Down Expand Up @@ -167,13 +166,7 @@ class InsertionAlgorithm : public BaseAlgorithm
}
}

// 1.2 If not, create a proximity pair for the tip-surface collision
if (isProjective)
{
tipProx = projectOnTip(surfProx->getPosition(), itTip->element()).prox;
if (!tipProx) continue;
tipProx->normalize();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure this normalization was never useful for the rest of the algo?

if yes, ok for me. Let's double check ci as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it does nothing. Check the implementation:

bool isNormalized() const override { return true; }
void normalize() override {}

normalize() is empty and isNormalized() always returns true.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hum... and is it normal that it is empty?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it should be because the normalization simply corrects the projection by placing the proximity inside the simplex. I guess it's there because the projection can in fact shoot the new point outside the simplex. But the PointProximity is the most trivial case. Projecting on a point simply means "use that point".

Check the EdgeProximity implementation:

bool isNormalized() const override {
// if (m_f0+m_f1 != 1.0) return false;
return m_f0>=0 && m_f0<=1 &&
m_f1>=0 && m_f1<=1;
}
void normalize() override {
if (m_f1<0.0) m_f1 = 0.0;
else if (m_f1>1.0) m_f1 = 1.0;
m_f0 = 1.0-m_f1;
}

m_f0 and m_f1 are the bary coords.

}
// ... if not, create a proximity pair for the tip-surface collision
collisionOutput.add(tipProx, surfProx);
}
}
Expand Down
Loading