#2608 Prepare to find a correct seeding of the SolveSpace S-curve solver

Extracted the inital values to a separate section.
Use an explicit fallback calculation (based on control points) if the solvespace one fails
This commit is contained in:
Jacob Støren
2018-08-07 13:15:41 +02:00
parent 1d7320cc0c
commit 1fff2dfa97
3 changed files with 137 additions and 61 deletions

View File

@@ -26,6 +26,7 @@
#include "RimWellPathTarget.h"
#include "RimModeledWellPath.h"
#include "RiaSCurveCalculator.h"
#include "RiaLogging.h"
namespace caf
{
@@ -255,8 +256,19 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
target2->inclination(),
50);//30.0/cvf::Math::toRadians(12.0));
if (!sCurveCalc.isOk()) std::cout << "SCurve Calculation failed" << std::endl;
if (!sCurveCalc.isOk())
{
RiaLogging::warning("SCurve Calculation failed between target " + QString::number(tIdx+1) + " and " + QString::number(tIdx+2));
sCurveCalc = RiaSCurveCalculator::fromTangentsAndLength(target1->targetPointXYZ(),
target1->azimuth(),
target1->inclination(),
50,
target2->targetPointXYZ(),
target2->azimuth(),
target2->inclination(),
50);
}
endPoints.push_back( sCurveCalc.firstArcEndpoint() + m_referencePoint() );
endPoints.push_back( sCurveCalc.secondArcStartpoint() + m_referencePoint() );
}