Skip to content

asteppke/minigeo

Repository files navigation

Project generated with PyScaffold pytest

minigeo

A minimalistic 3D geometry library designed for visualizing 3D shapes and transformations using Python. The focus lies on simple interactive usage and compatibility with different visualization libraries or backends. It provides a set of base classes for 3D geometry objects, such as points, lines, shapes, and axes, and is independent of any specific visualization library.

Features

  • 3D Geometry Classes: Base classes for various geometric shapes.
  • Transformations: Support for affine transformations in 3D space.
  • Grouping: Ability to group multiple geometries and manipulate them collectively.
  • Matplotlib Integration: Classes for rendering geometries using Matplotlib.

Examples

import minigeo.geometry as geo

# Create a box at the origin with dimensions 1x2x3
box = geo.BaseBox([0, 0, 0], dimensions=[1, 2, 3])

# Define a translation along the x-axis by 1
move_x = geo.Transform().translate([1, 0, 0])

# and apply it to the box
move_x @ box

print(box)

BaseBox at [1. 0. 0.] with vertices [[ 0.5 -1.  -1.5]
 [ 1.5 -1.  -1.5]
 [ 1.5  1.  -1.5]
 [ 0.5  1.  -1.5]
 [ 0.5 -1.   1.5]
 [ 1.5 -1.   1.5]
 [ 1.5  1.   1.5]
 [ 0.5  1.   1.5]]

Installation

To install the minigeo library, clone the repository and run the following command in the project directory:

pip install .

How does it look?

The obligatory screenshot:

Example Image

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.

About

A minimal 3D geometry library for Python

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages