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

Uploaded Python 3

File details

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

File metadata

  • Download URL: Shape4D-0.2.4.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.4.tar.gz
Algorithm Hash digest
SHA256 1c6df7ca72d40868a985f8175d42a8e0d7bf42aaa896eb5389082c30e6f9624f
MD5 be677bf83b0f2ff85aa4a1d7c3983818
BLAKE2b-256 20744d05c255650b7d297d66e11d00f8e0cdbd905157793bd10feec5fc4cad2e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Shape4D-0.2.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 da7312021e0610caad47b28d5c8b68cf0521e5b6015dd98ca9c70d23435203cd
MD5 c9575f417530e3eeaf5aa5faaca093ca
BLAKE2b-256 417ba1a0ea2b04e142e62f5b3b3f3b929d8347510a8ad97456c97b1040cd90b4

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