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

Uploaded Python 3

File details

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

File metadata

  • Download URL: Shape4D-0.2.6.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.6.tar.gz
Algorithm Hash digest
SHA256 35629b79af1a81a440e62242732708103732bc6fb4fcd7e3ac042b67e634bae3
MD5 a3328ceed4e8922f0b167328d75feeee
BLAKE2b-256 5e45fb6df73d1253121a7867c53eee4ec595e1b61909d654927e41461278be7e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Shape4D-0.2.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a277935204d091edffe803d525c4c1b9297baa4ec1fa280616f80d3f946c5710
MD5 0c4c82c0249ded2a806e6390bd30a2c2
BLAKE2b-256 c0c9e09a6f1e9818b55c7849d8f1f814c8489b70805ee788ca4f268a15e5d88b

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