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

Uploaded Python 3

File details

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

File metadata

  • Download URL: Shape4D-0.2.7.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.7.tar.gz
Algorithm Hash digest
SHA256 504de72d39349ee34dab2b776f6bd4b0fa07046e29e5c32e67af8d7c7aac0482
MD5 7985544640c7627016bcaced913f79fb
BLAKE2b-256 fcc00ecc726c56c18c8c801a0abdf7c7e131f7d6f5fdfcf5b59ed4cb3898caba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Shape4D-0.2.7-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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 99007bfd7a6f34f3205ea71b29e0ff7b31cf0d200d07622e0e428b54cdf78bd5
MD5 86fb4540c74fcd0fa93b4e11a65c554a
BLAKE2b-256 6b046d019597d119b7dd95e6069558270c4792b6354aed965ed457b7c191d38b

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