upxo.geoEntities.bases module
Abstract base classes for UPXO geometric entities.
Usage
from upxo.geoEntities.bases import UPXO_Point, UPXO_Edge
Classes
UPXO_Point : Abstract base class for 2D and 3D point objects. UPXO_Edge : Abstract base class for 2D and 3D edge objects.
Notes
Concrete implementations (e.g., point2d, edge2d) must override all
abstract methods. The base classes define the common interface contract only
and carry no executable logic.
- class upxo.geoEntities.bases.UPXO_Point(x=0.0, y=0.0, pln='ij')[source]
Bases:
ABCAbstract base class for UPXO point entities.
Defines the minimum interface that all concrete 2D and 3D point implementations must satisfy.
- abstractmethod add(distances, update=True, throw=False, mydecatlen2NUM='taxx')[source]
Translate this point by the given distances.
- abstractmethod distance(plist=None)[source]
Calculate the EUclidean distance between self and list of points.
- x
- y
- pln
- f
- class upxo.geoEntities.bases.UPXO_Edge[source]
Bases:
ABCAbstract base class for UPXO edge (line segment) entities.
Defines the common interface contract for all concrete 2D and 3D edge implementations. Subclasses store their start and end point references as
iandj.- abstract property mid
Unique identifier (e.g. Python id) of this edge object.
- abstract property ang
Orientation angle of the edge in degrees.
- abstract property length
Euclidean length of the edge.
- classmethod by_coord(start_point, end_point)[source]
Construct an edge from two coordinate pairs or point objects.
- classmethod by_loc_len_ang(*, ref='i', loc=[0, 0, 0], length=1, ang=0, degree=True)[source]
Construct an edge from a reference point, length, and angle.
- abstractmethod distance_to_points(*, plist=None)[source]
Calculate distances from this edge to a list of points.
- abstractmethod distance_to_edges(*, elist=None, method='ref', refi='mid', refj='mid')[source]
Calculate distances from this edge to a list of other edges.
- abstractmethod translate_by(*, vector=None, dist=None, update=False, throw=True)[source]
Translate this edge by a displacement vector or scalar distance.
- abstractmethod translate_to(*, ref='i', point=None, update=False, throw=True)[source]
Translate this edge so that the reference endpoint lands on
point.
- abstractmethod rotate_about(*, axis=None, angle=0, degree=True, update=False, throw=True)[source]
Rotate this edge about an axis by the given angle.
- abstractmethod attach_mp(*, mp=None, name=None)[source]
Attach a material-property object to this edge under
name.
- abstractmethod find_neigh_point_by_distance(*, plist=None, plane='xy', r=0)[source]
Find all points within radius
rof this edge.
- abstractmethod find_neigh_point_by_count(*, plist=None, n=None, plane='xy')[source]
Find the
nnearest points to this edge.
- abstractmethod find_neigh_mulpoint_by_distance(*, mplist=None, plane='xy', r=0, tolf=-1)[source]
Find all mulpoint objects within radius
rof this edge.
- abstractmethod find_neigh_edge_by_distance(*, elist=None, plane='xy', refloc='starting', r=0)[source]
Find all edges whose reference location is within radius
r.
- abstractmethod find_neigh_muledge_by_distance(*, melist=None, plane='xy', refloc='starting', r=0)[source]
Find all muledge objects within radius
r.
- abstractmethod find_neigh_xtal_by_distance(*, xlist=None, plane='xy', refloc='starting', r=0)[source]
Find all crystal objects within radius
rof this edge.
- abstract property coords
Endpoint coordinates as a NumPy array.
- abstractmethod array_translation(*, ncopies=10, vector=[[0, 0, 0], [0, 0, 1]], spacing='constant')[source]
Generate an array of translated copies of this edge.
- abstractmethod lies_on_which_edge(*, elist=None, consider_ends=True)[source]
Determine which edges from
elistthis edge lies on.
- i
- j