tigl
tigl copied to clipboard
Exceptions thrown for tiglFuselageGetPointAngle() at outmost fuselage sections
Since I need a (workaround) function to calculate the maximum width of a given fuselage, I iterate tiglFuselageGetPointAngle
for a predefined number of alpha
values between 0 and 360 (to calculate local width). I do this for every section to find the maximum width of the fuselage.
However, the function throws the following exceptions for the foremost and rearmost section which in my case (tiglFuselageGetSegmentCount
= 60) is
tiglFuselageGetPointAngle(tiglHandle,1,1,0,0)
--> TIGL_ERROR, 1
tiglFuselageGetPointAngle(tiglHandle,1,60,1,0)
--> TIGL_INDEX_ERROR, 7
All other combinations, especially locations near to the singularities, e.g.
tiglFuselageGetPointAngle(tiglHandle,1,1,0.01,0)
tiglFuselageGetPointAngle(tiglHandle,1,60,0.99,0)
seem to yield reasonable results.
For the foremost section, I assume that this occurs, because the foremost section equals the point [0,0,0], thus the exception is thrown at following line: tiglFuselageGetPointAngle
. I don't see any argument, why an error should be thrown at a return value of [0,0,0].
I still couldn't find the cause for the exception at the rearmost section, though.
Moreover, I accidentially found that eta
is not limited to input values between 0 and 1, i.e. the function does not through an exception. Is this also intended?
I am using TIGL2.2.1 and the MATLAB API, but I think the mentioned issues haven't been resolved for versions > 2.2.1.
EDIT: Following observation supports my assumption: Both, the first and last section of my fuselage has the scaling [1.0,1.0,1.0] and the related element has the scaling [1.0, 0.0, 0.0]. If I change the scaling of the elements of the first and last section from [1.0, 0.0, 0.0] to [1.0, 0.01, 0.01], the code works correctly.