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.8.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.8-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: Shape4D-0.2.8.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.8.tar.gz
Algorithm Hash digest
SHA256 2f463054b7f3ca939da9bad5563889983047484cc1feb87c0cd90f1adc626962
MD5 a5423764e94db36a7cb871e46fec8bfb
BLAKE2b-256 031b816a8bf667791fc94fa96a63e6f79c783f8eb2dc45d1b47953f65e38a013

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Shape4D-0.2.8-py3-none-any.whl
  • Upload date:
  • Size: 22.2 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 87757f636dbcccf1098eb95a9e414ca51aaa1c34c4f95b692a3fcd29e95d6b71
MD5 b1d46c87d45020745ca65ee8064efa02
BLAKE2b-256 0f91b89ad02b4858bd7998528ed96b842b3624f444a2483aaf41f414945a0f72

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