svgen.cartesian package#
Subpackages#
- svgen.cartesian.rectangle package
- Submodules
- svgen.cartesian.rectangle.corner module
CornerScalarRectangleCornerRectangleCorner.BOTTOM_LEFTRectangleCorner.BOTTOM_RIGHTRectangleCorner.TOP_LEFTRectangleCorner.TOP_RIGHTRectangleCorner.horizontalRectangleCorner.on_bottomRectangleCorner.on_leftRectangleCorner.on_rightRectangleCorner.on_topRectangleCorner.origin()RectangleCorner.origin_dxRectangleCorner.origin_dyRectangleCorner.vector_dxRectangleCorner.vector_dyRectangleCorner.vertical
- svgen.cartesian.rectangle.grid module
- Module contents
RectangleRectangle.bottom_leftRectangle.bottom_rightRectangle.centerRectangle.centered()Rectangle.contains()Rectangle.corner()Rectangle.create()Rectangle.dimensionsRectangle.from_center()Rectangle.heightRectangle.locationRectangle.originRectangle.scale()Rectangle.scale_whole()Rectangle.squareRectangle.to_square()Rectangle.top_leftRectangle.top_rightRectangle.translate()Rectangle.width
Submodules#
svgen.cartesian.angle module#
A module implementing an interface for angles.
- class svgen.cartesian.angle.DegreePrimitive(val: int)[source]#
Bases:
int,RotatableA class to manage integer primitives for degrees within a 0 and 360 range.
- arc(count: int = 1, divisor: int = 2) DegreePrimitive[source]#
Rotate this angle around the circle.
- rotate(val: int) DegreePrimitive[source]#
Rotate this degree instance.
svgen.cartesian.circle module#
svgen - A module for interacting with circular entities.
- class svgen.cartesian.circle.Circle(radius: float, center: Point = (0.0, 0.0, True, -1))[source]#
Bases:
NamedTupleA radius and center describing a circle.
- property attrs: CircleAttrs#
Get the ‘radius’ and ‘center’ attributes for this circle.
- property center_attrs: PointAttrs#
Get the ‘center’ attributes for this circle.
- radius: float#
Alias for field number 0
- property radius_attr: SimpleAttribute#
Get the ‘radius’ attribute for this circle.
- translate(move: Translation) Circle[source]#
Move this circle by a given translation.
- class svgen.cartesian.circle.CircleAttrs(radius: SimpleAttribute, center: PointAttrs)[source]#
Bases:
NamedTupleA grouping for ‘width’ and ‘center’ attributes for a cicle.
- center: PointAttrs#
Alias for field number 1
- radius: SimpleAttribute#
Alias for field number 0
- property radius_val: float#
Get the ‘radius’ value for this circle.
svgen.cartesian.mutate module#
A module implementing cartesian object mutations.
- class svgen.cartesian.mutate.Angle(degrees: float, radians: float, sin: float, cos: float)[source]#
Bases:
NamedTupleA definition of angle attributes.
- cos: float#
Alias for field number 3
- degrees: float#
Alias for field number 0
- radians: float#
Alias for field number 1
- sin: float#
Alias for field number 2
- class svgen.cartesian.mutate.Translation(dx: float = 0.0, dy: float = 0.0)[source]#
Bases:
NamedTupleA definition of a translation in a Cartesian coordinate system.
- dx: float#
Alias for field number 0
- dy: float#
Alias for field number 1
- static normalize(dx: Translation | float, *args, **kwargs) Translation[source]#
Normalize input data into a translation.
- static polar(count: float, radius: float = 1.0, degrees: bool = True, ccw: bool = True) Translation[source]#
Create a polar translation based on provided parameters.
- rotate(angle: Angle = (90.0, 1.5707963267948966, 1.0, 6.123233995736766e-17)) Translation[source]#
Rotate this translation vector by some angle.
svgen.cartesian.plane module#
A module for working with two-dimensional planes.
svgen.cartesian.point module#
A module for interfacing with points.
- class svgen.cartesian.point.Point(x: float = 0.0, y: float = 0.0, center: bool = False, idx: int = -1)[source]#
Bases:
NamedTupleA definition of a point in a Cartesian coordinate system.
- property attrs: PointAttrs#
Get the ‘x’ and ‘y’ attributes for this point.
- center: bool#
Alias for field number 2
- idx: int#
Alias for field number 3
- polar(count: float, radius: float = 1.0, degrees: bool = True, ccw: bool = True) Point[source]#
Create a new point from a polar-coordinate translation.
- translate(move: Translation | float, *args) Point[source]#
Move a point by a given translation.
- with_index(idx: int) Point[source]#
Get a new point with the specified index, from an existing point.
- x: float#
Alias for field number 0
- property x_attr: SimpleAttribute#
Get the ‘x’ attribute for this point.
- y: float#
Alias for field number 1
- property y_attr: SimpleAttribute#
Get the ‘y’ attribute for this point.
- class svgen.cartesian.point.PointAttrs(x: SimpleAttribute, y: SimpleAttribute)[source]#
Bases:
NamedTupleA grouping for ‘x’ and ‘y’ attributes.
- x: SimpleAttribute#
Alias for field number 0
- property x_val: float#
Get the ‘x’ coordinate for these attributes.
- y: SimpleAttribute#
Alias for field number 1
- property y_val: float#
Get the ‘y’ coordinate for these attributes.
Module contents#
svgen - A module for Cartesian-coordinate interfaces.
- class svgen.cartesian.DimensionAttrs(width: SimpleAttribute, height: SimpleAttribute)[source]#
Bases:
NamedTupleA grouping for ‘width’ and ‘height’ attributes.
- height: SimpleAttribute#
Alias for field number 1
- property height_val: float#
Get the ‘height’ value for these dimensions.
- width: SimpleAttribute#
Alias for field number 0
- property width_val: float#
Get this ‘width’ value for these dimensions.
- class svgen.cartesian.Dimensions(width: float, height: float)[source]#
Bases:
NamedTupleA set of dimensions describing a rectangular entity.
- property attrs: DimensionAttrs#
Get the ‘width’ and ‘height’ attributes for these dimensions.
- property dx: float#
An alias for width.
- property dy: float#
An alias for height.
- height: float#
Alias for field number 1
- property height_attr: SimpleAttribute#
Get the ‘height’ attribute for these dimensions.
- scale(width_scale: float = 1.0, height_scale: float = 1.0) Dimensions[source]#
Scale these dimensions.
- property square: bool#
Determine if these dimensions are square.
- to_centered_square(scale: float = 1.0) Tuple[Dimensions, Translation][source]#
Make dimensions square and determine the resulting translation that would be needed to logically center the new object.
- to_square(scale: float = 1.0) Dimensions[source]#
Convert these dimensions to a scaled square.
- width: float#
Alias for field number 0
- property width_attr: SimpleAttribute#
Get the ‘width’ attribute for these dimensions.