offset in rdGeometry.UniformGrid3D returns vertex and not center
When creating a grid with UniformGrid3D and specifying an offset, the coordinates of the offset are used as a vertex and not as a center. Although UniformGrid3D does not specify that the offset is the center, the _.GetOffset() function should return the center of the grid and it does not
To Reproduce from rdkit import Chem from rdkit.Geometry import rdGeometry as geom offset = geom.Point3D(20,20,20) grid2=geom.UniformGrid3D(20,20,20,spacing=5.0,offSet=offset) for i in range(grid2.GetSize()): pt = grid2.GetGridPointLoc(i) print(pt.x) grid2.GetOffset()
If the offset would be used to set up the center, the code above should return x points in 15,20,25 and 30 but it returns 20,25,30,35 GetOffSet also returns the 20,20,20 which correlate to the vertex of the created cube.
Configuration (please complete the following information):
- RDKit version: 2024.03.5
- OS: Windows 10
- Python version (if relevant): 3.12
- Are you using conda? Yes
- If you are using conda, which channel did you install the rdkit from? conda-forge
This issue was marked as stale because it has been open for 90 days with no activity.