Where should I start, to understand how QGC calculates a grid flight pattern over a polygonal area?

Hello everyone,

I’d like to understand the way that QGC calculates and gets the waypoints based on the altitude and camera model in survey pattern mode but I don’t know where to start. Thanks everyone.

This https://github.com/mavlink/qgroundcontrol/blob/master/src/MissionManager/TransectStyleComplexItem.cc#L350 is a decent spot to start.