otaf package
Subpackages
- otaf.assembly_modeling package
- Submodules
- otaf.assembly_modeling.assemblyDataProcessor module
AssemblyDataProcessor
AssemblyDataProcessor.system_data
AssemblyDataProcessor.compatibility_loops_expanded
AssemblyDataProcessor.__getitem__()
AssemblyDataProcessor.__repr__()
AssemblyDataProcessor.__setitem__()
AssemblyDataProcessor.add_surface_points()
AssemblyDataProcessor.generate_expanded_loops()
AssemblyDataProcessor.generate_functional_planes()
AssemblyDataProcessor.generate_points_for_surface()
AssemblyDataProcessor.generate_sphere_clouds()
AssemblyDataProcessor.get_notebook_scene_sphere_clouds()
AssemblyDataProcessor.get_surface_points()
AssemblyDataProcessor.validate_point_dict()
AssemblyDataProcessor.validate_system_data_structure()
- otaf.assembly_modeling.assemblyModelingBaseObjects module
- otaf.assembly_modeling.compatibilityLoopHandling module
CompatibilityLoopHandling
CompatibilityLoopHandling.ADP
CompatibilityLoopHandling._deviation_matrix_map
CompatibilityLoopHandling._gap_matrix_map
CompatibilityLoopHandling._transformation_matrix_map
CompatibilityLoopHandling.compatibility_loops_matrices
CompatibilityLoopHandling.compatibility_loops_FO_matrices
CompatibilityLoopHandling.compatibility_expressions
CompatibilityLoopHandling.__init__()
CompatibilityLoopHandling.get_gap_matrix_by_id()
CompatibilityLoopHandling.get_deviation_matrix_by_id()
CompatibilityLoopHandling.get_compatibility_expression_from_FO_matrices()
CompatibilityLoopHandling.generate_loop_id_to_matrix_list_dict()
CompatibilityLoopHandling.generate_FO_loop_matrices()
CompatibilityLoopHandling.apply_FO_matrix_expansion_to_matrix_loop_list()
CompatibilityLoopHandling.generate_matrices_from_expanded_loop()
CompatibilityLoopHandling.generate_transformation_matrix()
CompatibilityLoopHandling.generate_deviation_matrix()
CompatibilityLoopHandling.generate_gap_matrix()
CompatibilityLoopHandling.calculate_nominal_gap_transform()
CompatibilityLoopHandling.apply_FO_matrix_expansion_to_matrix_loop_list()
CompatibilityLoopHandling.calculate_nominal_gap_transform()
CompatibilityLoopHandling.generate_FO_loop_matrices()
CompatibilityLoopHandling.generate_deviation_matrix()
CompatibilityLoopHandling.generate_gap_matrix()
CompatibilityLoopHandling.generate_loop_id_to_matrix_list_dict()
CompatibilityLoopHandling.generate_matrices_from_expanded_loop()
CompatibilityLoopHandling.generate_transformation_matrix()
CompatibilityLoopHandling.get_compatibility_expression_from_FO_matrices()
CompatibilityLoopHandling.get_deviation_matrix_by_id()
CompatibilityLoopHandling.get_gap_matrix_by_id()
- otaf.assembly_modeling.firstOrderMatrixExpansion module
- otaf.assembly_modeling.systemOfConstraintsAssemblyModel module
SystemOfConstraintsAssemblyModel
SystemOfConstraintsAssemblyModel.deviation_symbols
SystemOfConstraintsAssemblyModel.gap_symbols
SystemOfConstraintsAssemblyModel.A_eq_Def
SystemOfConstraintsAssemblyModel.A_eq_Gap
SystemOfConstraintsAssemblyModel.K_eq
SystemOfConstraintsAssemblyModel.A_ub_Def
SystemOfConstraintsAssemblyModel.A_ub_Gap
SystemOfConstraintsAssemblyModel.K_ub
SystemOfConstraintsAssemblyModel.nD
SystemOfConstraintsAssemblyModel.nG
SystemOfConstraintsAssemblyModel.nC
SystemOfConstraintsAssemblyModel.nI
SystemOfConstraintsAssemblyModel.__init__()
SystemOfConstraintsAssemblyModel.__call__()
SystemOfConstraintsAssemblyModel.__call__()
SystemOfConstraintsAssemblyModel.embedOptimizationVariable()
SystemOfConstraintsAssemblyModel.extractFreeGapAndDeviationVariables()
SystemOfConstraintsAssemblyModel.generateConstraintMatrices()
SystemOfConstraintsAssemblyModel.get_feature_indices_and_dimensions()
SystemOfConstraintsAssemblyModel.validateOptimizationResults()
- Module contents
AssemblyDataProcessor
AssemblyDataProcessor.system_data
AssemblyDataProcessor.compatibility_loops_expanded
AssemblyDataProcessor.__getitem__()
AssemblyDataProcessor.__repr__()
AssemblyDataProcessor.__setitem__()
AssemblyDataProcessor.add_surface_points()
AssemblyDataProcessor.generate_expanded_loops()
AssemblyDataProcessor.generate_functional_planes()
AssemblyDataProcessor.generate_points_for_surface()
AssemblyDataProcessor.generate_sphere_clouds()
AssemblyDataProcessor.get_notebook_scene_sphere_clouds()
AssemblyDataProcessor.get_surface_points()
AssemblyDataProcessor.validate_point_dict()
AssemblyDataProcessor.validate_system_data_structure()
CompatibilityLoopHandling
CompatibilityLoopHandling.ADP
CompatibilityLoopHandling._deviation_matrix_map
CompatibilityLoopHandling._gap_matrix_map
CompatibilityLoopHandling._transformation_matrix_map
CompatibilityLoopHandling.compatibility_loops_matrices
CompatibilityLoopHandling.compatibility_loops_FO_matrices
CompatibilityLoopHandling.compatibility_expressions
CompatibilityLoopHandling.__init__()
CompatibilityLoopHandling.get_gap_matrix_by_id()
CompatibilityLoopHandling.get_deviation_matrix_by_id()
CompatibilityLoopHandling.get_compatibility_expression_from_FO_matrices()
CompatibilityLoopHandling.generate_loop_id_to_matrix_list_dict()
CompatibilityLoopHandling.generate_FO_loop_matrices()
CompatibilityLoopHandling.apply_FO_matrix_expansion_to_matrix_loop_list()
CompatibilityLoopHandling.generate_matrices_from_expanded_loop()
CompatibilityLoopHandling.generate_transformation_matrix()
CompatibilityLoopHandling.generate_deviation_matrix()
CompatibilityLoopHandling.generate_gap_matrix()
CompatibilityLoopHandling.calculate_nominal_gap_transform()
CompatibilityLoopHandling.apply_FO_matrix_expansion_to_matrix_loop_list()
CompatibilityLoopHandling.calculate_nominal_gap_transform()
CompatibilityLoopHandling.generate_FO_loop_matrices()
CompatibilityLoopHandling.generate_deviation_matrix()
CompatibilityLoopHandling.generate_gap_matrix()
CompatibilityLoopHandling.generate_loop_id_to_matrix_list_dict()
CompatibilityLoopHandling.generate_matrices_from_expanded_loop()
CompatibilityLoopHandling.generate_transformation_matrix()
CompatibilityLoopHandling.get_compatibility_expression_from_FO_matrices()
CompatibilityLoopHandling.get_deviation_matrix_by_id()
CompatibilityLoopHandling.get_gap_matrix_by_id()
DeviationMatrix
FirstOrderMatrixExpansion
GapMatrix
I4
InterfaceLoopHandling
J4
SystemOfConstraintsAssemblyModel
SystemOfConstraintsAssemblyModel.deviation_symbols
SystemOfConstraintsAssemblyModel.gap_symbols
SystemOfConstraintsAssemblyModel.A_eq_Def
SystemOfConstraintsAssemblyModel.A_eq_Gap
SystemOfConstraintsAssemblyModel.K_eq
SystemOfConstraintsAssemblyModel.A_ub_Def
SystemOfConstraintsAssemblyModel.A_ub_Gap
SystemOfConstraintsAssemblyModel.K_ub
SystemOfConstraintsAssemblyModel.nD
SystemOfConstraintsAssemblyModel.nG
SystemOfConstraintsAssemblyModel.nC
SystemOfConstraintsAssemblyModel.nI
SystemOfConstraintsAssemblyModel.__init__()
SystemOfConstraintsAssemblyModel.__call__()
SystemOfConstraintsAssemblyModel.__call__()
SystemOfConstraintsAssemblyModel.embedOptimizationVariable()
SystemOfConstraintsAssemblyModel.extractFreeGapAndDeviationVariables()
SystemOfConstraintsAssemblyModel.generateConstraintMatrices()
SystemOfConstraintsAssemblyModel.get_feature_indices_and_dimensions()
SystemOfConstraintsAssemblyModel.validateOptimizationResults()
TransformationMatrix
- otaf.capabilities package
- otaf.common package
- Module contents
alphabet_generator()
arrays_close_enough()
bidirectional_string_to_array_conversion()
extract_expressions_with_variables()
get_SE3_base()
get_SE3_matrices_from_indices()
get_symbol_coef_map()
get_symbols_in_expressions()
get_tqdm_range()
inverse_mstring()
is_running_in_notebook()
merge_with_checks()
parse_matrix_string()
round_floats_in_expression()
threshold_for_percentile_positive_values_below()
validate_dict_keys()
- Module contents
- otaf.constants module
- otaf.distribution package
- otaf.example_models package
- otaf.exceptions package
- Module contents
ConflictingSurfaceDirectionsException
DuplicatePointError
GeometricConditionError
InvalidAffineTransformException
InvalidGlobalConstraintError
InvalidInteractionFormatError
InvalidPartLabelError
InvalidSurfaceDirectionError
InvalidSurfaceLabelError
LabelPatternError
LabelPrefixError
MissingKeyError
MissingOriginPointError
MissingSurfaceTypeKeyError
NonConcentricCylindersException
NonUniqueCoordinatesError
NonUniqueLabelError
PartNotFoundError
PointDictionaryError
PointsNotOnPlaneError
SurfaceNotFoundError
TimeoutError
UniqueLabelSuffixError
UnsupportedSurfaceTypeError
timeout()
- Module contents
- otaf.geometry package
- Module contents
angle_between_planes()
angle_between_vectors()
are_normals_aligned_and_facing()
are_planes_coincident()
are_planes_facing()
are_planes_parallel()
are_planes_perpendicular()
are_points_on_2d_plane()
calculate_cylinder_surface_frame()
calculate_scalar_projection_factor()
centroid()
closest_point_on_line()
closest_point_on_plane()
compute_bounding_box()
distance_between_planes()
do_bounding_boxes_overlap()
euclidean_distance()
generate_circle_points()
generate_circle_points_3d()
is_affine_transformation_matrix()
is_bounding_box_within()
line_plane_intersection()
plane_parameters()
point_dict_to_arrays()
point_in_hull()
point_plane_distance()
point_to_segment_distance()
points_in_cylinder()
points_in_cylinder_vect()
project_vector_onto_plane()
rotation_matrix_from_vectors()
tfrt()
transform_point()
- Module contents
- otaf.optimization package
- Module contents
AcceptTest
Callback
ModifiedBasinHopping
OptimizationStorage
OptimizationStorage.__iter__()
OptimizationStorage.add_point()
OptimizationStorage.apply_checks_to_all()
OptimizationStorage.check_bounds()
OptimizationStorage.check_constraints()
OptimizationStorage.clear_storage()
OptimizationStorage.filter_points()
OptimizationStorage.get_all_data()
OptimizationStorage.get_points_by_source()
OptimizationStorage.iter_points()
StepTaking
bounds_from_composed_distribution()
check_constraint_with_tolerance()
create_constraint_checker()
lambda_constraint_dict_from_composed_distribution()
scaling()
- Module contents
- otaf.plotting package
- Module contents
arrange_axes_in_grid()
calculate_sample_in_deviation_domain()
compare_jacobians()
create_open_cylinder()
create_surface_from_planar_contour()
hex_to_rgba()
pair_plot()
plot_best_worst_input_data()
plot_best_worst_results()
plot_combined_CDF()
plot_deviated_surfs()
plot_deviation_domain()
plot_gld_pbox_cdf()
plot_gld_pbox_cdf2()
plot_points_3D()
plot_rect_part()
plot_single_transform()
plot_transform_sequence()
print_sample_in_deviation_domain()
save_plot()
set_graph_legends()
spheres_from_point_cloud()
trimesh_scene_as_notebook_scene()
- Module contents
- otaf.sampling package
- Module contents
LagrangeConstraintSolver
UniformSurfaceSampler
compose_defects_with_lambdas()
condition_lambda_sample()
condition_sample_array()
find_best_worst_quantile()
generateLHSExperiment()
generate_and_transform_sequence()
generate_imprecise_probabilistic_samples()
generate_random_permutations_with_sampling()
generate_scaled_permutations()
project_samples_to_hyperplane()
scale_sample_with_params()
validate_and_extract_indices()
- Module contents
- otaf.sensitivity package
- Module contents
SobolIndicesExperimentWithComposedDistribution
SobolIndicesExperimentWithComposedDistribution.generate()
SobolIndicesExperimentWithComposedDistribution.generateWithWeights()
SobolIndicesExperimentWithComposedDistribution.getClassName()
SobolIndicesExperimentWithComposedDistribution.getId()
SobolIndicesExperimentWithComposedDistribution.getName()
SobolIndicesExperimentWithComposedDistribution.getShadowedId()
SobolIndicesExperimentWithComposedDistribution.getSize()
SobolIndicesExperimentWithComposedDistribution.getVisibility()
SobolIndicesExperimentWithComposedDistribution.hasName()
SobolIndicesExperimentWithComposedDistribution.hasUniformWeights()
SobolIndicesExperimentWithComposedDistribution.hasVisibleName()
SobolIndicesExperimentWithComposedDistribution.setComposedDistribution()
SobolIndicesExperimentWithComposedDistribution.setName()
SobolIndicesExperimentWithComposedDistribution.setShadowedId()
SobolIndicesExperimentWithComposedDistribution.setSize()
plotSobolIndicesWithErr()
- Module contents
- otaf.surrogate package
- Module contents
BinaryClassificationModel
BinaryClassificationModel.add_new_data_points()
BinaryClassificationModel.evaluate_model()
BinaryClassificationModel.forward()
BinaryClassificationModel.get_train_test_data()
BinaryClassificationModel.load_model()
BinaryClassificationModel.plot_results()
BinaryClassificationModel.save_model()
BinaryClassificationModel.train_model()
BinaryClassificationModel.training_stopping_criterion()
DualNetworkPredictor
DualNetworkPredictor.model_defects_to_gaps
DualNetworkPredictor.model_gap_def_to_slack
DualNetworkPredictor.brute_force_probability_of_failure()
DualNetworkPredictor.evaluate_in_batches()
DualNetworkPredictor.forward()
DualNetworkPredictor.get_train_test_data()
DualNetworkPredictor.load_best_weights()
DualNetworkPredictor.plot_results()
DualNetworkPredictor.restore_start_weights()
DualNetworkPredictor.train_model()
GaussianSurrogateModel
LPNeuralSurrogateTolereancing
LPNeuralSurrogateTolereancing.evaluate_model_non_standard_space()
LPNeuralSurrogateTolereancing.forward()
LPNeuralSurrogateTolereancing.get_train_test_data()
LPNeuralSurrogateTolereancing.load_model()
LPNeuralSurrogateTolereancing.pf_monte_carlo_bruteforce()
LPNeuralSurrogateTolereancing.plot_results()
LPNeuralSurrogateTolereancing.save_model()
LPNeuralSurrogateTolereancing.train_model()
LPNeuralSurrogateTolereancing.training_stopping_criterion()
LimitSpaceFocusedLoss
NeuralRegressorNetwork
NeuralRegressorNetwork.evaluate_model_non_standard_space()
NeuralRegressorNetwork.forward()
NeuralRegressorNetwork.get_model_as_openturns_function()
NeuralRegressorNetwork.get_train_test_data()
NeuralRegressorNetwork.gradient()
NeuralRegressorNetwork.hessian()
NeuralRegressorNetwork.load_model()
NeuralRegressorNetwork.pf_monte_carlo_bruteforce()
NeuralRegressorNetwork.plot_results()
NeuralRegressorNetwork.save_model()
NeuralRegressorNetwork.train_model()
NeuralRegressorNetwork.training_stopping_criterion()
PositiveLimitSpaceFocusedLoss
add_gaussian_noise()
evaluate_binary_predictions()
generate_corrected_binary_predictions()
get_base_relu_mlp_model()
get_base_tanh_mlp_model()
get_custom_mlp_layers()
get_variable_size_sequential_linear_model()
initialize_model_weights()
optimize_thresholds_with_alpha()
plot_confusion_matrix()
- Module contents
- otaf.uncertainty package
- Module contents
SocAssemblyAnalysisOptimized
compute_adaptive_failure_probability()
compute_failure_probability_FORM()
compute_failure_probability_NAIS()
compute_failure_probability_SUBSET()
compute_failure_probability_basic()
compute_failure_probability_subset_sampling()
compute_gap_optimizations_on_sample()
compute_gap_optimizations_on_sample_batch()
compute_gap_optimizations_on_sample_w_steps()
intermediate_lambda_function()
intermediate_lambda_function_derivative()
lambda_sample_composition()
milp_batch_sequential()
monte_carlo_non_compliancy_rate_at_threshold_w_gradient()
monte_carlo_non_compliancy_rate_gradient()
monte_carlo_non_compliancy_rate_gradient_start_space()
monte_carlo_non_compliancy_rate_w_gradient()
normal_score_mu()
normal_score_sigma()
sample_non_compliancy_at_threshold()
sample_non_compliancy_rate()
- Module contents
Module contents
- class otaf.AssemblyDataProcessor(system_data=None)[source]
Bases:
object
Class to manage and validate mechanical system data for assembly representation.
This class transforms a minimal representation of mechanical system data into a structured format usable by the rest of the code. It ensures data integrity and validates compatibility with defined requirements, including surfaces, points, interactions, and constraints.
- Parameters:
system_data (dict, optional) – A nested dictionary representing mechanical system data. If not provided, an empty structure is initialized.
- system_data
The validated and potentially augmented system data.
- Type:
dict
- compatibility_loops_expanded
Placeholder for compatibility loop expansions, initialized as None.
- Type:
None or dict
- __getitem__(key)[source]
Retrieve data associated with a key from the system data.
- Parameters:
key (str) – The key for accessing system data.
- Returns:
The value associated with the specified key.
- Return type:
Any
- __repr__()[source]
Generate a string representation of the system data.
- Returns:
A string representation of the system data dictionary.
- Return type:
str
- __setitem__(key, val)[source]
Set a value in the system data for a given key.
- Parameters:
key (str) – The key for the data to be set.
val (Any) – The value to assign to the key in the system data.
- add_surface_points(part_id, surf_id, point_dict, ignore_duplicates=False)[source]
Add surface points to a specified part and surface, ensuring uniqueness and validating the input.
- Parameters:
part_id (str) – The ID of the part to which the surface belongs.
surf_id (str) – The ID of the surface to which the points will be added.
point_dict (Dict[str, Union[Tuple, numpy.ndarray, List]]) – A dictionary where keys are point labels and values are their corresponding coordinates.
ignore_duplicates (bool, optional) – If True, ignore duplicate points that match exactly with existing points (default is False).
- Raises:
otaf.exceptions.PartNotFoundError – If the specified part ID is not found in the system data.
otaf.exceptions.SurfaceNotFoundError – If the specified surface ID is not found in the given part.
otaf.exceptions.DuplicatePointError – If a point with the same label or coordinates already exists and duplicates are not ignored.
otaf.exceptions.LabelPatternError – If any labels in the point dictionary do not match the required pattern.
otaf.exceptions.LabelPrefixError – If label prefixes are inconsistent across the points.
otaf.exceptions.UniqueLabelSuffixError – If label suffixes are not unique across the points.
otaf.exceptions.NonUniqueCoordinatesError – If point coordinates are not unique.
Notes
Surface points are stored under the “POINTS” key of the surface’s dictionary.
If the label of a point matches the origin pattern (SURF_ORIGIN_PATTERN), the point is set as the surface’s origin.
- generate_expanded_loops()[source]
Generate the full representation of compatibility loops and store them as an attribute.
This method processes the compact descriptions of compatibility loops in the system data and expands them into their detailed forms.
- compatibility_loops_expanded
A dictionary where keys are loop names and values are the fully expanded loop strings.
- Type:
dict
- Return type:
None
- generate_functional_planes()[source]
Generate planes representing each planar feature in the assembly
- Returns:
A list of trimesh objects for each part and surface.
- Return type:
list
Notes
The method uses a color palette to assign unique colors to the spheres for each part and surface.
The generated spheres are translated globally based on the global_translation parameter.
- generate_points_for_surface(part_id, surf_id)[source]
Generate points for a surface based on its type and characteristics.
This method determines the surface type and dispatches the task to the appropriate surface-specific point generation method.
- Parameters:
part_id (str) – The ID of the part containing the surface.
surf_id (str) – The ID of the surface for which points will be generated.
- Raises:
otaf.exceptions.MissingKeyError – If required keys are missing from the surface data.
otaf.exceptions.UnsupportedSurfaceTypeError – If the surface type is not supported.
- Return type:
None
- generate_sphere_clouds(radius=0.5, global_translation=array([0, 0, 0]))[source]
Generate sphere representations for each set of points in the system data.
This method creates a list of 3D spheres representing the points in the system data, grouped by parts and surfaces. Each group of points is assigned a unique color.
- Parameters:
radius (Union[float, int], optional) – The radius of the spheres (default is 0.5).
global_translation (Union[list, numpy.ndarray], optional) – A 3D vector representing a global translation applied to all points (default is [0, 0, 0]).
- Returns:
A list of trimesh sphere objects for each part and surface.
- Return type:
list
Notes
The method uses a color palette to assign unique colors to the spheres for each part and surface.
The generated spheres are translated globally based on the global_translation parameter.
- get_notebook_scene_sphere_clouds(radius=0.5, background_hex_color='e6e6e6')[source]
Create a 3D notebook scene with sphere clouds representing the system’s points.
This method generates a 3D scene containing spheres for the system’s points and renders it as a scene compatible with Jupyter Notebook.
- Parameters:
radius (float, optional) – The radius of the spheres in the scene (default is 0.5).
background_hex_color (str, optional) – The hexadecimal color code for the scene’s background (default is “e6e6e6”).
- Returns:
A scene object rendered in a format suitable for Jupyter Notebook.
- Return type:
scene
- get_surface_points(part_id, surf_id)[source]
Retrieve a copy of the points associated with a specific surface.
- Parameters:
part_id (str) – The ID of the part containing the surface.
surf_id (str) – The ID of the surface.
- Returns:
A copy of the points associated with the surface.
- Return type:
dict
- Raises:
KeyError – If the specified part or surface ID is not found.
- validate_point_dict(point_dict)[source]
Validate a dictionary of points for compliance with labeling, formatting, and uniqueness rules.
- Parameters:
point_dict (Dict[str, Union[Tuple, numpy.ndarray]]) – A dictionary where keys are point labels and values are their corresponding coordinates.
- Raises:
otaf.exceptions.LabelPatternError – If any labels do not match the required pattern.
otaf.exceptions.LabelPrefixError – If label prefixes are inconsistent across the points.
otaf.exceptions.UniqueLabelSuffixError – If label suffixes are not unique across the points.
otaf.exceptions.NonUniqueCoordinatesError – If point coordinates are not unique. Includes information about duplicate points in the error message.
Notes
Labels must conform to the SURF_POINT_PATTERN defined in the otaf.constants module.
Labels must have consistent prefixes (e.g., “A”, “B”, etc.) and unique numeric suffixes.
The coordinates for all points must be unique.
- validate_system_data_structure()[source]
Validate the structure and integrity of the system data.
Ensures that the required keys and nested structures exist and conform to expected standards, including part IDs, surface labels, types, points, interactions, and constraints.
- Raises:
otaf.exceptions.MissingKeyError – If a required key is missing.
otaf.exceptions.InvalidPartLabelError – If part labels are not integers.
otaf.exceptions.InvalidSurfaceLabelError – If surface labels are not lowercase alphabetic strings.
otaf.exceptions.UnsupportedSurfaceTypeError – If the surface type is not supported.
otaf.exceptions.MissingSurfaceTypeKeyError – If a surface lacks a “TYPE” key.
otaf.exceptions.MissingOriginPointError – If no origin point is defined for a surface.
otaf.exceptions.InvalidInteractionFormatError – If an interaction format is invalid.
otaf.exceptions.InvalidSurfaceDirectionError – If a surface direction is invalid.
otaf.exceptions.InvalidGlobalConstraintError – If the global constraint is not supported.
- class otaf.CompatibilityLoopHandling(assemblyDataProcessor)[source]
Bases:
object
Class for processing system data and constructing compatibility constraint matrices.
This class processes system data to generate and manage compatibility loops, constructing the matrices required to define compatibility constraints in geometrical product specifications. It facilitates tolerance analysis by providing compatibility equations and handling matrix expansions for compatibility loops.
- Parameters:
assemblyDataProcessor (AssemblyDataProcessor)
- ADP
Object containing processed system data, including expanded compatibility loops.
- _deviation_matrix_map
Cache mapping deviation matrix identifiers to their corresponding matrices.
- Type:
dict
- _gap_matrix_map
Cache mapping gap matrix identifiers to their corresponding matrices.
- Type:
dict
- _transformation_matrix_map
Cache mapping transformation matrix identifiers to their corresponding matrices.
- Type:
dict
- compatibility_loops_matrices
Dictionary mapping compatibility loop IDs to lists of corresponding matrices.
- Type:
dict
- compatibility_loops_FO_matrices
Dictionary mapping compatibility loop IDs to first-order expanded matrices.
- Type:
dict
- compatibility_expressions
List of symbolic expressions representing compatibility constraints.
- Type:
list of sympy.Expr
- get_gap_matrix_by_id(ID)[source]
Retrieve a gap matrix by its identifier.
- Parameters:
ID (str | int)
- Return type:
list[GapMatrix | TransformationMatrix]
- get_deviation_matrix_by_id(ID)[source]
Retrieve a deviation matrix by its identifier.
- Parameters:
ID (str | int)
- Return type:
list[DeviationMatrix]
- get_compatibility_expression_from_FO_matrices()[source]
Generate symbolic expressions for compatibility constraints.
- Return type:
list[Expr]
- generate_loop_id_to_matrix_list_dict()[source]
Create a dictionary mapping loop IDs to matrix lists for compatibility loops.
- Return type:
dict[str, list[TransformationMatrix | DeviationMatrix | GapMatrix]]
- generate_FO_loop_matrices()[source]
Generate first-order matrix expansions for compatibility loops.
- Return type:
dict[str, MatrixBase]
- apply_FO_matrix_expansion_to_matrix_loop_list(compatibility_loop_matrix_list)[source]
Apply first-order matrix expansion to a list of compatibility loop matrices.
- Parameters:
compatibility_loop_matrix_list (list[TransformationMatrix | DeviationMatrix | GapMatrix])
- Return type:
MatrixBase
- generate_matrices_from_expanded_loop(expanded_loop_str)[source]
Generate matrices for a compatibility loop from its expanded string representation.
- Parameters:
expanded_loop_str (str)
- Return type:
list[TransformationMatrix | DeviationMatrix | GapMatrix]
- generate_transformation_matrix(el_info)[source]
Generate a transformation matrix from loop element information.
- Parameters:
el_info (dict)
- Return type:
list[TransformationMatrix]
- generate_deviation_matrix(el_info)[source]
Generate a deviation matrix based on loop element information.
- Parameters:
el_info (dict)
- Return type:
list[DeviationMatrix]
- generate_gap_matrix(el_info)[source]
Generate a gap matrix based on loop element information.
- Parameters:
el_info (dict)
- Return type:
list[GapMatrix | TransformationMatrix]
- calculate_nominal_gap_transform(el_info, ID, nullify_x=True, nullify_y=True, nullify_z=True)[source]
Calculate the nominal transformation matrix between two surfaces in a gap, with options to nullify specific translation components.
- Parameters:
el_info (dict)
ID (int)
nullify_x (bool)
nullify_y (bool)
nullify_z (bool)
- Return type:
- apply_FO_matrix_expansion_to_matrix_loop_list(compatibility_loop_matrix_list)[source]
Apply first-order matrix expansion to a list of compatibility loop matrices.
- Parameters:
compatibility_loop_matrix_list (list of otaf.TransformationMatrix, otaf.DeviationMatrix, otaf.GapMatrix) – List of matrices representing a compatibility loop.
- Returns:
The first-order expansion of the compatibility loop matrices.
- Return type:
sympy.MatrixBase
- calculate_nominal_gap_transform(el_info, ID, nullify_x=True, nullify_y=True, nullify_z=True)[source]
Calculate the nominal transformation matrix between two surfaces in a gap.
This method computes the nominal transformation matrix between two surfaces in the compatibility loop, with options to nullify specific components of the translation vector.
- Parameters:
el_info (dict) – Dictionary containing loop element information, including part and surface identifiers.
ID (int) – Unique identifier for the transformation matrix.
nullify_x (bool, optional) – Whether to nullify the x-component of the translation vector. Defaults to True.
nullify_y (bool, optional) – Whether to nullify the y-component of the translation vector. Defaults to True.
nullify_z (bool, optional) – Whether to nullify the z-component of the translation vector. Defaults to True.
- Returns:
The calculated nominal transformation matrix with specified components nullified.
- Return type:
Notes
The method extracts point and frame information for the specified surfaces and uses it to compute the nominal transformation matrix.
Nullification of translation components is applied directly to the matrix.
- Raises:
KeyError – If required surface or frame information is missing in the input data.
- Parameters:
el_info (dict)
ID (int)
nullify_x (bool)
nullify_y (bool)
nullify_z (bool)
- Return type:
- generate_FO_loop_matrices()[source]
Generate first-order expanded matrices for compatibility loops.
- Returns:
A dictionary mapping compatibility loop IDs to their first-order expanded matrices.
- Return type:
dict
- generate_deviation_matrix(el_info)[source]
Generate a deviation matrix based on loop element information.
This method creates a deviation matrix for a specified element in the compatibility loop, taking into account surface types, constraints, and global constraints.
- Parameters:
el_info (dict) – Dictionary containing loop element information, including the matrix string (mstring), surface type, and relevant constraints.
- Returns:
A list containing the generated deviation matrix or its inverse, depending on the specified configuration.
- Return type:
list of otaf.DeviationMatrix
Notes
If the deviation matrix for the given element already exists, it retrieves it from the cache.
Surface constraints and global constraints influence the degrees of freedom (translations and rotations) of the generated deviation matrix.
- Raises:
KeyError – If required surface or global constraints are missing in the input data.
- Parameters:
el_info (dict)
- Return type:
list[DeviationMatrix]
- generate_gap_matrix(el_info)[source]
Generate a gap matrix based on loop element information.
This method creates a gap matrix for the specified pair of surfaces in the compatibility loop, taking into account surface types, contact constraints, manual constraints, and global constraints.
- Parameters:
el_info (dict) – Dictionary containing loop element information, including the matrix string (mstring), part and surface identifiers, and relevant constraints.
- Returns:
A list containing the generated gap matrix, its nominal transform, or their inverses, depending on the configuration.
- Return type:
list of Union[otaf.GapMatrix, otaf.TransformationMatrix]
Notes
If the gap matrix for the given element already exists, it retrieves it from the cache.
Contact constraints and manual constraints (translations and rotations) influence the blocked degrees of freedom in the generated gap matrix.
A nominal gap transform is calculated and returned alongside the gap matrix.
- Raises:
KeyError – If required surface or contact constraints are missing in the input data.
- Parameters:
el_info (dict)
- Return type:
list[GapMatrix | TransformationMatrix]
- generate_loop_id_to_matrix_list_dict()[source]
Create a dictionary mapping compatibility loop IDs to lists of matrices.
- Returns:
A dictionary where keys are compatibility loop IDs, and values are lists of matrices representing the corresponding compatibility loops.
- Return type:
dict
- generate_matrices_from_expanded_loop(expanded_loop_str)[source]
Generate matrices for a compatibility loop from its expanded string representation.
- Parameters:
expanded_loop_str (str) – The string representation of an expanded compatibility loop.
- Returns:
List of matrices corresponding to the expanded loop.
- Return type:
list of otaf.TransformationMatrix, otaf.DeviationMatrix, otaf.GapMatrix
- Raises:
ValueError – If the matrix type in the string is unknown.
- generate_transformation_matrix(el_info)[source]
Generate a transformation matrix from loop element information.
- Parameters:
el_info (dict) – Dictionary containing loop element information, including part IDs, surfaces, points, and transformation details.
- Returns:
A list containing the generated transformation matrix.
- Return type:
list of otaf.TransformationMatrix
Notes
If the matrix already exists in the transformation matrix map, it is retrieved from the cache.
The inverse of the generated transformation matrix is also cached.
- get_compatibility_expression_from_FO_matrices()[source]
Generate symbolic expressions representing compatibility constraints.
- Returns:
A list of symbolic expressions for the compatibility constraints derived from the first-order expanded matrices.
- Return type:
list of sympy.Expr
- get_deviation_matrix_by_id(ID)[source]
Retrieve a deviation matrix by its identifier.
- Parameters:
ID (str or int) – The identifier of the deviation matrix.
- Returns:
The corresponding deviation matrix.
- Return type:
list of otaf.DeviationMatrix
- Raises:
KeyError – If the specified ID does not exist in the deviation matrix map.
- get_gap_matrix_by_id(ID)[source]
Retrieve a gap matrix by its identifier.
- Parameters:
ID (str or int) – The identifier of the gap matrix.
- Returns:
The corresponding gap matrix or transformation matrix.
- Return type:
list of otaf.GapMatrix or otaf.TransformationMatrix
- Raises:
KeyError – If the specified ID does not exist in the gap matrix map.
- class otaf.DeviationMatrix(index=-1, translations='xyz', rotations='xyz', inverse=False, name='')[source]
Bases:
object
Represents a deviation matrix used in structural analysis.
A deviation matrix defines deviations in translation and rotation for parts and assemblies. It can be compared to a small deviation torsor.
- Parameters:
index (int, optional) – An index used to differentiate variable names. The same index can be used multiple times.
translations (str, optional) – Degrees of freedom for translation (‘x’, ‘y’, ‘z’). Example: “xyz” for all three degrees.
rotations (str, optional) – Degrees of freedom for rotation (‘x’, ‘y’, ‘z’).
inverse (bool, optional) – Indicates whether the matrix represents deviations from nominal to real (True) or vice versa (False). This affects the signs of the matrices and is necessary if a matrix is used in two directions.
name (str, optional) – Name of the matrix for identification (default is an empty string).
- __repr__()[source]
Generate a string representation of the DeviationMatrix.
- Returns:
String representation of the DeviationMatrix instance.
- Return type:
str
- get_inverse()[source]
Generate the inverse of the current DeviationMatrix.
The inverse matrix has the same degrees of freedom (translations and rotations) but with reversed directionality.
- Returns:
A new instance of DeviationMatrix representing the inverse of the current matrix.
- Return type:
- get_matrix()[source]
Generate the SE(3) matrix for the deviation matrix.
The SE(3) matrix is constructed using the indices of the degrees of freedom specified during initialization.
- Returns:
A list of symbolic matrices corresponding to the SE(3) basis elements.
- Return type:
List[sympy.MatrixBase]
- get_matrix_inverse()[source]
Generate the inverse SE(3) matrix for the deviation matrix.
The inverse SE(3) matrix is constructed by reversing the directionality of the degrees of freedom (i.e., multiplying by -1).
- Returns:
A list of symbolic matrices corresponding to the inverse SE(3) basis elements.
- Return type:
List[sympy.MatrixBase]
- get_variables()[source]
Retrieve the symbolic variables associated with the deviation matrix.
These variables correspond to the degrees of freedom in translations and rotations, defined during initialization.
- Returns:
A list of symbolic variables representing the degrees of freedom.
- Return type:
List[sympy.Symbol]
- class otaf.FirstOrderMatrixExpansion(matrix_list)[source]
Bases:
object
Initialize the FirstOrderMatrixExpansion class.
- Parameters:
matrix_list (List[Union[otaf.DeviationMatrix, otaf.GapMatrix, otaf.TransformationMatrix, otaf.I4, otaf.J4]]) – List of matrices to be used in the first-order Taylor expansion.
- compute_first_order_expansion(tolerance=1e-08)[source]
Construct the first-order Taylor expansion of a matrix product.
This method computes the expansion by iterating through the provided list of matrices, identifying constant terms and first-order variable-dependent terms.
- Parameters:
tolerance (float, optional) – Tolerance value for symbolic simplification (default is 1e-8).
- Returns:
A symbolic matrix representing the simplified first-order Taylor expansion.
- Return type:
sp.MatrixBase
- class otaf.GapMatrix(index=-1, translations_blocked='', rotations_blocked='', inverse=False, name='')[source]
Bases:
object
Represents a gap matrix used in structural analysis.
A gap matrix defines gaps or clearances in translation and rotation for parts and assemblies.
- Parameters:
index (int, optional) – An index used to differentiate variable names. The same index can be used multiple times (default is -1).
translations_blocked (str, optional) – Degrees of freedom for translation that are blocked (‘x’, ‘y’, ‘z’) (default is an empty string).
rotations_blocked (str, optional) – Degrees of freedom for rotation that are blocked (‘x’, ‘y’, ‘z’) (default is an empty string).
inverse (bool, optional) – Indicates whether the matrix represents gaps or clearances (True) or blocked degrees of freedom (False).
name (str, optional) – Name of the matrix for identification (default is an empty string).
- __repr__()[source]
Generate a string representation of the GapMatrix.
- Returns:
String representation of the GapMatrix instance.
- Return type:
str
- get_inverse()[source]
Generate the inverse of the current GapMatrix.
The inverse matrix has the same blocked degrees of freedom for translations and rotations but reverses the directionality (gaps versus clearances).
- Returns:
A new instance of GapMatrix representing the inverse of the current matrix.
- Return type:
- get_matrix()[source]
Generate the SE(3) matrix for the gap matrix.
The SE(3) matrix is constructed using the indices of the degrees of freedom that are not blocked, specified during initialization.
- Returns:
A list of symbolic matrices corresponding to the SE(3) basis elements.
- Return type:
List[sympy.MatrixBase]
- get_matrix_inverse()[source]
Generate the inverse SE(3) matrix for the gap matrix.
The inverse SE(3) matrix is constructed by reversing the directionality of the degrees of freedom (i.e., multiplying by -1).
- Returns:
A list of symbolic matrices corresponding to the inverse SE(3) basis elements.
- Return type:
List[sympy.MatrixBase]
- get_variables()[source]
Retrieve the symbolic variables associated with the gap matrix.
These variables correspond to the degrees of freedom in translations and rotations that are not blocked, as defined during initialization.
- Returns:
A list of symbolic variables representing the degrees of freedom.
- Return type:
List[sympy.Symbol]
- class otaf.InterfaceLoopHandling(system_data_augmented, compatibility_loop_handling, circle_resolution=8)[source]
Bases:
object
- extract_unique_gap_matrices_from_expanded_loops()[source]
Extract unique gap matrices from expanded compatibility loops and return them as a set.
- Return type:
set
[str
]
- property facing_point_dictionary
- filter_gap_matrices(existing_gap_matrices, all_gap_matrices)[source]
Filter and organize gap matrices into used and unused categories.
This method categorizes gap matrices into ‘used’ and ‘unused’ based on their presence in the existing gap matrices set. It iterates through all provided gap matrices, comparing them with existing ones, and then organizes them into a nested dictionary indicating their usage status. This only categorizes the matrices when there is at least a common elemnt
- Parameters:
existing_gap_matrices (Set[str]) – A set of existing gap matrix names.
all_gap_matrices (Dict[str, Dict[str, Set[str]]]) – A dictionary of all gap matrices, structured by parts and surfaces.
- Returns:
A nested dictionary categorizing gap matrices into ‘used’ and ‘unused’ for each part and surface.
- Return type:
Dict[str, Dict[str, Dict[str, Set[str]]]]
- generate_all_gap_matrix_names()[source]
Generate and return a dictionary of gap matrix names based on facing points.
This method iterates through the facing points in the system, creating and organizing gap matrix names. Each gap matrix name represents a potential spatial relationship between different parts and surfaces in the system. The names are stored in a nested dictionary structure keyed by part and surface IDs.
Additionally, it ensures that for every gap matrix, its inverse exists in the set for the corresponding surface on the other part. If an inverse gap matrix is missing, it is added to maintain consistency in the representation of spatial relationships.
- Return type:
dict
[str
,dict
[str
,set
[str
]]]
- class otaf.SystemOfConstraintsAssemblyModel(compatibility_eqs, interface_eqs, verbose=0)[source]
Bases:
object
Prepare matrices for tolerance analysis involving deviations and gaps.
This class processes compatibility and interface equations to generate a matrix representation suitable for linear programming solvers like scipy.optimize.linprog.
- deviation_symbols
List of deviation variables.
- Type:
list
- gap_symbols
List of gap variables.
- Type:
list
- A_eq_Def
Coefficient matrix for deviation variables in compatibility equations.
- Type:
numpy.ndarray
- A_eq_Gap
Coefficient matrix for gap variables in compatibility equations.
- Type:
numpy.ndarray
- K_eq
Constants in compatibility equations.
- Type:
numpy.ndarray
- A_ub_Def
Coefficient matrix for deviation variables in interface equations.
- Type:
numpy.ndarray
- A_ub_Gap
Coefficient matrix for gap variables in interface equations.
- Type:
numpy.ndarray
- K_ub
Constants in interface equations.
- Type:
numpy.ndarray
- nD
Number of deviation variables.
- Type:
int
- nG
Number of gap variables.
- Type:
int
- nC
Number of compatibility equations.
- Type:
int
- nI
Number of interface equations.
- Type:
int
- __init__(compatibility_eqs, interface_eqs, verbose=0)[source]
Initialize the matrix preparer with compatibility and interface equations.
- __call__(deviation_array, bounds=None, C=None)[source]
Generate input matrices and bounds for linear programming optimization.
- Parameters:
deviation_array (ndarray | Iterable)
bounds (list[list[float]] | ndarray | None)
C (ndarray | list[int | float] | None)
- Return type:
tuple[ndarray, ndarray, ndarray, ndarray, ndarray, ndarray]
- Parameters:
compatibility_eqs (list of sympy.Expr) – List of compatibility equations (equality constraints).
interface_eqs (list of sympy.Expr) – List of interface equations (inequality constraints).
verbose (int, optional) – Verbosity level for logging (default is 0).
- __call__(deviation_array, bounds=None, C=None)[source]
Generate input matrices and bounds for linear programming optimization.
This method prepares inputs for scipy.optimize.linprog using the deviation variables and optionally provided bounds and objective coefficients.
- Parameters:
deviation_array (numpy.ndarray or Iterable) – Array of shape (nDOE, nD) representing deviation variables.
bounds (list of list of float or numpy.ndarray, optional) – Bounds for gap variables (default is automatically determined).
C (numpy.ndarray or list of float, optional) – Coefficients of the linear objective function to be minimized (default is inferred).
- Returns:
Contains the following elements: - C : numpy.ndarray
Coefficients of the linear objective function.
- A_ubnumpy.ndarray
Matrix representing inequality constraints.
- B_ubnumpy.ndarray
Right-hand side of inequality constraints.
- A_eqnumpy.ndarray
Matrix representing equality constraints.
- B_eqnumpy.ndarray
Right-hand side of equality constraints.
- boundsnumpy.ndarray
Variable bounds.
- Return type:
tuple
- Raises:
ValueError – If the number of deviation variables in deviation_array does not match self.deviation_symbols.
Notes
Deviation variables must be in the same order as self.deviation_symbols.
Gap variables must be in the same order as self.gap_symbols.
Default bounds are generated if bounds is not provided or improperly formatted.
- embedOptimizationVariable()[source]
Embed an auxiliary optimization variable for feasibility.
This method adds an auxiliary variable, s, to the gap variables. The variable s ensures that a feasible solution can be found, even in cases where the optimization problem would otherwise have no solution. The sign of s indicates whether the parts can be assembled, and the variable can be used in meta-model construction.
Notes
The variable s is appended to the list of gap variables (self.gap_symbols).
The A_ub_Gap and A_eq_Gap matrices are updated to include the new variable: - A_ub_Gap is augmented with a column of -1. - A_eq_Gap is augmented with a column of zeros.
- extractFreeGapAndDeviationVariables()[source]
Extract sets of deviation and gap variables present in compatibility equations.
This method identifies the free variables used in the compatibility equations and verifies that all variables appearing in the interface equations are included.
- Returns:
A tuple containing: - deviation_symbols : list of sympy.Symbol
List of deviation variables present in the compatibility equations.
- gap_symbolslist of sympy.Symbol
List of gap variables present in the compatibility equations.
- Return type:
tuple
- Raises:
AssertionError – If any variable in the interface equations is not included in the compatibility equations.
Notes
Deviation and gap variables are extracted separately from both compatibility and interface equations.
This ensures consistency between the two sets of equations.
- generateConstraintMatrices(rnd=9)[source]
Decompose equations into matrix representations for compatibility and interface constraints.
This method converts the equations into matrix forms suitable for linear programming: - Compatibility equations (equality constraints) are represented as:
A_eq_Def * X + A_eq_Gap * Y + K_eq = 0.
Interface equations (inequality constraints) are represented as: A_ub_Def * X + A_ub_Gap * Y + K_ub >= 0.
- Parameters:
rnd (int, optional) – Number of decimal places to round the matrix elements (default is 9).
- Returns:
A tuple containing the following matrices: - A_eq_Def : numpy.ndarray
Coefficient matrix for deviation variables in compatibility equations.
- A_eq_Gapnumpy.ndarray
Coefficient matrix for gap variables in compatibility equations.
- K_eqnumpy.ndarray
Constants in compatibility equations.
- A_ub_Defnumpy.ndarray
Coefficient matrix for deviation variables in interface equations.
- A_ub_Gapnumpy.ndarray
Coefficient matrix for gap variables in interface equations.
- K_ubnumpy.ndarray
Constants in interface equations.
- Return type:
tuple
Notes
The method iterates through each compatibility and interface equation to extract coefficients for deviation and gap variables.
Variables not explicitly included in the equations are assigned zero coefficients in the matrices.
- get_feature_indices_and_dimensions()[source]
Extract unique feature indices (classes) and their corresponding sizes from deviation symbols.
This method processes the self.deviation_symbols list to identify unique class indices based on the pattern _d_X (where X is the numeric class identifier). It counts the number of variables associated with each class index and returns two lists: - A sorted list of unique class indices. - A list of corresponding sizes, representing the number of variables per class.
- Returns:
- list of int
Sorted list of unique class indices.
- list of int
List of sizes, where each size corresponds to the number of variables for a class index.
- Return type:
tuple
Notes
Each deviation symbol is assumed to contain the class identifier in the format _d_X.
The method uses a regular expression to extract the class identifier and counts occurrences for each class.
- validateOptimizationResults(gap_array, deviation_array, rnd=9)[source]
Validate optimization results using original equations.
This method evaluates the original compatibility and interface equations with given values for the gap and deviation variables, returning the computed results for validation.
- Parameters:
gap_array (numpy.ndarray) – Array of gap variables.
deviation_array (numpy.ndarray) – Array of deviation variables.
rnd (int, optional) – Number of decimal places to round the results (default is 9).
- Returns:
List[float]: Results of evaluating the compatibility equations.
List[float]: Results of evaluating the interface equations.
- Return type:
tuple
Notes
The method substitutes the provided gap and deviation values into the original equations.
Compatibility results close to zero indicate a valid solution, while larger values suggest potential issues.
Interface results show the satisfaction level of inequality constraints.
- class otaf.TransformationMatrix(index=-1, initial=array([[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]]), final=array([[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]]), name='', matrix=None)[source]
Bases:
object
Class representing transformation matrices within the nominal geometry of a part.
Transformation matrices define the transformation between two coordinate systems.
- Parameters:
index (int, optional) – An index used to differentiate transformation matrices. The same index can be used multiple times (default is -1).
initial (np.ndarray, optional) – The initial 4x4 matrix representing the initial coordinate system (default is the identity matrix).
final (np.ndarray, optional) – The final 4x4 matrix representing the final coordinate system (default is the identity matrix).
name (str, optional) – Name of the transformation matrix for identification (default is an empty string).
matrix (Optional[Union[np.ndarray, sympy.MatrixBase]], optional) – The explicit transformation matrix. If provided, it overrides initial and final matrices (default is None).
- Raises:
AssertionError – If the provided matrix is not a valid affine transformation matrix.
- __repr__()[source]
Generate a string representation of the TransformationMatrix.
- Returns:
String representation of the TransformationMatrix instance, including its index and matrix values.
- Return type:
str
- get_change_of_basis_matrix(initial, final, as_array=False)[source]
Calculate the change of basis matrix between two coordinate systems.
The change of basis matrix is computed as the relative transformation from the initial coordinate system to the final coordinate system.
- Parameters:
initial (np.ndarray) – The initial 4x4 matrix representing the initial coordinate system.
final (np.ndarray) – The final 4x4 matrix representing the final coordinate system.
as_array (bool, optional) – If True, returns the matrix as a NumPy array; otherwise, returns a sympy.Matrix (default is False).
- Returns:
The change of basis matrix between the initial and final coordinate systems.
- Return type:
Union[sympy.MatrixBase, np.ndarray]
- get_inverse()[source]
Generate the inverse of the current TransformationMatrix.
The inverse transformation matrix swaps the initial and final coordinate systems, or directly computes the inverse of the provided matrix.
- Returns:
A new instance of TransformationMatrix representing the inverse transformation.
- Return type:
- get_matrix()[source]
Retrieve the transformation matrix.
If the transformation matrix was explicitly provided during initialization, it is returned. Otherwise, it is computed as the change of basis matrix between the initial and final coordinate systems.
- Returns:
The transformation matrix as a symbolic sympy.Matrix.
- Return type:
sympy.MatrixBase
- get_matrix_inverse()[source]
Retrieve the inverse of the transformation matrix.
If the transformation matrix was explicitly provided during initialization, its inverse is computed. Otherwise, the inverse is calculated as the change of basis matrix between the final and initial coordinate systems.
- Returns:
The inverse transformation matrix as a symbolic sympy.Matrix.
- Return type:
sympy.MatrixBase