Skip to content

Commit 357954f

Browse files
committed
[Needle][algorithm] Changed algorithm to re-project volume proximities onto the needle geometry
1 parent 0be1fea commit 357954f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/sofa/collisionAlgorithm/algorithm/InsertionAlgorithm.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,17 @@ class InsertionAlgorithm : public BaseAlgorithm {
158158
m_needlePts.push_back(m_needlePts.back());
159159

160160
auto itfromVol = l_fromVol->begin(l_fromVol->getSize() - 1 - m_couplingPts.size());
161-
auto createProximityOp_vol = Operations::CreateCenterProximity::Operation::get(itfromVol->getTypeInfo());
161+
//auto createProximityOp_vol = Operations::CreateCenterProximity::Operation::get(itfromVol->getTypeInfo());
162+
163+
auto findClosestProxOp_needle = Operations::FindClosestProximity::Operation::get(l_fromVol);
164+
auto projectOp_needle = Operations::Project::Operation::get(l_fromVol);
162165

163166
for(int i = 0 ; i < m_needlePts.size() - 1; i++)
164167
{
165-
auto pfromVol = createProximityOp_vol(itfromVol->element());
168+
//auto pfromVol = createProximityOp_vol(itfromVol->element());
169+
auto pfromVol = findClosestProxOp_needle(m_couplingPts[i], l_fromVol.get(), projectOp_needle, getFilterFunc());
166170
if (d_projective.getValue()) {
167-
auto pfromVolProj = projectFromOp_vol(pdestVol->getPosition(), itfromVol->element()).prox;
171+
auto pfromVolProj = projectFromOp_vol(m_couplingPts[i]->getPosition(), itfromVol->element()).prox;
168172
if (pfromVolProj == nullptr) continue;
169173
pfromVolProj->normalize();
170174
m_needlePts[i] = pfromVolProj;

0 commit comments

Comments
 (0)