Skip to main content

2D visualisation of COMPAS geometry and data structures with matplotlib.

Project description

COMPAS Plotter

Made with COMPAS build License PyPI

2D visualisation of COMPAS geometry and data structures, powered by matplotlib.

compas_plotter provides a lightweight, dependency-free (other than matplotlib) way to draw COMPAS objects in 2D. It is the COMPAS 2.x successor of the compas_plotters package that shipped inside COMPAS up to version 1.17, rebuilt on top of the modern compas.scene system. It registers a "Plotter" visualisation context, so any COMPAS object with a registered plotter scene object can be drawn with a single plotter.add(...).

Installation

pip install compas_plotter

Quick start

from compas.geometry import Point, Line, Polygon
from compas.datastructures import Mesh
from compas_plotter import Plotter

plotter = Plotter(figsize=(8, 5))

mesh = Mesh.from_polyhedron(8)
plotter.add(mesh, show_vertices=True, show_edges=True)
plotter.add(Polygon([[0, 0, 0], [3, 0, 0], [3, 3, 0]]), facecolor=(0.9, 0.9, 1.0))
plotter.add(Line(Point(0, 0, 0), Point(3, 3, 0)), linecolor=(1, 0, 0))
plotter.add(Point(1.5, 1.5, 0))

plotter.zoom_extents()
plotter.show()

Supported objects

Category Objects
Geometry Point, Vector, Line, Polyline, Polygon, Circle, Ellipse, Frame
Shapes (drawn as XY projections) Box, Sphere, Cylinder, Cone, Capsule, Torus, Polyhedron
Data structures Mesh, Graph

Brep, Surface, NurbsCurve, VolMesh and Plane are not yet supported — see the roadmap.

Roadmap

Planned additions, most likely drawn as XY projections following the existing ShapeObject:

  • Brep and Surface (tessellate to a mesh, then project; Brep needs an optional backend such as compas_occ)
  • NurbsCurve (sampled to a polyline)
  • VolMesh and Plane

Documentation

Full documentation is available at compas.dev/compas_plotter.

License

compas_plotter is released under the MIT License.

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

compas_plotter-1.0.0.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

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

compas_plotter-1.0.0-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file compas_plotter-1.0.0.tar.gz.

File metadata

  • Download URL: compas_plotter-1.0.0.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for compas_plotter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1eb8048ac4ba44ee8458b880218e3d8b45812d5a8fa8e939c07a678e16e2ccc0
MD5 62cfb8199a4db7d86ccab3c1674bd7e5
BLAKE2b-256 4a6410905f589d1ebc444f1536c7d4b77f3785fa6237dfab738f8a0b3a785a22

See more details on using hashes here.

File details

Details for the file compas_plotter-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: compas_plotter-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 27.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for compas_plotter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 030d78d479eeea598973fbce48b824bced5002ca9cd1f482d695a9965a979f31
MD5 8c81df75720d97f0a9b5f06e07c661a8
BLAKE2b-256 9771f412f0c1bfe690b42d0d05233368b22c9f4802c79cecda715a298fc79f26

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