airframe_geometry
adh.wbs.airframe.airframe_geometry
¤
Classes:
-
Airfoil–Represents an airfoil section, a fundamental component in aircraft design for wings and control surfaces.
-
Body–Represents the geometric definition of a body-like surface component, such as an aircraft fuselage or engine nacelle.
-
Boolean–Represents a boolean data type with enhanced attributes for engineering applications.
-
CrossSection–Represents a cross-section of a body component at a specific station along its length.
-
Float–Represents a floating-point number with enhanced attributes for engineering applications.
-
Integer–Represents an integer data type with enhanced attributes for engineering applications.
-
LiftingSurface–Represents the geometric characteristics of a lifting surface, such as wings and tail surfaces of aircraft.
-
Loft–Represents a lofted surface, a smooth spatial surface generated by transitioning between multiple spline curves.
-
Mesh–Represents a 3D mesh, a collection of polygons (typically triangles or quadrilaterals) used to model the surface of a 3D object.
-
Point–Represents a point in 3D space, defined by its x, y, and z coordinates.
-
Polyline–Represents a polyline, a series of connected 3D points forming a continuous line or path.
-
ReferenceAxis–Represents the reference axis of a body component, such as an aircraft fuselage or wing.
-
Spline–Represents a spline, which is a smooth curve constructed from a series of control points.
-
String–Represents a string data type with enhanced attributes for engineering applications.
Airfoil
pydantic-model
¤
Bases: BaseModel
Represents an airfoil section, a fundamental component in aircraft design for wings and control surfaces.
Attributes:
Raises:
-
ValueError–If the spline is not provided.
Show JSON schema:
{
"$defs": {
"Point": {
"description": "Represents a point in 3D space, defined by its x, y, and z coordinates.\n\nAttributes:\n x (float): The x-coordinate of the point.\n y (float): The y-coordinate of the point.\n z (float): The z-coordinate of the point.\n\nRaises:\n ValueError: If any coordinate is not a finite number, ensuring points are well-defined in 3D space.",
"properties": {
"x": {
"description": "The x-coordinate of the point.",
"title": "X",
"type": "number"
},
"y": {
"description": "The y-coordinate of the point.",
"title": "Y",
"type": "number"
},
"z": {
"description": "The z-coordinate of the point.",
"title": "Z",
"type": "number"
}
},
"required": [
"x",
"y",
"z"
],
"title": "Point",
"type": "object"
},
"Spline": {
"description": "Represents a spline, which is a smooth curve constructed from a series of control points.\n\nSplines are essential in various applications such as computer graphics, geometric modeling, and trajectory planning.\n\nAttributes:\n points (List[Point]): The list of control points that define the spline. The spline passes through these points.\n degree (int): The degree of the spline curve. Common values are 2 (quadratic) and 3 (cubic).\n\nRaises:\n ValueError: If the number of points is less than the degree + 1, which is necessary for defining a valid spline.",
"properties": {
"points": {
"description": "Control points that define the spline.",
"items": {
"$ref": "#/$defs/Point"
},
"minItems": 2,
"title": "Points",
"type": "array"
},
"degree": {
"default": 3,
"description": "The degree of the spline curve. Commonly 2 (quadratic) or 3 (cubic).",
"exclusiveMinimum": 0,
"title": "Degree",
"type": "integer"
}
},
"required": [
"points"
],
"title": "Spline",
"type": "object"
}
},
"description": "Represents an airfoil section, a fundamental component in aircraft design for wings and control surfaces.\n\nAttributes:\n spline (Optional[Spline]): A spline defining the contour of the airfoil section.\n\nRaises:\n ValueError: If the spline is not provided.",
"properties": {
"spline": {
"anyOf": [
{
"$ref": "#/$defs/Spline"
},
{
"type": "null"
}
],
"default": null,
"description": "A spline defining the contour of the airfoil section."
}
},
"title": "Airfoil",
"type": "object"
}
Fields:
Validators:
spline
pydantic-field
¤
A spline defining the contour of the airfoil section.
validate_spline
pydantic-validator
¤
Validates the spline defining the airfoil contour.
Parameters:
Returns:
-
Spline–The validated spline object.
Raises:
-
ValueError–If the spline is not provided.
Source code in src/adh/wbs/airframe/airframe_geometry.py
713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 | |
Body
pydantic-model
¤
Bases: BaseModel
Represents the geometric definition of a body-like surface component, such as an aircraft fuselage or engine nacelle.
Attributes:
-
reference_axis(Optional[Spline]) –Spline defining the reference axis of the body.
-
cross_sections(List[CrossSection]) –List of CrossSection objects defining the body's shape at various stations.
Raises:
-
ValueError–If the list of cross sections is empty.
Show JSON schema:
{
"$defs": {
"CrossSection": {
"description": "Represents a cross-section of a body component at a specific station along its length.\n\nAttributes:\n station (float): Normalized station of the cross-section along the body's length.\n upper_curve (Optional[Spline]): Spline defining the upper curve of the cross-section.\n lower_curve (Optional[Spline]): Spline defining the lower curve of the cross-section.\n\nRaises:\n ValueError: If neither an upper nor a lower curve spline is provided.",
"properties": {
"station": {
"description": "Normalized station of the cross-section along the body's length.",
"maximum": 1,
"minimum": 0,
"title": "Station",
"type": "number"
},
"upper_curve": {
"anyOf": [
{
"$ref": "#/$defs/Spline"
},
{
"type": "null"
}
],
"default": null,
"description": "Spline defining the upper curve of the cross-section."
},
"lower_curve": {
"anyOf": [
{
"$ref": "#/$defs/Spline"
},
{
"type": "null"
}
],
"default": null,
"description": "Spline defining the lower curve of the cross-section."
}
},
"required": [
"station"
],
"title": "CrossSection",
"type": "object"
},
"Point": {
"description": "Represents a point in 3D space, defined by its x, y, and z coordinates.\n\nAttributes:\n x (float): The x-coordinate of the point.\n y (float): The y-coordinate of the point.\n z (float): The z-coordinate of the point.\n\nRaises:\n ValueError: If any coordinate is not a finite number, ensuring points are well-defined in 3D space.",
"properties": {
"x": {
"description": "The x-coordinate of the point.",
"title": "X",
"type": "number"
},
"y": {
"description": "The y-coordinate of the point.",
"title": "Y",
"type": "number"
},
"z": {
"description": "The z-coordinate of the point.",
"title": "Z",
"type": "number"
}
},
"required": [
"x",
"y",
"z"
],
"title": "Point",
"type": "object"
},
"Spline": {
"description": "Represents a spline, which is a smooth curve constructed from a series of control points.\n\nSplines are essential in various applications such as computer graphics, geometric modeling, and trajectory planning.\n\nAttributes:\n points (List[Point]): The list of control points that define the spline. The spline passes through these points.\n degree (int): The degree of the spline curve. Common values are 2 (quadratic) and 3 (cubic).\n\nRaises:\n ValueError: If the number of points is less than the degree + 1, which is necessary for defining a valid spline.",
"properties": {
"points": {
"description": "Control points that define the spline.",
"items": {
"$ref": "#/$defs/Point"
},
"minItems": 2,
"title": "Points",
"type": "array"
},
"degree": {
"default": 3,
"description": "The degree of the spline curve. Commonly 2 (quadratic) or 3 (cubic).",
"exclusiveMinimum": 0,
"title": "Degree",
"type": "integer"
}
},
"required": [
"points"
],
"title": "Spline",
"type": "object"
}
},
"description": "Represents the geometric definition of a body-like surface component, such as an aircraft fuselage or engine nacelle.\n\nAttributes:\n reference_axis (Optional[Spline]): Spline defining the reference axis of the body.\n cross_sections (List[CrossSection]): List of CrossSection objects defining the body's shape at various stations.\n\nRaises:\n ValueError: If the list of cross sections is empty.",
"properties": {
"reference_axis": {
"anyOf": [
{
"$ref": "#/$defs/Spline"
},
{
"type": "null"
}
],
"default": null,
"description": "Spline defining the reference axis of the body."
},
"cross_sections": {
"description": "List of CrossSection objects defining the body's shape at various stations.",
"items": {
"$ref": "#/$defs/CrossSection"
},
"title": "Cross Sections",
"type": "array"
}
},
"required": [
"cross_sections"
],
"title": "Body",
"type": "object"
}
Fields:
Validators:
cross_sections
pydantic-field
¤
cross_sections: list[CrossSection]
List of CrossSection objects defining the body's shape at various stations.
reference_axis
pydantic-field
¤
Spline defining the reference axis of the body.
validate_cross_sections
pydantic-validator
¤
validate_cross_sections(value: list[CrossSection]) -> list[CrossSection]
Ensures that at least one CrossSection object is provided.
Parameters:
-
value(list[CrossSection]) –The list of CrossSection objects to validate.
Returns:
-
list[CrossSection]–The validated list of CrossSection objects.
Raises:
-
ValueError–If the list is empty.
Source code in src/adh/wbs/airframe/airframe_geometry.py
956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 | |
Boolean
pydantic-model
¤
Bases: BaseModel
Represents a boolean data type with enhanced attributes for engineering applications.
Attributes:
-
value(bool) –The actual boolean value.
-
units(str) –Units of the variable, typically 'unitless' for boolean types.
-
description(Optional[str]) –A brief description of the variable.
-
default(Optional[bool]) –Default boolean value of the variable, if any.
-
metadata(Metadata) –Additional metadata for the variable.
Raises:
-
ValidationError–If the input value does not meet the validation criteria.
Show JSON schema:
{
"$defs": {
"Metadata": {
"additionalProperties": false,
"description": "Key-value metadata for annotating architecture nodes.",
"properties": {
"key": {
"title": "Key",
"type": "string"
},
"value": {
"default": null,
"title": "Value"
},
"units": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Units of measure",
"title": "Units"
},
"uncertainty": {
"anyOf": [
{},
{
"type": "null"
}
],
"default": null,
"description": "Uncertainty value",
"title": "Uncertainty"
},
"lower_bounds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Lower bound",
"title": "Lower Bounds"
},
"upper_bounds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Upper bound",
"title": "Upper Bounds"
}
},
"required": [
"key"
],
"title": "Metadata",
"type": "object"
}
},
"description": "Represents a boolean data type with enhanced attributes for engineering applications.\n\nAttributes:\n value (bool): The actual boolean value.\n units (str): Units of the variable, typically 'unitless' for boolean types.\n description (Optional[str]): A brief description of the variable.\n default (Optional[bool]): Default boolean value of the variable, if any.\n metadata (Metadata): Additional metadata for the variable.\n\nRaises:\n ValidationError: If the input value does not meet the validation criteria.",
"properties": {
"value": {
"description": "The actual boolean value.",
"title": "Value",
"type": "boolean"
},
"units": {
"default": "unitless",
"description": "Units of the variable, typically 'unitless' for boolean types.",
"title": "Units",
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A brief description of the variable.",
"title": "Description"
},
"default": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Default boolean value of the variable, if any.",
"title": "Default"
},
"metadata": {
"anyOf": [
{
"$ref": "#/$defs/Metadata"
},
{
"type": "null"
}
],
"default": null,
"description": "Additional metadata for the variable."
}
},
"required": [
"value"
],
"title": "Boolean",
"type": "object"
}
Fields:
-
value(bool) -
units(str) -
description(Optional[str]) -
default(Optional[bool]) -
metadata(Optional[Metadata])
Validators:
default
pydantic-field
¤
Default boolean value of the variable, if any.
units
pydantic-field
¤
units: str = 'unitless'
Units of the variable, typically 'unitless' for boolean types.
validate_default
pydantic-validator
¤
validate_default(value: Optional[bool], info: ValidationInfo) -> Optional[bool]
Validate and convert the default value to a boolean if it's provided as a string.
Parameters:
-
value(Optional[bool]) –The default value being validated.
-
info(ValidationInfo) –Validation context information for the field being validated.
Returns:
Raises:
-
ValueError–If the default value is a string that cannot be converted to a boolean.
Source code in src/adh/wbs/airframe/airframe_geometry.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
CrossSection
pydantic-model
¤
Bases: BaseModel
Represents a cross-section of a body component at a specific station along its length.
Attributes:
-
station(float) –Normalized station of the cross-section along the body's length.
-
upper_curve(Optional[Spline]) –Spline defining the upper curve of the cross-section.
-
lower_curve(Optional[Spline]) –Spline defining the lower curve of the cross-section.
Raises:
-
ValueError–If neither an upper nor a lower curve spline is provided.
Show JSON schema:
{
"$defs": {
"Point": {
"description": "Represents a point in 3D space, defined by its x, y, and z coordinates.\n\nAttributes:\n x (float): The x-coordinate of the point.\n y (float): The y-coordinate of the point.\n z (float): The z-coordinate of the point.\n\nRaises:\n ValueError: If any coordinate is not a finite number, ensuring points are well-defined in 3D space.",
"properties": {
"x": {
"description": "The x-coordinate of the point.",
"title": "X",
"type": "number"
},
"y": {
"description": "The y-coordinate of the point.",
"title": "Y",
"type": "number"
},
"z": {
"description": "The z-coordinate of the point.",
"title": "Z",
"type": "number"
}
},
"required": [
"x",
"y",
"z"
],
"title": "Point",
"type": "object"
},
"Spline": {
"description": "Represents a spline, which is a smooth curve constructed from a series of control points.\n\nSplines are essential in various applications such as computer graphics, geometric modeling, and trajectory planning.\n\nAttributes:\n points (List[Point]): The list of control points that define the spline. The spline passes through these points.\n degree (int): The degree of the spline curve. Common values are 2 (quadratic) and 3 (cubic).\n\nRaises:\n ValueError: If the number of points is less than the degree + 1, which is necessary for defining a valid spline.",
"properties": {
"points": {
"description": "Control points that define the spline.",
"items": {
"$ref": "#/$defs/Point"
},
"minItems": 2,
"title": "Points",
"type": "array"
},
"degree": {
"default": 3,
"description": "The degree of the spline curve. Commonly 2 (quadratic) or 3 (cubic).",
"exclusiveMinimum": 0,
"title": "Degree",
"type": "integer"
}
},
"required": [
"points"
],
"title": "Spline",
"type": "object"
}
},
"description": "Represents a cross-section of a body component at a specific station along its length.\n\nAttributes:\n station (float): Normalized station of the cross-section along the body's length.\n upper_curve (Optional[Spline]): Spline defining the upper curve of the cross-section.\n lower_curve (Optional[Spline]): Spline defining the lower curve of the cross-section.\n\nRaises:\n ValueError: If neither an upper nor a lower curve spline is provided.",
"properties": {
"station": {
"description": "Normalized station of the cross-section along the body's length.",
"maximum": 1,
"minimum": 0,
"title": "Station",
"type": "number"
},
"upper_curve": {
"anyOf": [
{
"$ref": "#/$defs/Spline"
},
{
"type": "null"
}
],
"default": null,
"description": "Spline defining the upper curve of the cross-section."
},
"lower_curve": {
"anyOf": [
{
"$ref": "#/$defs/Spline"
},
{
"type": "null"
}
],
"default": null,
"description": "Spline defining the lower curve of the cross-section."
}
},
"required": [
"station"
],
"title": "CrossSection",
"type": "object"
}
Fields:
Validators:
lower_curve
pydantic-field
¤
Spline defining the lower curve of the cross-section.
station
pydantic-field
¤
station: float
Normalized station of the cross-section along the body's length.
upper_curve
pydantic-field
¤
Spline defining the upper curve of the cross-section.
validate_curves
pydantic-validator
¤
Validates that at least one of the upper or lower curve splines is provided.
Parameters:
-
values(dict) –Dictionary of field values.
Returns:
-
dict–The validated dictionary of field values.
Raises:
-
ValueError–If neither an upper nor a lower curve spline is provided.
Source code in src/adh/wbs/airframe/airframe_geometry.py
909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 | |
Float
pydantic-model
¤
Bases: BaseModel
Represents a floating-point number with enhanced attributes for engineering applications.
Attributes:
-
value(float) –The actual floating-point value.
-
units(str) –Units of the variable, allowing for dimensional analysis.
-
description(Optional[str]) –A brief description of the variable.
-
default(Optional[float]) –Default floating-point value of the variable, if any.
-
metadata(Metadata) –Additional metadata for the variable.
Raises:
-
ValidationError–If the input value does not meet the validation criteria.
Show JSON schema:
{
"$defs": {
"Metadata": {
"additionalProperties": false,
"description": "Key-value metadata for annotating architecture nodes.",
"properties": {
"key": {
"title": "Key",
"type": "string"
},
"value": {
"default": null,
"title": "Value"
},
"units": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Units of measure",
"title": "Units"
},
"uncertainty": {
"anyOf": [
{},
{
"type": "null"
}
],
"default": null,
"description": "Uncertainty value",
"title": "Uncertainty"
},
"lower_bounds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Lower bound",
"title": "Lower Bounds"
},
"upper_bounds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Upper bound",
"title": "Upper Bounds"
}
},
"required": [
"key"
],
"title": "Metadata",
"type": "object"
}
},
"description": "Represents a floating-point number with enhanced attributes for engineering applications.\n\nAttributes:\n value (float): The actual floating-point value.\n units (str): Units of the variable, allowing for dimensional analysis.\n description (Optional[str]): A brief description of the variable.\n default (Optional[float]): Default floating-point value of the variable, if any.\n metadata (Metadata): Additional metadata for the variable.\n\nRaises:\n ValidationError: If the input value does not meet the validation criteria.",
"properties": {
"value": {
"description": "The actual floating-point value.",
"title": "Value",
"type": "number"
},
"units": {
"default": "unitless",
"description": "Units of the variable.",
"title": "Units",
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A brief description of the variable.",
"title": "Description"
},
"default": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Default floating-point value of the variable, if any.",
"title": "Default"
},
"metadata": {
"anyOf": [
{
"$ref": "#/$defs/Metadata"
},
{
"type": "null"
}
],
"default": null,
"description": "Additional metadata for the variable."
}
},
"required": [
"value"
],
"title": "Float",
"type": "object"
}
Fields:
-
value(float) -
units(str) -
description(Optional[str]) -
default(Optional[float]) -
metadata(Optional[Metadata])
Validators:
default
pydantic-field
¤
Default floating-point value of the variable, if any.
validate_default
pydantic-validator
¤
validate_default(value: Optional[float], info: ValidationInfo) -> Optional[float]
Validate and convert the default value to a float if it's provided as a string.
Parameters:
-
value(Optional[float]) –The default value being validated.
-
info(ValidationInfo) –Validation context information for the field being validated.
Returns:
Raises:
-
ValueError–If the default value is a string that cannot be converted to a float.
Source code in src/adh/wbs/airframe/airframe_geometry.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
Integer
pydantic-model
¤
Bases: BaseModel
Represents an integer data type with enhanced attributes for engineering applications.
Attributes:
-
value(int) –The actual integer value.
-
units(str) –Units of the variable, allowing for dimensional analysis.
-
description(Optional[str]) –A brief description of the variable.
-
default(Optional[int]) –Default integer value of the variable, if any.
-
metadata(Optional[Metadata]) –Optional[Metadata]): Additional metadata for the variable.
Raises:
-
ValidationError–If the input value does not meet the validation criteria.
Show JSON schema:
{
"$defs": {
"Metadata": {
"additionalProperties": false,
"description": "Key-value metadata for annotating architecture nodes.",
"properties": {
"key": {
"title": "Key",
"type": "string"
},
"value": {
"default": null,
"title": "Value"
},
"units": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Units of measure",
"title": "Units"
},
"uncertainty": {
"anyOf": [
{},
{
"type": "null"
}
],
"default": null,
"description": "Uncertainty value",
"title": "Uncertainty"
},
"lower_bounds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Lower bound",
"title": "Lower Bounds"
},
"upper_bounds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Upper bound",
"title": "Upper Bounds"
}
},
"required": [
"key"
],
"title": "Metadata",
"type": "object"
}
},
"description": "Represents an integer data type with enhanced attributes for engineering applications.\n\nAttributes:\n value (int): The actual integer value.\n units (str): Units of the variable, allowing for dimensional analysis.\n description (Optional[str]): A brief description of the variable.\n default (Optional[int]): Default integer value of the variable, if any.\n metadata: Optional[Metadata]): Additional metadata for the variable.\n\nRaises:\n ValidationError: If the input value does not meet the validation criteria.",
"properties": {
"value": {
"description": "The actual integer value.",
"title": "Value",
"type": "integer"
},
"units": {
"default": "unitless",
"description": "Units of the variable.",
"title": "Units",
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A brief description of the variable.",
"title": "Description"
},
"default": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Default integer value of the variable, if any.",
"title": "Default"
},
"metadata": {
"anyOf": [
{
"$ref": "#/$defs/Metadata"
},
{
"type": "null"
}
],
"default": null,
"description": "Additional metadata for the variable."
}
},
"required": [
"value"
],
"title": "Integer",
"type": "object"
}
Fields:
-
value(int) -
units(str) -
description(Optional[str]) -
default(Optional[int]) -
metadata(Optional[Metadata])
Validators:
default
pydantic-field
¤
Default integer value of the variable, if any.
validate_default
pydantic-validator
¤
validate_default(value: Optional[int], info: ValidationInfo) -> Optional[int]
Validate and convert the default value to an integer if it's provided as a string.
Parameters:
-
value(Optional[int]) –The default value being validated.
-
info(ValidationInfo) –Validation context information for the field being validated.
Returns:
Raises:
-
ValueError–If the default value is a string that cannot be converted to an integer.
Source code in src/adh/wbs/airframe/airframe_geometry.py
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
LiftingSurface
pydantic-model
¤
Bases: BaseModel
Represents the geometric characteristics of a lifting surface, such as wings and tail surfaces of aircraft.
Attributes:
-
leading_edge_spline(Optional[Spline]) –Spline defining the leading edge of the lifting surface.
-
trailing_edge_spline(Optional[Spline]) –Spline defining the trailing edge of the lifting surface.
-
airfoil_sections(List[Airfoil]) –List of Airfoil objects representing the airfoil shapes along the span.
Raises:
-
ValueError–If the list of airfoil sections is empty.
Show JSON schema:
{
"$defs": {
"Airfoil": {
"description": "Represents an airfoil section, a fundamental component in aircraft design for wings and control surfaces.\n\nAttributes:\n spline (Optional[Spline]): A spline defining the contour of the airfoil section.\n\nRaises:\n ValueError: If the spline is not provided.",
"properties": {
"spline": {
"anyOf": [
{
"$ref": "#/$defs/Spline"
},
{
"type": "null"
}
],
"default": null,
"description": "A spline defining the contour of the airfoil section."
}
},
"title": "Airfoil",
"type": "object"
},
"Point": {
"description": "Represents a point in 3D space, defined by its x, y, and z coordinates.\n\nAttributes:\n x (float): The x-coordinate of the point.\n y (float): The y-coordinate of the point.\n z (float): The z-coordinate of the point.\n\nRaises:\n ValueError: If any coordinate is not a finite number, ensuring points are well-defined in 3D space.",
"properties": {
"x": {
"description": "The x-coordinate of the point.",
"title": "X",
"type": "number"
},
"y": {
"description": "The y-coordinate of the point.",
"title": "Y",
"type": "number"
},
"z": {
"description": "The z-coordinate of the point.",
"title": "Z",
"type": "number"
}
},
"required": [
"x",
"y",
"z"
],
"title": "Point",
"type": "object"
},
"Spline": {
"description": "Represents a spline, which is a smooth curve constructed from a series of control points.\n\nSplines are essential in various applications such as computer graphics, geometric modeling, and trajectory planning.\n\nAttributes:\n points (List[Point]): The list of control points that define the spline. The spline passes through these points.\n degree (int): The degree of the spline curve. Common values are 2 (quadratic) and 3 (cubic).\n\nRaises:\n ValueError: If the number of points is less than the degree + 1, which is necessary for defining a valid spline.",
"properties": {
"points": {
"description": "Control points that define the spline.",
"items": {
"$ref": "#/$defs/Point"
},
"minItems": 2,
"title": "Points",
"type": "array"
},
"degree": {
"default": 3,
"description": "The degree of the spline curve. Commonly 2 (quadratic) or 3 (cubic).",
"exclusiveMinimum": 0,
"title": "Degree",
"type": "integer"
}
},
"required": [
"points"
],
"title": "Spline",
"type": "object"
}
},
"description": "Represents the geometric characteristics of a lifting surface, such as wings and tail surfaces of aircraft.\n\nAttributes:\n leading_edge_spline (Optional[Spline]): Spline defining the leading edge of the lifting surface.\n trailing_edge_spline (Optional[Spline]): Spline defining the trailing edge of the lifting surface.\n airfoil_sections (List[Airfoil]): List of Airfoil objects representing the airfoil shapes along the span.\n\nRaises:\n ValueError: If the list of airfoil sections is empty.",
"properties": {
"leading_edge_spline": {
"anyOf": [
{
"$ref": "#/$defs/Spline"
},
{
"type": "null"
}
],
"default": null,
"description": "Spline defining the leading edge of the lifting surface."
},
"trailing_edge_spline": {
"anyOf": [
{
"$ref": "#/$defs/Spline"
},
{
"type": "null"
}
],
"default": null,
"description": "Spline defining the trailing edge of the lifting surface."
},
"airfoil_sections": {
"description": "List of Airfoil objects representing the airfoil shapes along the span.",
"items": {
"$ref": "#/$defs/Airfoil"
},
"title": "Airfoil Sections",
"type": "array"
}
},
"required": [
"airfoil_sections"
],
"title": "LiftingSurface",
"type": "object"
}
Fields:
-
leading_edge_spline(Optional[Spline]) -
trailing_edge_spline(Optional[Spline]) -
airfoil_sections(list[Airfoil])
Validators:
airfoil_sections
pydantic-field
¤
List of Airfoil objects representing the airfoil shapes along the span.
leading_edge_spline
pydantic-field
¤
Spline defining the leading edge of the lifting surface.
trailing_edge_spline
pydantic-field
¤
Spline defining the trailing edge of the lifting surface.
validate_airfoil_sections
pydantic-validator
¤
Ensures that at least one Airfoil object is provided.
Parameters:
Returns:
Raises:
-
ValueError–If the list is empty.
Source code in src/adh/wbs/airframe/airframe_geometry.py
860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 | |
Loft
pydantic-model
¤
Bases: BaseModel
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.
Attributes:
-
splines(List[Spline]) –A series of splines defining the shapes to interpolate for the loft.
-
num_samples(int) –The number of sample points to generate along each spline.
-
metadata(Metadata) –Additional metadata for the loft.
Show JSON schema:
{
"$defs": {
"Metadata": {
"additionalProperties": false,
"description": "Key-value metadata for annotating architecture nodes.",
"properties": {
"key": {
"title": "Key",
"type": "string"
},
"value": {
"default": null,
"title": "Value"
},
"units": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Units of measure",
"title": "Units"
},
"uncertainty": {
"anyOf": [
{},
{
"type": "null"
}
],
"default": null,
"description": "Uncertainty value",
"title": "Uncertainty"
},
"lower_bounds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Lower bound",
"title": "Lower Bounds"
},
"upper_bounds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Upper bound",
"title": "Upper Bounds"
}
},
"required": [
"key"
],
"title": "Metadata",
"type": "object"
},
"Point": {
"description": "Represents a point in 3D space, defined by its x, y, and z coordinates.\n\nAttributes:\n x (float): The x-coordinate of the point.\n y (float): The y-coordinate of the point.\n z (float): The z-coordinate of the point.\n\nRaises:\n ValueError: If any coordinate is not a finite number, ensuring points are well-defined in 3D space.",
"properties": {
"x": {
"description": "The x-coordinate of the point.",
"title": "X",
"type": "number"
},
"y": {
"description": "The y-coordinate of the point.",
"title": "Y",
"type": "number"
},
"z": {
"description": "The z-coordinate of the point.",
"title": "Z",
"type": "number"
}
},
"required": [
"x",
"y",
"z"
],
"title": "Point",
"type": "object"
},
"Spline": {
"description": "Represents a spline, which is a smooth curve constructed from a series of control points.\n\nSplines are essential in various applications such as computer graphics, geometric modeling, and trajectory planning.\n\nAttributes:\n points (List[Point]): The list of control points that define the spline. The spline passes through these points.\n degree (int): The degree of the spline curve. Common values are 2 (quadratic) and 3 (cubic).\n\nRaises:\n ValueError: If the number of points is less than the degree + 1, which is necessary for defining a valid spline.",
"properties": {
"points": {
"description": "Control points that define the spline.",
"items": {
"$ref": "#/$defs/Point"
},
"minItems": 2,
"title": "Points",
"type": "array"
},
"degree": {
"default": 3,
"description": "The degree of the spline curve. Commonly 2 (quadratic) or 3 (cubic).",
"exclusiveMinimum": 0,
"title": "Degree",
"type": "integer"
}
},
"required": [
"points"
],
"title": "Spline",
"type": "object"
}
},
"description": "Represents a lofted surface, a smooth spatial surface generated by transitioning between multiple spline curves.\n\nIn engineering and design, lofts are used to create complex shapes by smoothly connecting a series of cross-sectional\nprofiles. This class enables the representation of lofted surfaces, facilitating their use in computational modeling,\nsimulation, and visualization of aerodynamic shapes, product designs, and more.\n\nAttributes:\n splines (List[Spline]): A series of splines defining the shapes to interpolate for the loft.\n num_samples (int): The number of sample points to generate along each spline.\n metadata (Metadata): Additional metadata for the loft.",
"properties": {
"splines": {
"description": "A series of splines defining the shapes to interpolate for the loft.",
"items": {
"$ref": "#/$defs/Spline"
},
"title": "Splines",
"type": "array"
},
"num_samples": {
"default": 100,
"description": "The number of sample points to generate along each spline.",
"title": "Num Samples",
"type": "integer"
},
"metadata": {
"anyOf": [
{
"$ref": "#/$defs/Metadata"
},
{
"type": "null"
}
],
"default": null,
"description": "Additional metadata for the loft."
}
},
"required": [
"splines"
],
"title": "Loft",
"type": "object"
}
Fields:
Validators:
num_samples
pydantic-field
¤
num_samples: int = 100
The number of sample points to generate along each spline.
splines
pydantic-field
¤
A series of splines defining the shapes to interpolate for the loft.
add_spline
¤
add_spline(spline: Spline) -> None
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.
Source code in src/adh/wbs/airframe/airframe_geometry.py
629 630 631 632 633 634 635 | |
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:
-
list[list[float]]–A list of lists representing the lofted surface points, where each inner list represents a point
-
list[list[float]]–on the surface with [x, y, z] coordinates.
Source code in src/adh/wbs/airframe/airframe_geometry.py
637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 | |
validate_num_samples
pydantic-validator
¤
Validate the 'num_samples' field to ensure it is a positive integer.
Parameters:
-
value(int) –The number of samples being validated.
Returns:
-
int–The validated number of samples.
Raises:
-
ValueError–If the number of samples is not a positive integer.
Source code in src/adh/wbs/airframe/airframe_geometry.py
612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 | |
validate_splines
pydantic-validator
¤
Validate the 'splines' list to ensure it contains at least two splines with the same degree.
Parameters:
Returns:
Raises:
-
ValueError–If the list contains fewer than two splines or if the splines have different degrees.
Source code in src/adh/wbs/airframe/airframe_geometry.py
590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 | |
Mesh
pydantic-model
¤
Bases: BaseModel
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.
Attributes:
-
polylines(List[Polyline]) –A collection of polylines defining the mesh.
-
metadata(Metadata) –Additional metadata for the mesh.
Show JSON schema:
{
"$defs": {
"Metadata": {
"additionalProperties": false,
"description": "Key-value metadata for annotating architecture nodes.",
"properties": {
"key": {
"title": "Key",
"type": "string"
},
"value": {
"default": null,
"title": "Value"
},
"units": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Units of measure",
"title": "Units"
},
"uncertainty": {
"anyOf": [
{},
{
"type": "null"
}
],
"default": null,
"description": "Uncertainty value",
"title": "Uncertainty"
},
"lower_bounds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Lower bound",
"title": "Lower Bounds"
},
"upper_bounds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Upper bound",
"title": "Upper Bounds"
}
},
"required": [
"key"
],
"title": "Metadata",
"type": "object"
},
"Point": {
"description": "Represents a point in 3D space, defined by its x, y, and z coordinates.\n\nAttributes:\n x (float): The x-coordinate of the point.\n y (float): The y-coordinate of the point.\n z (float): The z-coordinate of the point.\n\nRaises:\n ValueError: If any coordinate is not a finite number, ensuring points are well-defined in 3D space.",
"properties": {
"x": {
"description": "The x-coordinate of the point.",
"title": "X",
"type": "number"
},
"y": {
"description": "The y-coordinate of the point.",
"title": "Y",
"type": "number"
},
"z": {
"description": "The z-coordinate of the point.",
"title": "Z",
"type": "number"
}
},
"required": [
"x",
"y",
"z"
],
"title": "Point",
"type": "object"
},
"Polyline": {
"description": "Represents a polyline, a series of connected 3D points forming a continuous line or path.\n\nUseful in geometric modeling and spatial analysis, the Polyline class enables the representation\nof linear paths, edges, or trajectories in three-dimensional space, facilitating calculations and\nvisualizations related to lines.\n\nAttributes:\n points (List[Point]): A series of 3D points defining the polyline.\n metadata (Metadata): Additional metadata for the polyline.",
"properties": {
"points": {
"description": "A series of 3D points defining the polyline.",
"items": {
"$ref": "#/$defs/Point"
},
"title": "Points",
"type": "array"
},
"metadata": {
"anyOf": [
{
"$ref": "#/$defs/Metadata"
},
{
"type": "null"
}
],
"default": null,
"description": "Additional metadata for the polyline."
}
},
"required": [
"points"
],
"title": "Polyline",
"type": "object"
}
},
"description": "Represents a 3D mesh, a collection of polygons (typically triangles or quadrilaterals) used to model the surface of a 3D object.\n\nMeshes are fundamental in computer graphics, engineering simulations, and geometric modeling, allowing for the detailed\nrepresentation of complex 3D shapes. This class facilitates the construction, manipulation, and analysis of mesh geometries,\nsupporting applications in visualization, physical simulation, and more.\n\nAttributes:\n polylines (List[Polyline]): A collection of polylines defining the mesh.\n metadata (Metadata): Additional metadata for the mesh.",
"properties": {
"polylines": {
"description": "A collection of polylines defining the mesh.",
"items": {
"$ref": "#/$defs/Polyline"
},
"title": "Polylines",
"type": "array"
},
"metadata": {
"anyOf": [
{
"$ref": "#/$defs/Metadata"
},
{
"type": "null"
}
],
"default": null,
"description": "Additional metadata for the mesh."
}
},
"required": [
"polylines"
],
"title": "Mesh",
"type": "object"
}
Fields:
Validators:
add_polyline
¤
add_polyline(polyline: Polyline) -> None
Add a new polyline object to the mesh, expanding its geometry.
Parameters:
-
polyline(Polyline) –The new polyline to be added to the mesh.
Source code in src/adh/wbs/airframe/airframe_geometry.py
461 462 463 464 465 466 467 | |
calculate_volume
¤
calculate_volume() -> float
Calculate the volume enclosed by the mesh.
This method uses the tetrahedron decomposition algorithm to compute the volume enclosed by the mesh geometry.
Returns:
-
float–The calculated volume of the mesh.
Source code in src/adh/wbs/airframe/airframe_geometry.py
520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 | |
remove_polyline
¤
remove_polyline(index: int) -> None
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.
Source code in src/adh/wbs/airframe/airframe_geometry.py
469 470 471 472 473 474 475 476 477 478 479 480 | |
validate_polylines
pydantic-validator
¤
Validate the 'polylines' list to ensure it contains at least one polyline.
Parameters:
Returns:
Raises:
-
ValueError–If the list is empty.
Source code in src/adh/wbs/airframe/airframe_geometry.py
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 | |
Point
pydantic-model
¤
Bases: BaseModel
Represents a point in 3D space, defined by its x, y, and z coordinates.
Attributes:
-
x(float) –The x-coordinate of the point.
-
y(float) –The y-coordinate of the point.
-
z(float) –The z-coordinate of the point.
Raises:
-
ValueError–If any coordinate is not a finite number, ensuring points are well-defined in 3D space.
Show JSON schema:
{
"description": "Represents a point in 3D space, defined by its x, y, and z coordinates.\n\nAttributes:\n x (float): The x-coordinate of the point.\n y (float): The y-coordinate of the point.\n z (float): The z-coordinate of the point.\n\nRaises:\n ValueError: If any coordinate is not a finite number, ensuring points are well-defined in 3D space.",
"properties": {
"x": {
"description": "The x-coordinate of the point.",
"title": "X",
"type": "number"
},
"y": {
"description": "The y-coordinate of the point.",
"title": "Y",
"type": "number"
},
"z": {
"description": "The z-coordinate of the point.",
"title": "Z",
"type": "number"
}
},
"required": [
"x",
"y",
"z"
],
"title": "Point",
"type": "object"
}
Fields:
Validators:
-
validate_coordinate→x,y,z
coordinates
property
¤
Return the coordinates as a tuple (x, y, z).
__hash__
¤
__hash__()
Return the hash value of the Point object.
Source code in src/adh/wbs/airframe/airframe_geometry.py
257 258 259 | |
distance_to
¤
Calculate the Euclidean distance between this point and another point.
Parameters:
-
other(Point) –The other point to calculate the distance to.
Returns:
-
float–The Euclidean distance between the two points.
Source code in src/adh/wbs/airframe/airframe_geometry.py
244 245 246 247 248 249 250 251 252 253 254 255 | |
validate_coordinate
pydantic-validator
¤
Validate that the coordinate is a finite number, ensuring the point is well-defined.
Parameters:
-
value(float) –The coordinate value to validate.
Returns:
-
float–The validated coordinate value.
Raises:
-
ValueError–If the coordinate is not a finite number.
Source code in src/adh/wbs/airframe/airframe_geometry.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
Polyline
pydantic-model
¤
Bases: BaseModel
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.
Attributes:
-
points(List[Point]) –A series of 3D points defining the polyline.
-
metadata(Metadata) –Additional metadata for the polyline.
Show JSON schema:
{
"$defs": {
"Metadata": {
"additionalProperties": false,
"description": "Key-value metadata for annotating architecture nodes.",
"properties": {
"key": {
"title": "Key",
"type": "string"
},
"value": {
"default": null,
"title": "Value"
},
"units": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Units of measure",
"title": "Units"
},
"uncertainty": {
"anyOf": [
{},
{
"type": "null"
}
],
"default": null,
"description": "Uncertainty value",
"title": "Uncertainty"
},
"lower_bounds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Lower bound",
"title": "Lower Bounds"
},
"upper_bounds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Upper bound",
"title": "Upper Bounds"
}
},
"required": [
"key"
],
"title": "Metadata",
"type": "object"
},
"Point": {
"description": "Represents a point in 3D space, defined by its x, y, and z coordinates.\n\nAttributes:\n x (float): The x-coordinate of the point.\n y (float): The y-coordinate of the point.\n z (float): The z-coordinate of the point.\n\nRaises:\n ValueError: If any coordinate is not a finite number, ensuring points are well-defined in 3D space.",
"properties": {
"x": {
"description": "The x-coordinate of the point.",
"title": "X",
"type": "number"
},
"y": {
"description": "The y-coordinate of the point.",
"title": "Y",
"type": "number"
},
"z": {
"description": "The z-coordinate of the point.",
"title": "Z",
"type": "number"
}
},
"required": [
"x",
"y",
"z"
],
"title": "Point",
"type": "object"
}
},
"description": "Represents a polyline, a series of connected 3D points forming a continuous line or path.\n\nUseful in geometric modeling and spatial analysis, the Polyline class enables the representation\nof linear paths, edges, or trajectories in three-dimensional space, facilitating calculations and\nvisualizations related to lines.\n\nAttributes:\n points (List[Point]): A series of 3D points defining the polyline.\n metadata (Metadata): Additional metadata for the polyline.",
"properties": {
"points": {
"description": "A series of 3D points defining the polyline.",
"items": {
"$ref": "#/$defs/Point"
},
"title": "Points",
"type": "array"
},
"metadata": {
"anyOf": [
{
"$ref": "#/$defs/Metadata"
},
{
"type": "null"
}
],
"default": null,
"description": "Additional metadata for the polyline."
}
},
"required": [
"points"
],
"title": "Polyline",
"type": "object"
}
Fields:
Validators:
add_point
¤
add_point(point: Point) -> None
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.
Source code in src/adh/wbs/airframe/airframe_geometry.py
298 299 300 301 302 303 304 | |
length
¤
length() -> float
Calculate the total length of the polyline by summing the distances between consecutive points.
Returns:
-
float–The total length of the polyline.
Source code in src/adh/wbs/airframe/airframe_geometry.py
306 307 308 309 310 311 312 313 314 315 | |
simplify
¤
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:
-
Polyline–A new simplified polyline with redundant points removed.
Source code in src/adh/wbs/airframe/airframe_geometry.py
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | |
validate_points
pydantic-validator
¤
Validate the 'points' list to ensure it contains at least two points.
Parameters:
Returns:
Raises:
-
ValueError–If the list contains fewer than two points.
Source code in src/adh/wbs/airframe/airframe_geometry.py
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | |
ReferenceAxis
pydantic-model
¤
ReferenceAxis(**data: Any)
Bases: BaseModel
Represents the reference axis of a body component, such as an aircraft fuselage or wing.
Attributes:
-
name(str) –The name of the reference axis.
-
points(List[Point]) –A series of 3D points defining the reference axis.
-
description(Optional[str]) –A brief description of the reference axis.
-
metadata(Metadata) –Additional metadata for the reference axis.
-
relative_to(Optional[str]) –The name of another reference axis to which this axis is relative.
Show JSON schema:
{
"$defs": {
"Metadata": {
"additionalProperties": false,
"description": "Key-value metadata for annotating architecture nodes.",
"properties": {
"key": {
"title": "Key",
"type": "string"
},
"value": {
"default": null,
"title": "Value"
},
"units": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Units of measure",
"title": "Units"
},
"uncertainty": {
"anyOf": [
{},
{
"type": "null"
}
],
"default": null,
"description": "Uncertainty value",
"title": "Uncertainty"
},
"lower_bounds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Lower bound",
"title": "Lower Bounds"
},
"upper_bounds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Upper bound",
"title": "Upper Bounds"
}
},
"required": [
"key"
],
"title": "Metadata",
"type": "object"
},
"Point": {
"description": "Represents a point in 3D space, defined by its x, y, and z coordinates.\n\nAttributes:\n x (float): The x-coordinate of the point.\n y (float): The y-coordinate of the point.\n z (float): The z-coordinate of the point.\n\nRaises:\n ValueError: If any coordinate is not a finite number, ensuring points are well-defined in 3D space.",
"properties": {
"x": {
"description": "The x-coordinate of the point.",
"title": "X",
"type": "number"
},
"y": {
"description": "The y-coordinate of the point.",
"title": "Y",
"type": "number"
},
"z": {
"description": "The z-coordinate of the point.",
"title": "Z",
"type": "number"
}
},
"required": [
"x",
"y",
"z"
],
"title": "Point",
"type": "object"
},
"ReferenceAxis": {
"description": "Represents the reference axis of a body component, such as an aircraft fuselage or wing.\n\nAttributes:\n name (str): The name of the reference axis.\n points (List[Point]): A series of 3D points defining the reference axis.\n description (Optional[str]): A brief description of the reference axis.\n metadata (Metadata): Additional metadata for the reference axis.\n relative_to (Optional[str]): The name of another reference axis to which this axis is relative.",
"properties": {
"name": {
"description": "The name of the reference axis.",
"title": "Name",
"type": "string"
},
"points": {
"description": "A series of 3D points defining the reference axis.",
"items": {
"$ref": "#/$defs/Point"
},
"title": "Points",
"type": "array"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A brief description of the reference axis.",
"title": "Description"
},
"metadata": {
"anyOf": [
{
"$ref": "#/$defs/Metadata"
},
{
"type": "null"
}
],
"default": null,
"description": "Additional metadata for the reference axis."
},
"relative_to": {
"anyOf": [
{
"$ref": "#/$defs/ReferenceAxis"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name or instance of another reference axis to which this axis is relative.",
"title": "Relative To"
}
},
"required": [
"name",
"points"
],
"title": "ReferenceAxis",
"type": "object"
}
},
"$ref": "#/$defs/ReferenceAxis"
}
Fields:
-
name(str) -
points(list[Point]) -
description(Optional[str]) -
metadata(Optional[Metadata]) -
relative_to(Optional[Union[ReferenceAxis, str]]) -
_registry(dict[str, ReferenceAxis])
Validators:
Source code in src/adh/wbs/airframe/airframe_geometry.py
828 829 830 831 | |
description
pydantic-field
¤
A brief description of the reference axis.
metadata
pydantic-field
¤
Additional metadata for the reference axis.
relative_to
pydantic-field
¤
relative_to: Optional[Union[ReferenceAxis, str]] = None
The name or instance of another reference axis to which this axis is relative.
resolve_relative_to
pydantic-validator
¤
resolve_relative_to() -> ReferenceAxis
Resolve the 'relative_to' name to a ReferenceAxis instance.
Parameters:
-
self(ReferenceAxis) –The validated ReferenceAxis instance.
Returns:
-
ReferenceAxis–The validated dictionary of field values.
Raises:
-
ValueError–If the 'relative_to' name does not exist.
Source code in src/adh/wbs/airframe/airframe_geometry.py
804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 | |
validate_and_register
pydantic-validator
¤
Ensure that the name is unique and register the instance.
Parameters:
Returns:
Raises:
-
ValueError–If the name is not unique.
Source code in src/adh/wbs/airframe/airframe_geometry.py
785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 | |
validate_points
pydantic-validator
¤
Validate the 'points' list to ensure it contains at least two points.
Parameters:
Returns:
Raises:
-
ValueError–If the list contains fewer than two points.
Source code in src/adh/wbs/airframe/airframe_geometry.py
768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 | |
Spline
pydantic-model
¤
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.
Attributes:
-
points(List[Point]) –The list of control points that define the spline. The spline passes through these points.
-
degree(int) –The degree of the spline curve. Common values are 2 (quadratic) and 3 (cubic).
Raises:
-
ValueError–If the number of points is less than the degree + 1, which is necessary for defining a valid spline.
Show JSON schema:
{
"$defs": {
"Point": {
"description": "Represents a point in 3D space, defined by its x, y, and z coordinates.\n\nAttributes:\n x (float): The x-coordinate of the point.\n y (float): The y-coordinate of the point.\n z (float): The z-coordinate of the point.\n\nRaises:\n ValueError: If any coordinate is not a finite number, ensuring points are well-defined in 3D space.",
"properties": {
"x": {
"description": "The x-coordinate of the point.",
"title": "X",
"type": "number"
},
"y": {
"description": "The y-coordinate of the point.",
"title": "Y",
"type": "number"
},
"z": {
"description": "The z-coordinate of the point.",
"title": "Z",
"type": "number"
}
},
"required": [
"x",
"y",
"z"
],
"title": "Point",
"type": "object"
}
},
"description": "Represents a spline, which is a smooth curve constructed from a series of control points.\n\nSplines are essential in various applications such as computer graphics, geometric modeling, and trajectory planning.\n\nAttributes:\n points (List[Point]): The list of control points that define the spline. The spline passes through these points.\n degree (int): The degree of the spline curve. Common values are 2 (quadratic) and 3 (cubic).\n\nRaises:\n ValueError: If the number of points is less than the degree + 1, which is necessary for defining a valid spline.",
"properties": {
"points": {
"description": "Control points that define the spline.",
"items": {
"$ref": "#/$defs/Point"
},
"minItems": 2,
"title": "Points",
"type": "array"
},
"degree": {
"default": 3,
"description": "The degree of the spline curve. Commonly 2 (quadratic) or 3 (cubic).",
"exclusiveMinimum": 0,
"title": "Degree",
"type": "integer"
}
},
"required": [
"points"
],
"title": "Spline",
"type": "object"
}
Fields:
Validators:
degree
pydantic-field
¤
degree: int = 3
The degree of the spline curve. Commonly 2 (quadratic) or 3 (cubic).
validate_degree
pydantic-validator
¤
Validate that the degree of the spline is a positive integer.
Parameters:
-
value(int) –The degree of the spline.
Returns:
-
int–The validated degree of the spline.
Raises:
-
ValueError–If the degree is not a positive integer.
Source code in src/adh/wbs/airframe/airframe_geometry.py
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | |
validate_points
pydantic-validator
¤
validate_points(value: list[Point], info: ValidationInfo) -> list[Point]
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.
-
info(ValidationInfo) –Validation context information for the field being validated.
Returns:
Raises:
-
ValueError–If the number of points is less than the required for the spline's degree.
Source code in src/adh/wbs/airframe/airframe_geometry.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 | |
String
pydantic-model
¤
Bases: BaseModel
Represents a string data type with enhanced attributes for engineering applications.
Attributes:
-
value(str) –The actual string value. It must have at least 1 character.
-
default(Optional[str]) –A default value for the variable, if any. Defaults to None.
-
metadata(Metadata) –Additional metadata providing further context or details about the variable. Defaults to a new instance of Metadata.
Raises:
-
ValidationError–If the input value does not meet the validation criteria.
Show JSON schema:
{
"$defs": {
"Metadata": {
"additionalProperties": false,
"description": "Key-value metadata for annotating architecture nodes.",
"properties": {
"key": {
"title": "Key",
"type": "string"
},
"value": {
"default": null,
"title": "Value"
},
"units": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Units of measure",
"title": "Units"
},
"uncertainty": {
"anyOf": [
{},
{
"type": "null"
}
],
"default": null,
"description": "Uncertainty value",
"title": "Uncertainty"
},
"lower_bounds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Lower bound",
"title": "Lower Bounds"
},
"upper_bounds": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Upper bound",
"title": "Upper Bounds"
}
},
"required": [
"key"
],
"title": "Metadata",
"type": "object"
}
},
"description": "Represents a string data type with enhanced attributes for engineering applications.\n\nAttributes:\n value (str): The actual string value. It must have at least 1 character.\n default (Optional[str]): A default value for the variable, if any. Defaults to None.\n metadata (Metadata): Additional metadata providing further context or details about the variable.\n Defaults to a new instance of Metadata.\n\nRaises:\n ValidationError: If the input value does not meet the validation criteria.",
"properties": {
"value": {
"description": "The actual string value.",
"minLength": 1,
"title": "Value",
"type": "string"
},
"default": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A default value for the variable, if any.",
"title": "Default"
},
"metadata": {
"anyOf": [
{
"$ref": "#/$defs/Metadata"
},
{
"type": "null"
}
],
"default": null,
"description": "Additional metadata providing further context or details about the variable."
}
},
"required": [
"value"
],
"title": "String",
"type": "object"
}
Fields: