11# AGENTS.md
22
3- Guidance for AI coding agents (and humans) working on ** compas_plotters ** .
3+ Guidance for AI coding agents (and humans) working on ** compas_plotter ** .
44This is the canonical onboarding doc; ` CLAUDE.md ` just imports it.
55
66## What this is
77
8- ` compas_plotters ` is the COMPAS 2.x revival of the 2D matplotlib visualisation
8+ ` compas_plotter ` is the COMPAS 2.x revival of the 2D matplotlib visualisation
99package that shipped inside COMPAS up to 1.17. It draws COMPAS geometry and data
1010structures onto a matplotlib canvas via the modern ` compas.scene ` system, by
1111registering a ` "Plotter" ` visualisation context — the same mechanism the Rhino,
@@ -16,22 +16,22 @@ to PyPI and the GitHub repo may not exist yet.
1616
1717## Architecture in 60 seconds
1818
19- - ** ` Plotter ` ** ([ src/compas_plotters /plotter.py] ( src/compas_plotters /plotter.py ) ) —
19+ - ** ` Plotter ` ** ([ src/compas_plotter /plotter.py] ( src/compas_plotter /plotter.py ) ) —
2020 wraps a matplotlib figure/axes. Public API: ` add ` , ` add_from_list ` , ` find ` ,
2121 ` zoom_extents ` , ` draw ` , ` redraw ` , ` show ` , ` save ` , ` pause ` , ` register_listener ` ,
2222 ` on ` (dynamic/animation + GIF).
23- - ** ` PlotterScene(compas.scene.Scene) ` ** ([ scene/plotterscene.py] ( src/compas_plotters /scene/plotterscene.py ) ) —
23+ - ** ` PlotterScene(compas.scene.Scene) ` ** ([ scene/plotterscene.py] ( src/compas_plotter /scene/plotterscene.py ) ) —
2424 the container. Every ` Plotter ` owns one (` plotter.scene ` ), context hardcoded to
2525 ` "Plotter" ` . ` Plotter.add ` delegates to ` PlotterScene.add ` , which injects the
2626 owning plotter into each scene object and draws it. This gives a real scene tree
2727 (parent/child, composed ` worldtransformation ` ) and serialization. Pattern copied
2828 from ` compas_viewer ` 's ` ViewerScene ` .
29- - ** ` PlotterSceneObject ` ** ([ scene/plotterobject.py] ( src/compas_plotters /scene/plotterobject.py ) ) —
29+ - ** ` PlotterSceneObject ` ** ([ scene/plotterobject.py] ( src/compas_plotter /scene/plotterobject.py ) ) —
3030 base for all drawable objects. Subclasses implement ` draw() ` (returns the list
3131 of matplotlib artists, stored on ` self._mpl_objects ` ) and ` viewdata() ` (the
3232 ` [x, y] ` points used by ` zoom_extents ` ). ` clear() ` and ` redraw() ` are provided.
3333 Also exposes helpers ` to_rgb() ` and ` to_color() ` .
34- - ** Registration** ([ scene/__ init__ .py] ( src/compas_plotters /scene/__init__.py ) ) —
34+ - ** Registration** ([ scene/__ init__ .py] ( src/compas_plotter /scene/__init__.py ) ) —
3535 ` @plugin(category="factories") register_scene_objects() ` maps each COMPAS type
3636 to its object with ` register(T, O, context="Plotter") ` . It is ** also called
3737 eagerly at import** so the package works without entry-point discovery (editable
@@ -113,22 +113,22 @@ python -m mkdocs serve # live docs preview
113113There are two patterns already in the tree — copy the closest one.
114114
115115** A. A single COMPAS type → dedicated object.** See
116- [ scene/circleobject.py] ( src/compas_plotters /scene/circleobject.py ) (geometry) or
117- [ scene/boxobject.py] ( src/compas_plotters /scene/boxobject.py ) (shape).
116+ [ scene/circleobject.py] ( src/compas_plotter /scene/circleobject.py ) (geometry) or
117+ [ scene/boxobject.py] ( src/compas_plotter /scene/boxobject.py ) (shape).
118118
1191191 . Create ` scene/<thing>object.py ` with
120120 ` class <Thing>Object(PlotterSceneObject, GeometryObject) ` (or ` MeshObject ` /
121121 ` GraphObject ` base for data structures).
1221222 . Implement ` __init__ ` (call ` super().__init__(zorder=..., **kwargs) ` ; set your
123123 style attrs), ` viewdata() ` , and ` draw() ` (build matplotlib artists, append to
124124 ` self._mpl_objects ` , ` return self._mpl_objects ` ).
125- 3 . In [ scene/__ init__ .py] ( src/compas_plotters /scene/__init__.py ) : import it, add
125+ 3 . In [ scene/__ init__ .py] ( src/compas_plotter /scene/__init__.py ) : import it, add
126126 ` register(<Thing>, <Thing>Object, context="Plotter") ` inside
127127 ` register_scene_objects() ` , and add it to ` __all__ ` .
1281284 . Add a test in [ tests/test_plotter.py] ( tests/test_plotter.py ) and a CHANGELOG entry.
129129
130130** B. A family of types → one shared object.** See
131- [ scene/shapeobject.py] ( src/compas_plotters /scene/shapeobject.py ) : ` ShapeObject `
131+ [ scene/shapeobject.py] ( src/compas_plotter /scene/shapeobject.py ) : ` ShapeObject `
132132tessellates any ` Shape ` with ` to_vertices_and_faces() ` and projects to XY; the
133133registration loop maps several classes to it.
134134
@@ -138,7 +138,7 @@ Breps and surfaces are the main remaining gap. Plan: tessellate to a mesh
138138(` Brep.to_tesselation() ` / surface sampling) and project to XY, mirroring
139139` ShapeObject ` . Breps require an optional backend (e.g. ` compas_occ ` ), so register
140140them inside a ` try/except ImportError ` block (see git history of
141- [ scene/__ init__ .py] ( src/compas_plotters /scene/__init__.py ) for the guarded pattern).
141+ [ scene/__ init__ .py] ( src/compas_plotter /scene/__init__.py ) for the guarded pattern).
142142
143143## Release
144144
0 commit comments