Skip to main content
File added late

1 file was added to this release more than 14 days after its initial publication. Inspect the release files before installing.

pyny3d in GitHub

Abstract

pyny3d is a Python3 tyny 3D tool for build and generate information from simple and light geometry models based on polygons. Furthermore, it is possible to perform solar shading simulations and timeseries data projections (radiation, for example) over them. The whole library can be used interactively or coded autonomously or alongside with other codes.

It is built on top of numpy, scipy, matplotlib and shapely. It uses two well-known 2D geometry objects (matplotlib.Path.path and shapely.geometry.Polygon) to safely compute a wide range of planar operations at reasonable speed, without the need for the user to worry about the low-level workflow.

It has been designed to be a tool for scientific and engineering applications. It could hardly be useful in other areas such as computer graphics.

Hello World Code Snippet

Very simple example using some basic funtionalities:

import numpy as np
import pyny3d.geoms as pyny

# Geometry creation
## Polygons by their vertices
base = np.array([[0,0], [10,0], [10,10], [0,10]]) # Base square on the floor
pillar = np.array([[4,4,8], [6,4,8], [6,6,8], [4,6,8]]) # Top obtacle polygon (to extrude)
## Obstacle
place = pyny.Place(base)
place.add_extruded_obstacles(pillar)
space = pyny.Space(place)

# Shadows
S = space.shadows(init='auto', resolution='high')

# Viz
S.viz.exposure_plot()
https://github.com/JoseAntFer/pyny3d/raw/master/cover.png?raw=true

Miscelaneous

Disclaimer

pyny3d is developing in a educational and reseach environment by civil engineers in order to create a very easy to use and intuitive library. For these reason, I do not recommend to use it in applications where geometries could be very complex or if the performance is a determinant factor.

On the other hand, it is actually a great tool for prototype more general purpose programs, working inside them to automate operations on 3D geometries (like translations, rotations, arbitrary projections, shading…) and then return this information back.

Requirements

Installing pyny3d

Use the pip install way: $ pip install pyny3d

Roadmap and Maintenance

pyny3d is far from be the full-featured and optimized library I expect. Releasing v0.1 allows me to start receiving feedback from users and will help me to continue developing better and faster.

On the other hand, I want to advice that the inclusion of non-straight lines or non-planar surfaces are not expected. In the same way, all the computations will be guaranteed only for convex polygons and bodies.

Upcoming improvements

  • .stretch() method.

  • Compute volumes and areas.

  • Extrude polyhedra on arbitrary directions.

  • Rotate about arbitrary axes.

Bugs

  • Overlapping plots (Official matplotlib explanation)

    Visualizations generated with matplotlib frequently have overlapping problems. This is because matplotlib initially was not designed to be a great 3D graph plotter. When it is required to plot a 2D projection of a 3D multi-body representation, it has problems to figure out which objects are in front and which ones are behind. It is important to remark that this is only a visualization problem that DO NOT affects internal ‘pyny3d’ calculations, indeed, all the plot commands are no-return paths.

    I am studying to implement Mayavi to solve that problem and, at the same time, increase the quality and the possiblities of pyny3d plots. But, for now, in order to keep the intallation and usage as simple as possible for the users, I will keep matplotlib as the only visualization tool.

Metadata

Release files for pyny3d 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

File added late

1 file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Built distribution (wheel)

Table of built distributions (wheels) for pyny3d 0.2
File Interpreter ABI Platform
pyny3d-0.2.1-py3-none-any.whl Python 3 none any Details

Release files / pyny3d-0.2.1-py3-none-any.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL pyny3d-0.2.1-py3-none-any.whl
Size 29.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ddfa0b5586cabaa1098303fbbe1f8ade3a071368f0259fdc484a074900cfe127
BLAKE2b-256 checksum
How to use checksums
29feedbb2cdb3d55c40ffabd69888aba78640937a7af893b7566c0f7b49c2d2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page