Creating grids with explicit points

Hi,
I am trying to create seismic bin grid objects with Grid2DRepresentation.
These bin grids are originally rotated, but I only have an array of projected X,Y coordinates, representing the location of each point, without no information about the rotation value.

It seems like Grid2DRepresentation can only be defined by origin, and parameters like spacing, and count. This means that my resultant bin grid will not be rotated in actual space if compared with original data. Is there a way that we can create Grid2D by feeding a list of X, Y coordinates? Or should I be using a different RESQML class to achieve this?

Hi !
Welcome to this forum!

A bin grid is generally “never” represented as an array of projected X,Y coordinates. A bin grid is defined by an origin, two axis, node count and spacing along thoses two axis. It is a much much more lightweight dataobject and it guarantees regularity. This is exactly what we want talking about bin grid vs talking about a point set.
Having said that, you may compute this information from your particular point set.

Here is a drawing corresponding a bit to this bin grid FESAPI method.

In black you have your CRS
In red, you indeed define origin, spacing and count as you clearly saw. However, in this method you also have the definition of the two axis thanks to the 6 “offsets” parameters which indicates where the count and spacing along axis lie on.
Having all this information allow a RESQML reader to compute the red and green full bin grid where Z values of an horizon will be put.

If your CRS would already be rotated as your bin grid, then, your two axis offset definition would be something like (1,0,0) and (0,1,0.
In the figure above, your two axis offset would much more be something like (0.5, 0.25, 0) and (-0,25, 1, 0).
These two axis offset allow you to achieve something like a rotation of a grid. You could compute axis offsets from rotation and vice versa if you would need to.

Precisely answering, no FESAPI does not provide such a functionality. This has to be done on application side, not on library side. My message above explains what the library expects and consequently what needs to be computed from a list of X, Y coordinates. (origin, axis, count and spacing)

Thanks Philippe, its clear to me now.