89 const auto controlPoint=[&](
const bool before)->
VectorDim
92 bool backwards=before;
94 std::set<std::pair<const LoopNodeType*,bool>> visited;
95 while(visited.emplace(node,backwards).second)
97 const auto* adjacent=backwards ? node->prev.second : node->next.second;
98 if(
const auto*
twin=adjacent->twin())
101 const auto*
neighbor=backwards ?
twin->source->periodicPrev() :
twin->sink->periodicNext();
104 return offset+
neighbor->get_P()-node->periodicPlanePatch()->shift+
neighbor->periodicPlanePatch()->shift;
108 if(
const auto*
twin=adjacent->twinnedLink())
114 const bool atSource=
twin->source->networkNode==node->networkNode;
115 const auto* other=atSource ?
twin->source.get() :
twin->sink.get();
116 offset+=node->get_P()-other->get_P();
121 const auto*
neighbor=backwards ? node->periodicPrev() : node->periodicNext();
130 const auto*
neighbor=before ? this->
source->periodicPrev() : this->
sink->periodicNext();
133 throw std::runtime_error(
"Cannot determine spline control point.");
Scalar readScalar(const std::string &key, const bool &verbose=false)