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

TubeGenerator and arbitrary segment lengths #176

Open
X-Celcius opened this issue Mar 22, 2022 · 0 comments
Open

TubeGenerator and arbitrary segment lengths #176

X-Celcius opened this issue Mar 22, 2022 · 0 comments

Comments

@X-Celcius
Copy link

The TubeGenerator class currently uses CurveUtils.GetTangent to calculate the frame / plane when generating the ring vertex orientation along the path vertices.
This works fine for paths that follow a uniform pattern and have almost equal segment lengths such as a ring. It leads to ugly results if one segment is followed by a much longer segment, however.

The following image shows a tube generated from 4 vertices. The fourth one is way of the screen and leeds to a tangent that has almost the same angle as the bottom tube segment:
MicrosoftTeams-image (1)

If an additional vertex is added (the green one) the result looks much better:
MicrosoftTeams-image

In case this is intended behavior that's fine, as it is fairly easy to add artificial segments to style the tube the way you want to. However in case this is unintended it would be nice to turn this behavior on or off and modify the code so that it calculates the tangent based on the actual angle of the turn without taking the length relation into account.

Example vertex coordinates:

( 20, 30, 0)
(  5, 30, 0)
(  5, 15, 0)
( 20, 15, 0) <- artificially added redundant vertex
(380, 15, 0) <- artificially added redundant vertex
(395, 15, 0)
(395, 30, 0)
(380, 30, 0)

A related second issue: You may notice in the screenshots that the diameter of the tube changes during these turns. I have yet to find out what in the code exactly causes this.

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

No branches or pull requests

1 participant