pygeo3d (py-geometry-3d) is a vast mathematical module providing (real) 3-dimensional objects, i.e. Points, Lines and Planes as Python objects through classes.
Date of creation: April 22, 2021
Date of first release on PyPI: May 06, 2021
Using this module, 3-dimensional geometry can be easily executed in Python. Along with providing calulative tools, it also allows a user to visualize Points, Lines and Planes on a 3D plot, and can be used as a learning tool to enhance a student's 3D visualization capabilities. The module is enriched with help-text and examples.
To access the help-text of a class to know more about it, run:
help(pygeo3d.classname)
Point(x, y, z)
represents the position vector of a Point (x, y, z)
in 3-dimensional Cartesian coordinate space. The difference of two Points gives a Vector, while the addition of a Vector to a Point gives another Point.
Line(a, b)
represents the vector equation of a Line r = a + Kb
in 3-dimensional Cartesian coordinate space. A Line can be indexed/sliced by real numbers to get the Point(s) that lie on the line for the given values of parameter k. Membership testing on a Line allowes a user to check if a Point lies on it.
Plane(r, n)
represents the vector equation of a Plane r • n = d
in 3-dimensional Cartesian coordinate space. Membership testing on a Plane allows a user to check if a Point/Line lies on it.
All classes have various other methods, and even alternate constructors. Users are advised to look at the documentation for more efficient usage.
A variety of functions have been provided inn the module, which include functions to calculate/check:
- Euclidean distance between Points, Lines, and Planes
- Angle between Lines and Planes
- Intersections of Lines and Planes
- Images and Projections of Points and Lines in/on Lines/Planes
- If a list of Points are collinear/coplanar
- If some Lines or Planes are parallel or perpendicular
And so on. Users are advised to run the following command in Python to get to know about all the available functions:
dir(pygeo3d)
- Minor bug fixes
- Alternate constructor
Point.FromSequence(seq)
forPoint
can now accept generators/generator-expressions as argument - More colors available for plotting
Line
objects now support slicing, which returns a tuple
of Points
on the Line at the indices given in the slice
Minor bug fixes
- Minor bug fixes: Fixed more issues of floating point precision
- Removed the function
plot_random_objects()
- Better type hinting
This project is dependent upon the following of my own modules, available through PyPI:
To use, execute:
pip3 install pygeo3d
Import this file in your project, whenever needed, using:
import pygeo3d