|
BeamAdapter
|
Public Member Functions | |
| SOFA_CLASS (SOFA_TEMPLATE(BaseBeamInterpolation, DataTypes), SOFA_TEMPLATE(sofa::core::behavior::SingleStateAccessor, DataTypes)) | |
| void | init () override |
| virtual void | clear () |
| virtual void | addBeam (const EdgeID eID, const Real length, const Real x0, const Real x1, const Real angle) |
| sofa::Size | getNumBeams () const |
| void | getAbsCurvXFromBeam (const sofa::Index beam, Real &x_curv) |
| void | getAbsCurvXFromBeam (const sofa::Index beam, Real &x_curv_start, Real &x_curv_end) |
| virtual Real | getRestTotalLength ()=0 |
| getLength / setLength => provides the rest length of each spline using | |
| Real | getLength (const EdgeID edgeInList) |
| void | setLength (const EdgeID edgeInList, Real &length) |
| virtual void | getMechanicalSampling (Real &dx, const Real x_localcurv_abs)=0 |
| virtual void | getCollisionSampling (Real &dx, const Real x_localcurv_abs)=0 |
| Collision information using. | |
| void | addCollisionOnBeam (const sofa::Index beam) |
| Set collision information. | |
| void | clearCollisionOnBeam () |
| virtual void | getSamplingParameters (type::vector< Real > &xP_noticeable, type::vector< sofa::Size > &nbP_density)=0 |
| virtual void | getNumberOfCollisionSegment (Real &dx, sofa::Size &numLines)=0 |
| virtual void | getCurvAbsAtBeam (const EdgeID edgeInList_input, const Real baryCoord_input, Real &x_output)=0 |
| virtual void | getSplineRestTransform (const EdgeID edgeInList, Transform &local_H_local0_rest, Transform &local_H_local1_rest)=0 |
| virtual const BeamSection & | getBeamSection (const sofa::Index beamId)=0 |
| Returns the BeamSection. | |
| virtual void | getInterpolationParameters (const sofa::Index beamId, Real &_L, Real &_A, Real &_Iy, Real &_Iz, Real &_Asy, Real &_Asz, Real &J)=0 |
| Returns the BeamSection data depending on the beam position at the given beam, similar to @getBeamSection. | |
| virtual void | getMechanicalParameters (const sofa::Index beamId, Real &youngModulus, Real &cPoisson, Real &massDensity)=0 |
| Returns the Young modulus, Poisson's ratio and massDensity coefficient of the section at the given curvilinear abscissa. | |
| virtual void | getBeamAtCurvAbs (const Real x_input, sofa::Index &edgeInList_output, Real &baryCoord_output, unsigned int start=0) |
| int | computeTransform (const EdgeID edgeInList, Transform &global_H_local0, Transform &global_H_local1, const VecCoord &x) |
| int | computeTransform (const EdgeID edgeInList, const PointID node0Idx, const PointID node1Idx, Transform &global_H_local0, Transform &global_H_local1, const VecCoord &x) |
| void | getDOFtoLocalTransform (const EdgeID edgeInList, Transform &DOF0_H_local0, Transform &DOF1_H_local1) |
| void | getDOFtoLocalTransformInGlobalFrame (const EdgeID edgeInList, Transform &DOF0Global_H_local0, Transform &DOF1Global_H_local1, const VecCoord &x) |
| void | setTransformBetweenDofAndNode (const sofa::Index beam, const Transform &DOF_H_Node, unsigned int zeroORone) |
| void | getTangent (Vec3 &t, const Real baryCoord, const Transform &global_H_local0, const Transform &global_H_local1, const Real L) |
| getTangent : Computation of a Tangent for the beam (it is given by the derivative of the spline formulation) | |
| int | getNodeIndices (const EdgeID edgeInList, unsigned int &node0Idx, unsigned int &node1Idx) |
| void | getSplinePoints (const EdgeID edgeInList, const VecCoord &x, Vec3 &P0, Vec3 &P1, Vec3 &P2, Vec3 &P3) |
| unsigned int | getStateSize () const |
| void | computeActualLength (Real &length, const Vec3 &P0, const Vec3 &P1, const Vec3 &P2, const Vec3 &P3) |
| void | computeStrechAndTwist (const EdgeID edgeInList, const VecCoord &x, Vec3 &ResultNodeO, Vec3 &ResultNode1) |
| void | updateBezierPoints (const VecCoord &x, sofa::core::VecCoordId &vId_Out) |
| vId_Out provides the id of the multiVecId which stores the position of the Bezier Points | |
| void | updateBezierPoints (const VecCoord &x, sofa::Index index, VectorVec3 &v) |
| void | interpolatePointUsingSpline (const EdgeID edgeInList, const Real baryCoord, const Vec3 &localPos, const VecCoord &x, Vec3 &posResult) |
| spline base interpolation of points and transformation | |
| void | interpolatePointUsingSpline (const EdgeID edgeInList, const Real baryCoord, const Vec3 &localPos, const VecCoord &x, Vec3 &posResult, bool recompute, const sofa::core::ConstVecCoordId &vecXId) |
| void | InterpolateTransformUsingSpline (const EdgeID edgeInList, const Real baryCoord, const Vec3 &localPos, const VecCoord &x, Transform &global_H_localInterpol) |
| void | InterpolateTransformUsingSpline (Transform &global_H_localResult, const Real baryCoord, const Transform &global_H_local0, const Transform &global_H_local1, const Real L) |
| void | InterpolateTransformAndVelUsingSpline (const EdgeID edgeInList, const Real baryCoord, const Vec3 &localPos, const VecCoord &x, const VecDeriv &v, Transform &global_H_localInterpol, Deriv &v_interpol) |
| Real | ComputeTotalBendingRotationAngle (const Real dx_computation, const Transform &global_H_local0, const Transform &global_H_local1, const Real L, const Real baryCoordMin, const Real baryCoordMax) |
| compute the total bending Rotation Angle while going through the Spline (to estimate the curvature) | |
| void | MapForceOnNodeUsingSpline (const EdgeID edgeInList, const Real baryCoord, const Vec3 &localPos, const VecCoord &x, const Vec3 &finput, SpatialVector &FNode0output, SpatialVector &FNode1output) |
| 3DOF mapping | |
| void | MapForceOnNodeUsingSpline (const EdgeID edgeInList, const Real baryCoord, const Vec3 &localPos, const VecCoord &x, const SpatialVector &f6DofInput, SpatialVector &FNode0output, SpatialVector &FNode1output) |
| 6DoF mapping | |
Static Public Member Functions | |
| static void | getControlPointsFromFrame (const Transform &global_H_local0, const Transform &global_H_local1, const Real L, Vec3 &P0, Vec3 &P1, Vec3 &P2, Vec3 &P3) |
| static void | RotateFrameForAlignX (const Quat &input, Vec3 &x, Quat &output) |
| Method to rotate a Frame define by a Quat. | |
| static void | RotateFrameForAlignNormalizedX (const Quat &input, const Vec3 &x, Quat &output) |
| Method to rotate a Frame define by a Quat. | |
Public Attributes | |
| MechanicalObject< StateDataTypes >::SPtr | m_StateNodes |
| Data< VecEdgeID > | d_edgeList |
| Data< type::vector< SReal > > | d_lengthList |
| Data< type::vector< Transform > > | d_DOF0TransformNode0 |
| Data< type::vector< Transform > > | d_DOF1TransformNode1 |
| Data< type::vector< Vec2 > > | d_curvAbsList |
| Vector of 2 Real. absciss curv of first and second point defining the beam. | |
| Data< sofa::type::vector< EdgeID > > | d_beamCollision |
| Data< bool > | d_dofsAndBeamsAligned |
| Data< sofa::Index > | d_wireTipIndex |
| index of the beam extremity that is considered as the tip of the wire | |
| SingleLink< BaseBeamInterpolation< DataTypes >, BaseMeshTopology, BaseLink::FLAG_STOREPATH|BaseLink::FLAG_STRONGLINK > | l_topology |
| link to the (edge) topology | |
| void computeActualLength | ( | Real & | length, |
| const Vec3 & | P0, | ||
| const Vec3 & | P1, | ||
| const Vec3 & | P2, | ||
| const Vec3 & | P3 ) |
the computation of integral Int[0,1]_||dP(x)||_ dx = length is done using Gauss Points
definition of the Gauss points
formula with 4 Gauss Points
| void computeStrechAndTwist | ( | const EdgeID | edgeInList, |
| const VecCoord & | x, | ||
| Vec3 & | ResultNodeO, | ||
| Vec3 & | ResultNode1 ) |
ResultNode = [half length of the beam (m), geometrical Twist angle (rad), additional mechanical Twist angle (rad)]
spline:
compute length
compute frame => Kenneth method
bx == 0.5 => frame of the beam (without mechanical twist)
computation of twist angle:
<<" Test : x_1 = "<<x_1<< " should be equal to ="<< globalRgeom1.rotate(Vec3(1.0,0.0,0.0))<<std::endl;
| BaseBeamInterpolation< DataTypes >::Real ComputeTotalBendingRotationAngle | ( | const Real | dx_computation, |
| const Transform & | global_H_local0, | ||
| const Transform & | global_H_local1, | ||
| const Real | L, | ||
| const Real | baryCoordMin, | ||
| const Real | baryCoordMax ) |
compute the total bending Rotation Angle while going through the Spline (to estimate the curvature)
ComputeTotalBendingRotationAngle This function compute a global bending angle value for the current position of the beam Principle: computation of several tangent between node0 to the node1 (given by numComputationPoints) and computation of an angle (acos) between these successive tangents
| int computeTransform | ( | const EdgeID | edgeInList, |
| const PointID | node0Idx, | ||
| const PointID | node1Idx, | ||
| Transform & | global_H_local0, | ||
| Transform & | global_H_local1, | ||
| const VecCoord & | x ) |
no error
| int computeTransform | ( | const EdgeID | edgeInList, |
| Transform & | global_H_local0, | ||
| Transform & | global_H_local1, | ||
| const VecCoord & | x ) |
|
virtual |
lTotalRest = total length of the
LTotal = length sum of the beams that are "out"
we find the length of the beam that is "out"
x_i = abs_curv from the begining of the instrument
we compute the x value of each node :the topology (stored in Edge_list) is supposed to be a regular seq of segment
|
pure virtual |
Returns the BeamSection.
Implemented in BeamInterpolation< DataTypes >, BeamInterpolation< TIn >, and WireBeamInterpolation< DataTypes >.
|
pure virtual |
Collision information using.
Implemented in BeamInterpolation< DataTypes >, BeamInterpolation< TIn >, and WireBeamInterpolation< DataTypes >.
|
pure virtual |
Implemented in BeamInterpolation< DataTypes >, BeamInterpolation< TIn >, and WireBeamInterpolation< DataTypes >.
|
pure virtual |
Returns the BeamSection data depending on the beam position at the given beam, similar to @getBeamSection.
Implemented in BeamInterpolation< DataTypes >, BeamInterpolation< TIn >, and WireBeamInterpolation< DataTypes >.
|
pure virtual |
Returns the Young modulus, Poisson's ratio and massDensity coefficient of the section at the given curvilinear abscissa.
Implemented in BeamInterpolation< DataTypes >, BeamInterpolation< TIn >, and WireBeamInterpolation< DataTypes >.
| int getNodeIndices | ( | const EdgeID | edgeInList, |
| unsigned int & | node0Idx, | ||
| unsigned int & | node1Idx ) |
|
pure virtual |
getLength / setLength => provides the rest length of each spline using
Implemented in BeamInterpolation< DataTypes >, BeamInterpolation< TIn >, and WireBeamInterpolation< DataTypes >.
|
pure virtual |
Implemented in WireBeamInterpolation< DataTypes >.
| void interpolatePointUsingSpline | ( | const EdgeID | edgeInList, |
| const Real | baryCoord, | ||
| const Vec3 & | localPos, | ||
| const VecCoord & | x, | ||
| Vec3 & | posResult, | ||
| bool | recompute, | ||
| const sofa::core::ConstVecCoordId & | vecXId ) |
<<" interpolatePointUsingSpline : "<< edgeInList<<" xbary="<<baryCoord<<" localPos"<<localPos<<std::endl;
no need to recompute the positions of the Spline => we will read their value in the vector which id is vecXId
| void InterpolateTransformAndVelUsingSpline | ( | const EdgeID | edgeInList, |
| const Real | baryCoord, | ||
| const Vec3 & | localPos, | ||
| const VecCoord & | x, | ||
| const VecDeriv & | v, | ||
| Transform & | global_H_localInterpol, | ||
| Deriv & | v_interpol ) |
------------— compute velocity interpolation -----------------—//
| void InterpolateTransformUsingSpline | ( | Transform & | global_H_localResult, |
| const Real | baryCoord, | ||
| const Transform & | global_H_local0, | ||
| const Transform & | global_H_local1, | ||
| const Real | L ) |
InterpolateTransformUsingSpline This function provide an interpolation of a frame that is placed between node0 and node1 the location of the frame is given by baryCoord
find the spline points
The beam is very compressed => it leads to a non correct interpolation using spline (the spline formulation is based on the rest length of the beam) For a correct result, we use linear interpolation instead... (for the quaternion, we use a "simple" slerp
The position of the frame is computed using the interpolation of the spline
the tangent is computed by derivating the spline
try to interpolate the "orientation" (especially the torsion) the best possible way... (but other ways should exit...)
| void MapForceOnNodeUsingSpline | ( | const EdgeID | edgeInList, |
| const Real | baryCoord, | ||
| const Vec3 & | localPos, | ||
| const VecCoord & | x, | ||
| const SpatialVector & | f6DofInput, | ||
| SpatialVector & | FNode0output, | ||
| SpatialVector & | FNode1output ) |
6DoF mapping
BeamInterpolation<DataTypes>::MapForceOnNodeUsingSpline 6DoF (reverse) mapping of a force (f6DofInput) that is positionned / to the centerline of a beam
rotate back to local frame
computes the torque created on DOF0 and DOF1 by f1 and f2
back to the DOF0 and DOF1 frame:
| void MapForceOnNodeUsingSpline | ( | const EdgeID | edgeInList, |
| const Real | baryCoord, | ||
| const Vec3 & | localPos, | ||
| const VecCoord & | x, | ||
| const Vec3 & | finput, | ||
| SpatialVector & | FNode0output, | ||
| SpatialVector & | FNode1output ) |
3DOF mapping
BeamInterpolation<DataTypes>::MapForceOnNodeUsingSpline 3DoF (reverse) mapping of a force (finput) that is positionned / to the centerline of a beam
rotate back to local frame
computes the torque created on DOF0 and DOF1 by f1 and f2
back to the DOF0 and DOF1 frame:
|
static |
Method to rotate a Frame define by a Quat.
| input | around an axis |
| x,x | has to be normalized. Output is return inside |
| output |
|
static |
Method to rotate a Frame define by a Quat.
| input | around an axis |
| x,x | will be normalized in method. Output is return inside |
| output |
| void updateBezierPoints | ( | const VecCoord & | x, |
| sofa::core::VecCoordId & | vId_Out ) |
vId_Out provides the id of the multiVecId which stores the position of the Bezier Points
Mechanical Object to stock Bezier points.
| Data< sofa::type::vector<EdgeID> > d_beamCollision |
| Data< type::vector< Transform > > d_DOF0TransformNode0 |
| Data< type::vector< Transform > > d_DOF1TransformNode1 |
| Data< type::vector< SReal > > d_lengthList |