Skip to main content

A small library for visible 3D shapes

Project description

Shape4D

About Shape4D

Shape4D is a tiny library for point, line and polygon in 3D space, as well as their simple relations.

Core Features

  • Shape classes: Point, Line and Polygon.

  • Creating a 3D polygon by defining a 2D shape in working plane at first and then moving it to its desired position.

  • It provides functions to judge whether a point is contained in a shape, either line or polygon, by overloading the magic function __contains__.

  • __hash__ and __eq__, overloaded for point, line and polygon.

  • __neg__ overloaded for polygon when one wants to know the vertices on its other side.

Requirements

  • Python 3

  • Matplotlib is installed.

Documentation

To be continued.

Installation

pip install Shape4D

Usage

import Shape4D.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

changelog.md

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

heliqun@ustc.edu.cn

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Shape4D-0.2.5.tar.gz (4.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Shape4D-0.2.5-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file Shape4D-0.2.5.tar.gz.

File metadata

  • Download URL: Shape4D-0.2.5.tar.gz
  • Upload date:
  • Size: 4.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.0

File hashes

Hashes for Shape4D-0.2.5.tar.gz
Algorithm Hash digest
SHA256 ee99bb9fe39844e7acc2926d1037930786ffd4facca485b1853db8ec517efa29
MD5 39d2f49fdb79189cd878d69c2fba06b7
BLAKE2b-256 f5620e5424a2e6ec79f3cb52cd91000f540d595acde24866672ac756090044e3

See more details on using hashes here.

File details

Details for the file Shape4D-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: Shape4D-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.0

File hashes

Hashes for Shape4D-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 76ce4ea8be7dd364f17247ebe2435dd2b8a3c7ca779056dd8e6ec9cee2333e3e
MD5 988e3fe32a1ce04df81a41d3caa0ace5
BLAKE2b-256 f896b7d593b80eaadd9ea6775a24afa745bf56f4197000da0e7221a270a9bed9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page