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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geoclide-4.0.0.tar.gz.
File metadata
- Download URL: geoclide-4.0.0.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5454fc8149e271d44eb57dd93e1342e88185021c15e5b8d6cd334e97df4bbb07
|
|
| MD5 |
2fc6bdf2121af7cf3bd38715ba5ad5f2
|
|
| BLAKE2b-256 |
131ac8b4a7b83eefd38096646122795efd4c246c641f881cfba25c8774f37896
|
Provenance
The following attestation bundles were made for geoclide-4.0.0.tar.gz:
Publisher:
push_pypi.yml on hygeos/geoclide
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
geoclide-4.0.0.tar.gz -
Subject digest:
5454fc8149e271d44eb57dd93e1342e88185021c15e5b8d6cd334e97df4bbb07 - Sigstore transparency entry: 2348911907
- Sigstore integration time:
-
Permalink:
hygeos/geoclide@3548b3a305e98b1db7d23693cc9c720d3cb62379 -
Branch / Tag:
refs/tags/v4.0.0 - Owner: https://github.com/hygeos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
push_pypi.yml@3548b3a305e98b1db7d23693cc9c720d3cb62379 -
Trigger Event:
push
-
Statement type:
File details
Details for the file geoclide-4.0.0-py3-none-any.whl.
File metadata
- Download URL: geoclide-4.0.0-py3-none-any.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb310728c173d282a55226e0919302ea5b46311ea7ced06208507f824913ac39
|
|
| MD5 |
fd878135e4e48321512905f6adcc07fa
|
|
| BLAKE2b-256 |
bcb0bdc53c61fb81d20236f04b623cda306f375c6eedbffcb5ca2f2cf25d8fd8
|
Provenance
The following attestation bundles were made for geoclide-4.0.0-py3-none-any.whl:
Publisher:
push_pypi.yml on hygeos/geoclide
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
geoclide-4.0.0-py3-none-any.whl -
Subject digest:
fb310728c173d282a55226e0919302ea5b46311ea7ced06208507f824913ac39 - Sigstore transparency entry: 2348912002
- Sigstore integration time:
-
Permalink:
hygeos/geoclide@3548b3a305e98b1db7d23693cc9c720d3cb62379 -
Branch / Tag:
refs/tags/v4.0.0 - Owner: https://github.com/hygeos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
push_pypi.yml@3548b3a305e98b1db7d23693cc9c720d3cb62379 -
Trigger Event:
push
-
Statement type: