airframe_geometry
- class String
Bases:
CommonBaseModel
Represents a string data type with enhanced attributes for engineering applications.
- value
The actual string value. It must have at least 1 character.
- Type:
str
- default
A default value for the variable, if any. Defaults to None.
- Type:
Optional[str]
- metadata
Additional metadata providing further context or details about the variable. Defaults to a new instance of Metadata.
- Type:
- Raises:
ValidationError – If the input value does not meet the validation criteria.
Methods:
validate_value_not_empty
(value)Validate that the string value is not empty or just whitespace.
Attributes:
__setattr__ handlers.
- classmethod validate_value_not_empty(value)
Validate that the string value is not empty or just whitespace.
- Parameters:
value (str) – The string value to validate.
- Returns:
The validated string value.
- Raises:
ValueError – If the value is empty or just whitespace.
- Return type:
str
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- class Boolean
Bases:
CommonBaseModel
Represents a boolean data type with enhanced attributes for engineering applications.
- value
The actual boolean value.
- Type:
bool
- units
Units of the variable, typically ‘unitless’ for boolean types.
- Type:
str
- description
A brief description of the variable.
- Type:
Optional[str]
- default
Default boolean value of the variable, if any.
- Type:
Optional[bool]
- Raises:
ValidationError – If the input value does not meet the validation criteria.
Methods:
validate_default
(value, values)Validate and convert the default value to a boolean if it's provided as a string.
Attributes:
__setattr__ handlers.
- classmethod validate_default(value, values)
Validate and convert the default value to a boolean if it’s provided as a string.
- Parameters:
value (bool | None) – The default value being validated.
values (dict) – The dictionary containing the field values.
- Returns:
The validated default value.
- Raises:
ValueError – If the default value is a string that cannot be converted to a boolean.
- Return type:
bool | None
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- class Float
Bases:
CommonBaseModel
Represents a floating-point number with enhanced attributes for engineering applications.
- value
The actual floating-point value.
- Type:
float
- units
Units of the variable, allowing for dimensional analysis.
- Type:
str
- description
A brief description of the variable.
- Type:
Optional[str]
- default
Default floating-point value of the variable, if any.
- Type:
Optional[float]
- Raises:
ValidationError – If the input value does not meet the validation criteria.
Methods:
validate_default
(value, values)Validate and convert the default value to a float if it's provided as a string.
Attributes:
__setattr__ handlers.
- classmethod validate_default(value, values)
Validate and convert the default value to a float if it’s provided as a string.
- Parameters:
value (float | None) – The default value being validated.
values (dict) – The dictionary containing the field values.
- Returns:
The validated default value.
- Raises:
ValueError – If the default value is a string that cannot be converted to a float.
- Return type:
float | None
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- class Integer
Bases:
CommonBaseModel
Represents an integer data type with enhanced attributes for engineering applications.
- value
The actual integer value.
- Type:
int
- units
Units of the variable, allowing for dimensional analysis.
- Type:
str
- description
A brief description of the variable.
- Type:
Optional[str]
- default
Default integer value of the variable, if any.
- Type:
Optional[int]
- Raises:
ValidationError – If the input value does not meet the validation criteria.
Methods:
validate_default
(value, values)Validate and convert the default value to an integer if it's provided as a string.
Attributes:
__setattr__ handlers.
- classmethod validate_default(value, values)
Validate and convert the default value to an integer if it’s provided as a string.
- Parameters:
value (int | None) – The default value being validated.
values (dict) – The dictionary containing the field values.
- Returns:
The validated default value.
- Raises:
ValueError – If the default value is a string that cannot be converted to an integer.
- Return type:
int | None
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- class Point
Bases:
BaseModel
Represents a point in 3D space, defined by its x, y, and z coordinates.
- x
The x-coordinate of the point.
- Type:
float
- y
The y-coordinate of the point.
- Type:
float
- z
The z-coordinate of the point.
- Type:
float
- Raises:
ValueError – If any coordinate is not a finite number, ensuring points are well-defined in 3D space.
Attributes:
Return the coordinates as a tuple (x, y, z).
__setattr__ handlers.
Methods:
validate_coordinate
(value)Validate that the coordinate is a finite number, ensuring the point is well-defined.
distance_to
(other)Calculate the Euclidean distance between this point and another point.
__hash__
()Return the hash value of the Point object.
- property coordinates: Tuple[float, float, float]
Return the coordinates as a tuple (x, y, z).
- classmethod validate_coordinate(value)
Validate that the coordinate is a finite number, ensuring the point is well-defined.
- Parameters:
value (float) – The coordinate value to validate.
- Returns:
The validated coordinate value.
- Raises:
ValueError – If the coordinate is not a finite number.
- Return type:
float
- distance_to(other)
Calculate the Euclidean distance between this point and another point.
- Parameters:
other (Point) – The other point to calculate the distance to.
- Returns:
The Euclidean distance between the two points.
- Return type:
float
- __hash__()
Return the hash value of the Point object.
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- class Polyline
Bases:
CommonBaseModel
Represents a polyline, a series of connected 3D points forming a continuous line or path.
Useful in geometric modeling and spatial analysis, the Polyline class enables the representation of linear paths, edges, or trajectories in three-dimensional space, facilitating calculations and visualizations related to lines.
Methods:
validate_points
(value)Validate the 'points' list to ensure it contains at least two points.
add_point
(point)Add a new point object to the end of the polyline, extending its path.
length
()Calculate the total length of the polyline by summing the distances between consecutive points.
simplify
(tolerance)Simplify the polyline by removing redundant points based on a specified tolerance.
Attributes:
__setattr__ handlers.
- classmethod validate_points(value)
Validate the ‘points’ list to ensure it contains at least two points.
- add_point(point)
Add a new point object to the end of the polyline, extending its path.
- Parameters:
point (Point) – The point object to be appended to the polyline.
- Return type:
None
- length()
Calculate the total length of the polyline by summing the distances between consecutive points.
- Returns:
The total length of the polyline.
- Return type:
float
- simplify(tolerance)
Simplify the polyline by removing redundant points based on a specified tolerance.
The simplification algorithm iteratively removes points that deviate from the line segment formed by their neighboring points by a distance less than the specified tolerance. This process continues until no more points can be removed without exceeding the tolerance.
- Parameters:
tolerance (float) – The maximum deviation allowed for a point to be considered redundant.
- Returns:
A new simplified polyline with redundant points removed.
- Return type:
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- class Spline
Bases:
BaseModel
Represents a spline, which is a smooth curve constructed from a series of control points.
Splines are essential in various applications such as computer graphics, geometric modeling, and trajectory planning.
- points
The list of control points that define the spline. The spline passes through these points.
- Type:
List[Point]
- degree
The degree of the spline curve. Common values are 2 (quadratic) and 3 (cubic).
- Type:
int
- Raises:
ValueError – If the number of points is less than the degree + 1, which is necessary for defining a valid spline.
Methods:
validate_points
(value, values)Validate that the list of points is sufficient to define a spline of the specified degree.
validate_degree
(value)Validate that the degree of the spline is a positive integer.
Attributes:
__setattr__ handlers.
- classmethod validate_points(value, values)
Validate that the list of points is sufficient to define a spline of the specified degree.
- Parameters:
value (List[Point]) – The list of control points.
values (dict) – A dictionary of field names to their validated values.
- Returns:
The validated list of control points.
- Raises:
ValueError – If the number of points is less than the required for the spline’s degree.
- Return type:
List[Point]
- classmethod validate_degree(value)
Validate that the degree of the spline is a positive integer.
- Parameters:
value (int) – The degree of the spline.
- Returns:
The validated degree of the spline.
- Raises:
ValueError – If the degree is not a positive integer.
- Return type:
int
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- class Mesh
Bases:
CommonBaseModel
Represents a 3D mesh, a collection of polygons (typically triangles or quadrilaterals) used to model the surface of a 3D object.
Meshes are fundamental in computer graphics, engineering simulations, and geometric modeling, allowing for the detailed representation of complex 3D shapes. This class facilitates the construction, manipulation, and analysis of mesh geometries, supporting applications in visualization, physical simulation, and more.
Methods:
validate_polylines
(value)Validate the 'polylines' list to ensure it contains at least one polyline.
add_polyline
(polyline)Add a new polyline object to the mesh, expanding its geometry.
remove_polyline
(index)Remove a polyline from the mesh at the specified index.
Calculate the volume enclosed by the mesh.
Attributes:
__setattr__ handlers.
- classmethod validate_polylines(value)
Validate the ‘polylines’ list to ensure it contains at least one polyline.
- add_polyline(polyline)
Add a new polyline object to the mesh, expanding its geometry.
- Parameters:
polyline (Polyline) – The new polyline to be added to the mesh.
- Return type:
None
- remove_polyline(index)
Remove a polyline from the mesh at the specified index.
- Parameters:
index (int) – The index of the polyline to be removed.
- Raises:
IndexError – If the specified index is out of range.
- Return type:
None
- calculate_volume()
Calculate the volume enclosed by the mesh.
This method uses the tetrahedron decomposition algorithm to compute the volume enclosed by the mesh geometry.
- Returns:
The calculated volume of the mesh.
- Return type:
float
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- class Loft
Bases:
CommonBaseModel
Represents a lofted surface, a smooth spatial surface generated by transitioning between multiple spline curves.
In engineering and design, lofts are used to create complex shapes by smoothly connecting a series of cross-sectional profiles. This class enables the representation of lofted surfaces, facilitating their use in computational modeling, simulation, and visualization of aerodynamic shapes, product designs, and more.
- num_samples
The number of sample points to generate along each spline.
- Type:
int
Methods:
validate_splines
(value)Validate the 'splines' list to ensure it contains at least two splines with the same degree.
validate_num_samples
(value)Validate the 'num_samples' field to ensure it is a positive integer.
add_spline
(spline)Add a new spline to the series of cross-sectional profiles, potentially altering the shape of the lofted surface.
Calculate the lofted surface by interpolating between the splines.
Attributes:
__setattr__ handlers.
- classmethod validate_splines(value)
Validate the ‘splines’ list to ensure it contains at least two splines with the same degree.
- classmethod validate_num_samples(value)
Validate the ‘num_samples’ field to ensure it is a positive integer.
- Parameters:
value (int) – The number of samples being validated.
- Returns:
The validated number of samples.
- Raises:
ValueError – If the number of samples is not a positive integer.
- Return type:
int
- add_spline(spline)
Add a new spline to the series of cross-sectional profiles, potentially altering the shape of the lofted surface.
- Parameters:
spline (Spline) – The new spline to be added to the series defining the loft.
- Return type:
None
- calculate_surface()
Calculate the lofted surface by interpolating between the splines.
This method generates a series of intermediate curves by interpolating between the given splines, creating a smooth surface that transitions from one cross-sectional profile to another.
- Returns:
A list of lists representing the lofted surface points, where each inner list represents a point on the surface with [x, y, z] coordinates.
- Return type:
List[List[float]]
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- class Airfoil
Bases:
CommonBaseModel
Represents an airfoil section, a fundamental component in aircraft design for wings and control surfaces.
- Raises:
ValueError – If the spline is not provided.
Methods:
validate_spline
(value)Validates the spline defining the airfoil contour.
Attributes:
__setattr__ handlers.
- classmethod validate_spline(value)
Validates the spline defining the airfoil contour.
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- class ReferenceAxis
Bases:
CommonBaseModel
Represents the reference axis of a body component, such as an aircraft fuselage or wing.
- name
The name of the reference axis.
- Type:
str
- description
A brief description of the reference axis.
- Type:
Optional[str]
- relative_to
The name of another reference axis to which this axis is relative.
- Type:
Optional[str]
Methods:
validate_points
(value)Validate the 'points' list to ensure it contains at least two points.
validate_and_register
(values)Ensure that the name is unique and register the instance.
resolve_relative_to
(values)Resolve the 'relative_to' name to a ReferenceAxis instance.
__init__
(**data)Create a new model by parsing and validating input data from keyword arguments.
model_post_init
(context, /)This function is meant to behave like a BaseModel method to initialise private attributes.
Attributes:
__setattr__ handlers.
- classmethod validate_points(value)
Validate the ‘points’ list to ensure it contains at least two points.
- classmethod validate_and_register(values)
Ensure that the name is unique and register the instance.
- Parameters:
values (dict) – The dictionary of field values.
- Returns:
The validated dictionary of field values.
- Raises:
ValueError – If the name is not unique.
- Return type:
dict
- classmethod resolve_relative_to(values)
Resolve the ‘relative_to’ name to a ReferenceAxis instance.
- Parameters:
values (dict) – The dictionary of field values.
- Returns:
The validated dictionary of field values.
- Raises:
ValueError – If the ‘relative_to’ name does not exist.
- Return type:
dict
- __init__(**data)
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialise private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self (BaseModel) – The BaseModel instance.
context (Any) – The context.
- Return type:
None
- class LiftingSurface
Bases:
CommonBaseModel
Represents the geometric characteristics of a lifting surface, such as wings and tail surfaces of aircraft.
- leading_edge_spline
Spline defining the leading edge of the lifting surface.
- Type:
Optional[Spline]
- trailing_edge_spline
Spline defining the trailing edge of the lifting surface.
- Type:
Optional[Spline]
- airfoil_sections
List of Airfoil objects representing the airfoil shapes along the span.
- Type:
List[Airfoil]
- Raises:
ValueError – If the list of airfoil sections is empty.
Methods:
validate_airfoil_sections
(value)Ensures that at least one Airfoil object is provided.
Attributes:
__setattr__ handlers.
- classmethod validate_airfoil_sections(value)
Ensures that at least one Airfoil object is provided.
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- class CrossSection
Bases:
CommonBaseModel
Represents a cross-section of a body component at a specific station along its length.
- station
Normalized station of the cross-section along the body’s length.
- Type:
float
- Raises:
ValueError – If neither an upper nor a lower curve spline is provided.
Methods:
validate_curves
(values)Validates that at least one of the upper or lower curve splines is provided.
Attributes:
__setattr__ handlers.
- classmethod validate_curves(values)
Validates that at least one of the upper or lower curve splines is provided.
- Parameters:
values (dict) – Dictionary of field values.
- Returns:
The validated dictionary of field values.
- Raises:
ValueError – If neither an upper nor a lower curve spline is provided.
- Return type:
dict
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- class Body
Bases:
CommonBaseModel
Represents the geometric definition of a body-like surface component, such as an aircraft fuselage or engine nacelle.
- cross_sections
List of CrossSection objects defining the body’s shape at various stations.
- Type:
List[CrossSection]
- Raises:
ValueError – If the list of cross sections is empty.
Methods:
validate_cross_sections
(value)Ensures that at least one CrossSection object is provided.
Attributes:
__setattr__ handlers.
- classmethod validate_cross_sections(value)
Ensures that at least one CrossSection object is provided.
- Parameters:
value (List[CrossSection]) – The list of CrossSection objects to validate.
- Returns:
The validated list of CrossSection objects.
- Raises:
ValueError – If the list is empty.
- Return type:
List[CrossSection]
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- class Geometry
Bases:
CommonBaseModel
Attributes:
__setattr__ handlers.
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
Classes
Represents an airfoil section, a fundamental component in aircraft design for wings and control surfaces. |
|
Represents the geometric definition of a body-like surface component, such as an aircraft fuselage or engine nacelle. |
|
Represents a boolean data type with enhanced attributes for engineering applications. |
|
Represents a cross-section of a body component at a specific station along its length. |
|
Represents a floating-point number with enhanced attributes for engineering applications. |
|
Represents an integer data type with enhanced attributes for engineering applications. |
|
Represents the geometric characteristics of a lifting surface, such as wings and tail surfaces of aircraft. |
|
Represents a lofted surface, a smooth spatial surface generated by transitioning between multiple spline curves. |
|
Represents a 3D mesh, a collection of polygons (typically triangles or quadrilaterals) used to model the surface of a 3D object. |
|
Represents a point in 3D space, defined by its x, y, and z coordinates. |
|
Represents a polyline, a series of connected 3D points forming a continuous line or path. |
|
Represents the reference axis of a body component, such as an aircraft fuselage or wing. |
|
Represents a spline, which is a smooth curve constructed from a series of control points. |
|
Represents a string data type with enhanced attributes for engineering applications. |