Skip to main content

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

Project description

COMPAS Plotter

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: compas_plotter-1.0.0rc0.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.0rc0.tar.gz
Algorithm Hash digest
SHA256 258b271653ef696b9b6d71fafc7b736bb4b9edbe3e0a8cc15d0d4503744f29d9
MD5 2bcfb8a0362d98a746b5857791687668
BLAKE2b-256 bbca22add8e139a725718995ecd02b8c30f3af0d36d3cc13e3e8003bb236c7c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for compas_plotter-1.0.0rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 91740b5c1d2e433647b13899ae74f7f079895ec1042225fb8ed23b7397f5cb63
MD5 175c942509f18695cfb44dffe0166c90
BLAKE2b-256 7386ad03e81e200d569677340663e528171e8e1fb0edbddf0b4d837abd35000d

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