jitx.shapes package#
Shapes and geometry#
This module provides the core Shape and ShapeGeometry
classes for representing geometric objects with optional transformations.
Shapes can be converted between different representations (primitive, shapely)
and positioned using transforms.
- class Shape(geometry, transform)[source]#
Bases:
Generic[CoShapeGeometry]A shape with geometry and an optional transform.
Shapes combine geometric data with positioning information, allowing geometric objects to be placed and transformed in 2D space.
- Parameters:
geometry (CoShapeGeometry)
transform (Transform)
- geometry: CoShapeGeometry#
The geometric data for this shape.
- to_shapely()[source]#
Convert the given shape into a ‘shapely’ native format including the transform.
- Returns:
A
ShapelyGeometryshape with all of the points of the geometry transformed by thetransformproject of this shape.
- at(x, y=None, /, *, rotate=0, scale=1)[source]#
- Overloads:
self, x (float), y (float), rotate (float), scale (float) → Shape[CoShapeGeometry]
self, vector (Point), rotate (float), scale (float) → Shape[CoShapeGeometry]
self, transform (Transform) → Shape[CoShapeGeometry]
- Parameters:
- Return type:
Shape[CoShapeGeometry]
Create a new shape with additional positioning transform.
- class ShapeGeometry[source]#
-
Shape geometry is raw shape information, without a transform.
- property geometry#
- property transform#