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:
If an additional vertex is added (the green one) the result looks much better:
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.
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.
The
TubeGenerator
class currently usesCurveUtils.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)](https://user-images.githubusercontent.com/50929705/159470604-7f64c262-0fe1-4a09-b925-e04b5acb5773.png)
If an additional vertex is added (the green one) the result looks much better:![MicrosoftTeams-image](https://user-images.githubusercontent.com/50929705/159470615-d328f1c3-1658-4f76-890e-f132ec8d994e.png)
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:
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.