Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions src/BeamAdapter/component/BaseBeamInterpolation.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ class BaseBeamInterpolation : public sofa::core::behavior::SingleStateAccessor<D
Data< sofa::type::vector<EdgeID> > d_beamCollision;

Data<bool> d_dofsAndBeamsAligned;

/// index of the beam extremity that is considered as the tip of the wire
Data <sofa::Index> d_wireTipIndex;

/// link to the (edge) topology
SingleLink<BaseBeamInterpolation<DataTypes>, BaseMeshTopology, BaseLink::FLAG_STOREPATH|BaseLink::FLAG_STRONGLINK> l_topology;
Expand Down
5 changes: 5 additions & 0 deletions src/BeamAdapter/component/BaseBeamInterpolation.inl
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ BaseBeamInterpolation<DataTypes>::BaseBeamInterpolation()
, d_beamCollision(initData(&d_beamCollision, "beamCollision", "list of beam (in edgeList) that needs to be considered for collision"))
, d_dofsAndBeamsAligned(initData(&d_dofsAndBeamsAligned, true, "dofsAndBeamsAligned",
"if false, a transformation for each beam is computed between the DOF and the beam nodes"))
, d_wireTipIndex(initData(&d_wireTipIndex, (sofa::Index)0, "wireTipIndex", "index of the beam extremity that is considered as the tip of the wire"))
, l_topology(initLink("topology", "link to the topology (must contain edges)"))
{

Expand Down Expand Up @@ -186,6 +187,9 @@ void BaseBeamInterpolation<DataTypes>::addBeam(const EdgeID eID, const Real leng
d_dofsAndBeamsAligned.setValue(false);
DOF0TransformNode0.push_back(Transform(Vec3(0, 0, 0), QuatX));
DOF1TransformNode1.push_back(Transform(Vec3(0, 0, 0), QuatX));

const BaseMeshTopology::Edge& edge = l_topology->getEdge(eID);
d_wireTipIndex.setValue(edge[1]);
}


Expand Down Expand Up @@ -392,6 +396,7 @@ void BaseBeamInterpolation<DataTypes>::getTangent(Vec3& t, const Real baryCoord,
}


// TODO check why this method is called in continue
template<class DataTypes>
int BaseBeamInterpolation<DataTypes>::getNodeIndices(const EdgeID edgeInList,
unsigned int& node0Idx,
Expand Down
Loading