test used code from Anders branch to check why i get 0 on y on first position of each line

This commit is contained in:
ElonOlsson
2025-01-22 16:13:35 -05:00
parent be1e544952
commit 204e77fdbc
3 changed files with 21 additions and 8 deletions

View File

@@ -141,7 +141,7 @@ void FindLastClosedFieldlinesTask::perform(
LINFO(std::format("First Pos: {}", firstPos));
LINFO(std::format("Last Pos: {}", lastPos));
}

View File

@@ -45,7 +45,7 @@ namespace openspace {
std::string _tracingVar = "b";
std::filesystem::path _inputPath;
std::vector<std::string> _sourceFiles;
int _numberOfPointsOnBoundary = 3;
int _numberOfPointsOnBoundary = 10;
float _threshold = 0.5; //RE
std::filesystem::path _outputFolder;
bool _saveLastIterationOfFieldLines = true;

View File

@@ -337,17 +337,30 @@ bool addLinesToState(ccmc::Kameleon* kameleon, const std::vector<glm::vec3>& see
seed.y,
seed.z
);
const std::vector<ccmc::Point3f>& positions = ccmcFieldline.getPositions();
ccmcFieldline.getDs();
ccmcFieldline.measure();
ccmc::Fieldline mappedFieldline =
ccmcFieldline.interpolate(1, ccmcFieldline.getPositions().size());
const std::vector<ccmc::Point3f>& fieldlinePositions =
mappedFieldline.getPositions();
const size_t nLinePoints = positions.size();
std::vector<glm::vec3> vertices;
vertices.reserve(nLinePoints);
for (const ccmc::Point3f& p : positions) {
vertices.emplace_back(p.component1, p.component2, p.component3);
for (const ccmc::Point3f& pt : fieldlinePositions) {
vertices.emplace_back(pt.component1, pt.component2, pt.component3);
}
//const std::vector<ccmc::Point3f>& positions = ccmcFieldline.getPositions();
//const size_t nLinePoints = positions.size();
//vertices.reserve(nLinePoints);
//for (const ccmc::Point3f& p : positions) {
// vertices.emplace_back(p.component1, p.component2, p.component3);
//}
state.addLine(vertices);
success |= (nLinePoints > 0);
success |= (vertices.size() > 0);
}
return success;