Loft
- 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
Attributes Summary
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Methods Summary
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.
validate_num_samples
(value)Validate the 'num_samples' field to ensure it is a positive integer.
validate_splines
(value)Validate the 'splines' list to ensure it contains at least two splines with the same degree.
Attributes Documentation
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'protected_namespaces': (), 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Methods Documentation
- 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]]
- 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
- classmethod validate_splines(value)
Validate the ‘splines’ list to ensure it contains at least two splines with the same degree.
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__