A small package of 3D geometry plottable in matplotlib.
Project description
VisualShape3D
About VisualShape3D
VisualShape3D intends to plot 3D points, lines and polygons more easily in matplotlib. That is, one needs not create a plotting figure by plt.figure and plt.subplot() as usual.
Note that there is a research version of VisualShape3D in PyPi, so-called Shape4D. Now it's not actively developed for the people have left for career.
Core Features
- Three shapes : Point, Segment and Polygon.
- Its logic for 3D definition : creating a 2D shape first in working plane and then moving its referene point to a desired 3D position and rotating its normal vector of facet to a designated orientation.
- It can check whether or not a point is inside a segment or polygon, by their magic functions
__contains__
as overloaded for Segment and Polygon. __hash__
and__eq__
, also overloaded for Point, Segment and Polygon.__neg__
overloaded for polygon when one wants to know the list of vertices on its other side.
Requirements
- Python 3
- Matplotlib is installed.
Documentation
To be continued.
Installation
pip install VisualShape3D
Usage
import VisualShape3D.VisualShapes as vs
W,H = 2.0,1.5
shape = vs.Shape('rectangle',W,H)
shape = shape.move(to = (2,0,0), by = (45,30))
line = vs.Polyline((0,0,0),(3,1.,2))
P = shape.intercept(line)
line.broken_by(P)
shape.plot(hideAxes=True,style = {'facecolor':'cornflowerblue', 'edgecolor':'navy'})
shape.add_plot(line,style={'color':'k','linewidth':2,'node':'visible'})
shape.show(azim=-20, elev=3)
Change Log
License
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
VisualShape3D-0.1.3.tar.gz
(4.7 MB
view hashes)
Built Distribution
Close
Hashes for VisualShape3D-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a988918f2d55c797407a3486efb00518da8c21cd78a0e89d30503046e9041f29 |
|
MD5 | 8ed914241eb6f3e84fe4cab8400a58e6 |
|
BLAKE2b-256 | 72aa8c4207ffa1e0f68719d70e72f42e9b6fcbb850de7f33635e6ca721dbf051 |