I'm currently working on a traffic simulation that should run above a CityEngine scene. Therefore I need to rebuild the graph network in my application.
Until now, I've exported the graph network as SPH files. However, I can't recreate the road network correctly since the SPH file lacks intersection parameters and spline information (tangents at the vertices).
Is there a way of enriching the SPH export to include intersection and spline information or is there an entirely different exporter that is able to export more than just the connectivity information of the graph?
Thanks for your help!
SHP generally does not support curved segments.
However all values needed can be accessed from Python, exported as attributes and reconstructed later on.
To define curves, CityEngine uses Cubic Bézier curves.
The position of the Points P1 and P2 can be accessed via Python and added as Object Attributes to the segment (Python Scripting - CE.setAttribute).
# direction = P_1 / startNode = P_0 directionStart = ce.getCurveHandle( segmentAB, nodeStart ) # direction = P_2 / startNode = P_3 directionEnd = ce.getCurveHandle( segmentAB, nodeEnd )
The intersection type can also be queried with Python: