geometor.model.wedges

Provides wedge construction and manipulation for the Model class.

This module introduces the Wedge element, which represents a sector of a circle defined by a center, a radius point, and sweep angles. It handles the creation, validation, and property calculation (like area and arc length) for these wedge shapes.

Classes

WedgesMixin

Mixin for the Model class containing wedge construction operations.

Wedge

Represents a wedge (sector) of a circle.

Module Contents

class geometor.model.wedges.WedgesMixin

Mixin for the Model class containing wedge construction operations.

This mixin provides the Model with the capability to define and manage Wedge elements. It includes methods to construct wedges from defining points and integrate them into the geometric model.

set_wedge_by_IDs(pt_center_ID: str, pt_radius_ID: str, pt_sweep_start_ID: str, pt_sweep_end_ID: str, direction: str = 'clockwise', classes: list[str] | None = None, ID: str = '') Wedge

Find points by ID and use them with Model.set_wedge().

Parameters:
  • pt_center_ID – The ID of the center point.

  • pt_radius_ID – The ID of the radius point.

  • pt_sweep_start_ID – The ID of the sweep start point.

  • pt_sweep_end_ID – The ID of the sweep end point.

  • direction – Direction of the sweep (default “clockwise”).

  • classes – A list of class labels.

  • ID – A string ID for the wedge.

Returns:

The constructed Wedge.

set_wedge(pt_center: sympy.geometry.Point, pt_radius: sympy.geometry.Point, pt_sweep_start: sympy.geometry.Point, pt_sweep_end: sympy.geometry.Point, direction: str = 'clockwise', classes: list[str] | None = None, ID: str = '') Wedge

Set a Wedge from 3 points and add it to the model.

This method constructs a Wedge defined by a center, a radius point, and sweep points. It handles the low-level details of creating the Wedge object, wrapping it in an Element, calculating intersections, and adding it to the model structure.

Parameters:
  • pt_center – Point for circle center.

  • pt_radius – Point to mark radius.

  • pt_sweep_start – A SymPy Point marking the start of the sweep.

  • pt_sweep_end – A SymPy Point marking the end of the sweep.

  • direction – Direction of the sweep (default “clockwise”).

  • classes – A list of string names for classes defining a set of styles.

  • ID – A text ID for use in plotting and reporting.

Returns:

The constructed Wedge.

example

from geometor.elements import *
          model = Model("demo")
          A = model.set_point(0, 0, classes=["given"], ID="A")
          B = model.set_point(1, 0, classes=["given"], ID="B")
          model.construct_circle(A, B)
          model.construct_circle(B, A)
          model.set_wedge(A, B, C, D)
          # <Wedge object ...>
          
class geometor.model.wedges.Wedge(points: list[sympy.geometry.Point], direction: str = 'clockwise')

Represents a wedge (sector) of a circle.

A Wedge is defined by a center point, a radius point (defining the circle), and two sweep points determining the angle.

points
pt_center
pt_radius
pt_sweep_start
pt_sweep_end
sweep_ray
start_ray
direction = 'clockwise'
__repr__() str

Return string representation of the Wedge.

property circle: sympy.geometry.Circle

The SymPy Circle geometric entity associated with this wedge.

property radians: sympy.Expr

The angle of the wedge in radians.

property degrees: sympy.Expr

The angle of the wedge in degrees.

property ratio: sympy.Expr

The ratio of the wedge angle to a full circle (2*pi).

property area: sympy.Expr

The area of the wedge sector.

property arc_length: sympy.Expr

The length of the arc defined by the wedge.

property perimeter: sympy.Expr

The total perimeter of the wedge (arc length + 2 * radius).