geometor.model.circles¶
Provides circle construction and manipulation for the Model class.
This module manages the creation of symbolic circles defined by a center point and a radius point. It handles the integration of these circles into the model, ensuring uniqueness and calculating intersections.
Classes¶
Mixin for the Model class containing circle construction operations. |
Module Contents¶
- class geometor.model.circles.CirclesMixin¶
Mixin for the Model class containing circle construction operations.
This mixin extends the Model with capabilities to construct circles. It supports creating circles from point objects or their IDs and ensures they are correctly registered and intersected with other elements in the model.
- construct_circle_by_IDs(pt_1_ID: str, pt_2_ID: str, classes: list[str] | None = None, ID: str = '') sympy.geometry.Circle¶
Find points by ID and use them with
Model.construct_circle().This convenience wrapper enables circle construction using string identifiers for the center and radius points, simplifying the API when working with named elements.
- Parameters:
pt_1_ID – The ID of the center point.
pt_2_ID – The ID of the radius point.
classes – A list of class labels.
ID – A string ID for the circle.
- Returns:
The constructed
sympy.geometry.ellipse.Circle.
- construct_circle(pt_center: sympy.geometry.Point, pt_radius: sympy.geometry.Point, classes: list[str] | None = None, ID: str = '', guide: bool = False) sympy.geometry.Circle¶
Construct a Circle from two points and add it to the model.
This method creates a circle defined by a center point and a point on the circumference (establishing the radius). It checks for duplicates within the model, merging attributes if an equivalent circle exists, or computing intersections if it is new.
- Parameters:
pt_center – The center point of the circle.
pt_radius – A point on the circumference of the circle.
classes – A list of class labels.
ID – A string ID for the circle. If empty, one is generated.
guide – If True, the circle is a guide.
- Returns:
The constructed or retrieved
sympy.geometry.ellipse.Circle.- Raises:
TypeError – If
pt_centerorpt_radiusare not instances ofsympy.geometry.point.Point.