Skip to content

Tckgen iFOD1 fix max angle at seed master#3335

Draft
Lestropie wants to merge 2 commits into
masterfrom
tckgen_iFOD1_fix_max_angle_at_seed_master
Draft

Tckgen iFOD1 fix max angle at seed master#3335
Lestropie wants to merge 2 commits into
masterfrom
tckgen_iFOD1_fix_max_angle_at_seed_master

Conversation

@Lestropie
Copy link
Copy Markdown
Member

Supersedes #2325 by targeting master.

I'm initially creating this as a draft PR.

My instinct is that this requires a little bit more tweaking.

  • Desired behaviour for both first-order and intrinsically second-order methods RE tangent at track reversal:

    • For iFOD1 it's not the content of method.dir after the completion of init() that needs to be loaded in as the content of method.dir after reversal, but the direction of the first step.
    • For iFOD2 what is wanted is specifically the tangent at the start of the first arc.
  • It seems that the behaviour of iFOD1 vs. iFOD2 with a user-specified seed direction is quite different.

    • With iFOD1, it's sampling within the cone of permissible angles in order to determine the seed direction, and then the first time next() is called it's doing the same thing again. So the actual tangent of the first step could be outside of the permissible angle from the user-specified initial direction.
      Perhaps the correct behaviour is to check whether it's feasible to find a direction at the seed point relative to the user-specified seed direction, and if a suitable direction can be found, then the seed point is accepted, but method.dir remains equivalent to the user-specified seed direction. That way, on the first call to next(), the direction of the first step remains within the permissible angle relative to the user-specified seed direction.
    • With iFOD2, I think the current behaviour is correct: it finds a direction at the seed point (not a path) that is supra-threshold, and that will be the tangent direction at the start of the first arc.

jdtournier added 2 commits May 2, 2026 10:54
Mostly indentation changes, but also minor cleanup in handling of init() method.
With iFOD1, the second half of a bidirectional streamline starts in the opposite direction from the first half. The seed direction is determined first, and then used as the initial direction of tracking for both halves. But the actual direction of the first step is taken as a random sample within the angular constraint about that seed direction, and because this happens both ways, and with the same seed direction, it is possible for the angle between the two line segments either side of the seed point to be up to twice the max angle.
The solution here involves setting the initial direction of tracking for the second half of the streamline to the (opposite of the) *actual* direction of the first step of the first half, rather than the seed direction initially determined. This ensures that the first step of the second half of the streamline is taken within the max angle constraint of what is effectively the incoming direction of tracking.
To achieve this, the reverse_track() method was extended to perform the actual track reversal and set the position and initial direction of tracking, and overridden in the iFOD1 method to set things appropriately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants