Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix NurbsBase.PerpendicularFrames #412

Merged
merged 4 commits into from
May 17, 2023

Conversation

devel0
Copy link
Contributor

@devel0 devel0 commented Apr 13, 2023

What type of PR is this? (check all applicable)

  • 🐛 Bug Fix

Description

This PR fixes PerpendicularFrames ensuring resulting xaxis, yaxis, zaxis normalized.

Related Tickets & Documents

I added repro example to see the behavior in follows:

git clone -b dev/devel0/fix-perp-frames-sample https://github.com/SearchAThing-forks/G-Shark.git
cd G-Shark/examples/example-0022
  1. without fix perp frames
git checkout bf6dd663285200e0646dc8db87c349d5a371dceb
dotnet run

image

  1. with fix perp frames
git checkout 49f86051c8f844647815d4aa576f1104db6401ae
dotnet run

image

  1. with few rails points
git checkout 9df7fcb34dcffe7d79ce410a2849c3d879cfda2f
dotnet run

image

(press 'space' to toggle joint visibility)

image

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?

  • 👍 yes

It_Calculates_Rotation_Minimized_Frames_Along_Curve2

Added to documentation?

  • [X ] 🙅 no documentation needed

@devel0
Copy link
Contributor Author

devel0 commented Apr 14, 2023

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

image

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.

@d3ssy
Copy link
Collaborator

d3ssy commented May 4, 2023

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

@devel0
Copy link
Contributor Author

devel0 commented May 4, 2023

@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.

@d3ssy
Copy link
Collaborator

d3ssy commented May 4, 2023

I think that's a great idea @devel0 ! Please do!

@devel0
Copy link
Contributor Author

devel0 commented May 4, 2023

Did it,
I also upgraded c# language version to 11 in order to allow latest features ( such as nullable reference types ).

@d3ssy d3ssy merged commit d526a36 into GSharker:master May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants