Closed devel0 closed 1 year ago
UPDATE
git clone -b dev/devel0/fix-perp-frames-sample2 https://github.com/SearchAThing-forks/G-Shark.git
cd G-Shark/examples/example-0022
dotnet run
Changing degree of the rail curve from 1 to 2 doesn't solve, the only workaround I've found is to allow specify start/end rail tangent for a perfect join; in the above sample branch there is an example how FromSweep and PerpendicularFrames can handle these optional arguments on start and end frames.
Thanks @devel0 . Ideally this behavior is fixed for perp frames along a closed curve, such that the rotational difference between start and end frames is minimized as much as possible. See issue #373
@d3ssy I agree, the PR actually doesn't include the override with default arguments start
/ end
angles ; this is an option, so that for closed curve nothing changes ( args null ) while if someone needed them they could specify the override.
If interested I could adds to this PR also the start/end angles optional override for the perpendicular frames function. Let me know in case.
I think that's a great idea @devel0 ! Please do!
Did it, I also upgraded c# language version to 11 in order to allow latest features ( such as nullable reference types ).
What type of PR is this? (check all applicable)
Description
This PR fixes PerpendicularFrames ensuring resulting xaxis, yaxis, zaxis normalized.
Related Tickets & Documents
I added repro example to see the behavior in follows:
1) without fix perp frames
2) with fix perp frames
3) with few rails points
(press 'space' to toggle joint visibility)
notice inner Xaxis(red) of planes = Yaxis(green) x Zaxis(blue) these are all increased of a quantity that is the difference between first tangent ( not exactly normal to the start plane ) and the effective normal. If you increase the nr. of rail pts ( see (2) from 4 to 40 ) the problem reduces but its the same and cause not exact closure to target tube. For this type of problem I didn't find a solution yet but I report the observation on that.
Added tests?
It_Calculates_Rotation_Minimized_Frames_Along_Curve2
Added to documentation?