Since the C-API reads the channel offset XYZ beginning with version 2.0.1, there should be an API function that lets the caller change the offsets relatively.
This means, the CRG does NOT move and is NOT shifted but the offsets are changed and the difference is added to xbeg plus data and xend, ybeg plus data and yend and zbeg and zend.
Why is this helpful:
If you want to simulate using multiple CRGs or combine them with OpenDRIVE they might not share the same offset.
After referencing all CRGs to the same offset they all share the same "local" coordinate system and evaluation becomes trivial. Reminder, evaluate xy2z, uv2xy, ... all need and return "local" coordinates.
Very simple example using channel X:
- CRG 1 xoff = 100, xbeg = 0, xend = 100
- CRG 2 xoff = 200, xbeg = 0, xend = 100
These 100 units long CRGs connect at "global" X coordinate 200 where CRG 2 begins after CRG 1 ends.
A user evaluates using CRG 1's local system and evaluates from x 0 to 100.
At x = 100.001 evaluation continues on CRG 2 because CRG 1 ended. So the user does that but whoops, now you evaluate behind the end of CRG 2 instead of at the start.
The user would need to factor in, that CRG 2 has a different offset.
With a function letting the user set the same offset for all CRGs, this is solved.
Alternatively, if the user does not want the channel data to be manipulated, there should be an additional function that lets the user transform xyz values from one CRG to another.
Summary: Make it easier for users to evaluate with multiple CRG files.
-> Create two functions: Change offset relatively, transform coordinates to another CRG
Since the C-API reads the channel offset XYZ beginning with version 2.0.1, there should be an API function that lets the caller change the offsets relatively.
This means, the CRG does NOT move and is NOT shifted but the offsets are changed and the difference is added to xbeg plus data and xend, ybeg plus data and yend and zbeg and zend.
Why is this helpful:
If you want to simulate using multiple CRGs or combine them with OpenDRIVE they might not share the same offset.
After referencing all CRGs to the same offset they all share the same "local" coordinate system and evaluation becomes trivial. Reminder, evaluate xy2z, uv2xy, ... all need and return "local" coordinates.
Very simple example using channel X:
These 100 units long CRGs connect at "global" X coordinate 200 where CRG 2 begins after CRG 1 ends.
A user evaluates using CRG 1's local system and evaluates from x 0 to 100.
At x = 100.001 evaluation continues on CRG 2 because CRG 1 ended. So the user does that but whoops, now you evaluate behind the end of CRG 2 instead of at the start.
The user would need to factor in, that CRG 2 has a different offset.
With a function letting the user set the same offset for all CRGs, this is solved.
Alternatively, if the user does not want the channel data to be manipulated, there should be an additional function that lets the user transform xyz values from one CRG to another.
Summary: Make it easier for users to evaluate with multiple CRG files.
-> Create two functions: Change offset relatively, transform coordinates to another CRG