pymead.core.point.Point#
- class Point(x: float, y: float, name: str | None = None, relative_airfoil_name: str | None = None, setting_from_geo_col: bool = False)[source]#
Bases:
PymeadObjThe
Pointis the lowest-level geometry object in pymead. All curves in pymead are tied directly toPointobjects. For example, instances of this class are used to define the endpoints of finite lines and control points of Bézier curves.- __init__(x: float, y: float, name: str | None = None, relative_airfoil_name: str | None = None, setting_from_geo_col: bool = False)[source]#
- Parameters:
sub_container (str) – Sub-container where this object will be stored in the
GeometryCollection
Methods
as_array()Gives a one-dimensional, two-element array representation of the point (\(x\) and \(y\) values)
generate_from_array(arr[, name])Gets a dictionary representation of the pymead object.
is_coincident(other[, rtol])Determines whether this point is coincident with another point (within a tight tolerance)
This method determines if movement is allowed for the point.
measure_angle(other)Measures the angle (in radians) of the line starting at this point and ending at
othermeasure_distance(other)Measures the distance from this point to another point.
request_move(xp, yp[, force])Updates the location of the point and updates any curves and canvas items associated with the point movement.
set_name(name)Extends the base
set_name()by also renaming the point'sxandyparameters.set_x(x)set_y(y)x()Getter for the point's
xparameter.y()Getter for the point's
yparameter.Attributes
- as_array()[source]#
Gives a one-dimensional, two-element array representation of the point (\(x\) and \(y\) values)
- Returns:
One-dimensional array containing the point’s \(x\) and \(y\) values
- Return type:
np.ndarray
- get_dict_rep()[source]#
Gets a dictionary representation of the pymead object. In general, this dictionary should consist of only the required arguments for object instantiation. For example, the dictionary representation of a point looks something like this:
{"x": 0.3, "y": 0.5}. If the argument requires a reference to aPymeadObjrather than a string or float value, thename()method should be the value that is stored. For an example, see the overridden value of this method inpymead.core.airfoil.Airfoil. All subclasses ofPymeadObjmust implement this method, since it is the way pymead objects are stored in saved instances of aGeometryCollection(.jmeafiles).
- is_coincident(other: Point, rtol: float = 1e-14) bool[source]#
Determines whether this point is coincident with another point (within a tight tolerance)
- is_movement_allowed() bool[source]#
This method determines if movement is allowed for the point. Movement is allowed in these cases:
Where the constraint solver has not been set or there are no geometric constraints attached
Where the point is a root or rotation handle of a constraint cluster. If a rotation handle, movement is allowed, but the movement gets accepted as a rotation about the root point with a fixed distance to the root point
Where the point is one of the first three out of the four points in a symmetry constraint, and no edges are attached to this point in the constraint graph
- Returns:
Trueif movement is allowed for this point,Falseotherwise- Return type:
- measure_angle(other: Point)[source]#
Measures the angle (in radians) of the line starting at this point and ending at
other
- measure_distance(other: Point) float[source]#
Measures the distance from this point to another point.
- request_move(xp: float, yp: float, force: bool = False)[source]#
Updates the location of the point and updates any curves and canvas items associated with the point movement.
- Parameters:
Warning
The
forcekeyword argument should never be called directly from the API, or unexpected behavior may result. This argument is used in the backend code for the constraint solver in the symmetry and curvature constraints.
- set_name(name: str)[source]#
Extends the base
set_name()by also renaming the point’sxandyparameters.- Parameters:
name (str) – Name for the point