Hi,
I think in API you use buildOrthomosaic() projection parameter to define ortho projection with rotation as identity and translation as - region.center as:
T = chunk.transform.matrix
orthoproj = Metashape.OrthoProjection()
orthoproj.crs = chunk.crs
orthoproj.type = Metashape.OrthoProjection.Type.Cylindrical
R = Metashape.Matrix.Diag([1,1,1])
t = T.mulp(chunk.region.center)
orthoproj.matrix = Metashape.Matrix.Translation(-t)*Metashape.Matrix.Rotation(R)
chunk.buildOrthomosaic(surface_data=Metashape.ModelData, projection = orthoproj)
It does create the cylindrical ortho along z axis however it does not use the correct width. It is compressed compared to width of GUI (1741 vs 7771) cylindrical ortho.
See attachment, maybe a bug?
PS. actually not a bug, my error here. You must define the radius of cylinder. In case of cylinder along Z axis then
Radius (r) is defined as one half of the shortest edge of the Bounding box
so modify above code as follows:
T = chunk.transform.matrix
s = T.scale()
orthoproj = Metashape.OrthoProjection()
orthoproj.crs = chunk.crs
orthoproj.radius = min(list(s*chunk.region.size)/2
orthoproj.type = Metashape.OrthoProjection.Type.Cylindrical
R = Metashape.Matrix.Diag([1,1,1])
t = T.mulp(chunk.region.center)
orthoproj.matrix = Metashape.Matrix.Translation(-t)*Metashape.Matrix.Rotation(R)
chunk.buildOrthomosaic(surface_data=Metashape.ModelData, projection = orthoproj)
and now you get same result with API as GUI, see 2nd attachment