releso.spline.NURBSDefinition
- class releso.spline.NURBSDefinition(*, save_location: Path, logger_name: str | None = None, control_points: List[List[VariableLocation]] | None = None, space_dimensions: List[SplineSpaceDimension], weights: List[float | VariableLocation])
Bases:
SplineDefinitionDefinition of a NURBS spline.
Definition of the NURBS implementation of the ReLeSO Toolbox, in comparison to the B-Spline implementation only an additional weights vector is added.
- __init__(**data: Any) None
Constructor for the ReLeSO basemodel object.
Methods
convert_all_control_point_locations_to_variable_locations(v, ...)Validator control_points.
convert_to_pathlib_add_datetime(v)Add timestamp to save_location, of applicable.
convert_weights_into_variable_location(v, values)Validator for variable weights.
draw_action_space([save_location, no_axis, ...])Draw the action space of the defined shape as a matplotlib figure.
Extends the control point actions with the weight actions.
get_logger()Gets the currently defined environment logger.
get_number_of_points()Returns the number of points in the Spline.
Returns the current positions of all control points with weights as well.
Creates a NURBSSpline from the definition given by the json file.
Returns the weights of the NURBS spline.
make_default_control_point_grid(values)Validator for control_point_variables.
reset()Resets the spline to the original shape.
set_logger_name_recursively(logger_name)Set the logger_name variable for all child elements.
Attributes
weights for the NURBS Spline definition.
space_dimensionsDefinition of the space dimensions of the spline
control_pointscontrol points of the spline.
save_locationDefinition of the save location of the logs and validation results.
logger_namename of the logger.
- classmethod convert_weights_into_variable_location(v: float | VariableLocation, values: Dict[str, Any]) VariableLocation
Validator for variable weights.
Convert all float values in the weight vector into VariableLocations. So that these can also be used as actions.
- Parameters:
v (List[Union[float, VariableLocation]]) – Value to validate
values (Dict[str, Any]) – Previously validated variables
- Returns:
Filled weight vector.
- Return type:
List[VariableLocation]
- get_actions() List[VariableLocation]
Extends the control point actions with the weight actions.
- Returns:
List of possible actions for this NURBS spline.
- Return type:
List[VariableLocation]
- get_parameter_values() List[List[float]]
Returns the current positions of all control points with weights as well.
- Returns:
Positions of all control points.
- Return type:
List[List[float]]
- get_shape() splinepy.NURBS
Creates a NURBSSpline from the definition given by the json file.
- Returns:
NURBSSpline
- Return type:
NURBS
- get_weights() List[float]
Returns the weights of the NURBS spline.
- Returns:
List of weights.
- Return type:
List[float]
- reset() None
Resets the spline to the original shape.
- weights: List[float | VariableLocation]
weights for the NURBS Spline definition. Other parameters are part of the spline definition class. Can be fixed or changeable