A python package for geometric calculations in the three-dimensional Euclidean space
Mustapha Moulana
HYGEOS website
Documentation
Features
- Basic geometric objects: vectors, points, normals, rays and bounding boxes
- Geometric transformations: translations, scales and rotations
- Ray intersection tests with shapes: spheres, spheroids, disks, triangles and triangle meshes
- Vectorized calculations with numpy: sets of objects and/or sets of rays can be processed at once
- Intersection results returned as xarray datasets, gathering the intersection information and the shape attributes
- Visualization of the quadrics and triangle meshes, and reading/writing of triangle meshes (netcdf4, and formats supported by trimesh as stl, ply, ...)
Installation
The installation can be performed using one of the following commands:
$ conda install -c conda-forge geoclide
$ pip install geoclide
$ pip install git+https://github.com/hygeos/geoclide.git
Quickstart
Perform an intersection test between a ray and a sphere, and get the intersection information as an xarray dataset:
>>> import geoclide as gc
>>> sphere = gc.Sphere(radius=1.)
>>> ray = gc.Ray(o=gc.Point(-2., 0., 0.8), d=gc.Vector(1., 0., 0.))
>>> ds = gc.calc_intersection(sphere, ray)
>>> ds['thit'].values, ds['phit'].values
(array(1.4), array([-0.6, 0. , 0.8]))
Create a triangle mesh, place it in the scene with a transformation, then intersect it with the same ray:
>>> import numpy as np
>>> vertices = np.array([[-5., -5., 0.], [5., -5., 0.],
... [-5., 5., 0.], [5., 5., 0.]])
>>> faces = np.array([[0, 1, 2], [2, 3, 1]])
>>> translate = gc.get_translate_tf(gc.Vector(2.5, 0., 0.))
>>> rotate = gc.get_rotate_y_tf(-90.)
>>> mesh = gc.TriangleMesh(vertices, faces, otw=translate*rotate)
>>> ds = gc.calc_intersection(mesh, ray)
>>> ds['is_intersection'].values, ds['thit'].values
(array(True), array(4.5))
>>> ds['phit'].values
array([2.5, 0. , 0.8])
Documentation
The complete documentation is available at
hygeos.github.io/geoclide. It
includes example notebooks (basics, remote sensing applications, quadrics
visualization and numpy acceleration) and the full API reference. The
docstrings are also available from the built-in help function, e.g.
help(gc.calc_intersection).
License
Geoclide is licensed under the Apache License 2.0, see LICENSE.txt.
Metadata
Release files for geoclide 4.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| geoclide-4.0.0.tar.gz | 1.3 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| geoclide-4.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.6 MB
Release files / geoclide-4.0.0.tar.gz
| Download URL | geoclide-4.0.0.tar.gz |
|---|---|
| Size | 1.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5454fc8149e271d44eb57dd93e1342e88185021c15e5b8d6cd334e97df4bbb07
|
|
BLAKE2b-256 checksum How to use checksums |
131ac8b4a7b83eefd38096646122795efd4c246c641f881cfba25c8774f37896
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.
Transparency logRelease files / geoclide-4.0.0-py3-none-any.whl
| Download URL | geoclide-4.0.0-py3-none-any.whl |
|---|---|
| Size | 1.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fb310728c173d282a55226e0919302ea5b46311ea7ced06208507f824913ac39
|
|
BLAKE2b-256 checksum How to use checksums |
bcb0bdc53c61fb81d20236f04b623cda306f375c6eedbffcb5ca2f2cf25d8fd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.
Transparency log