CPLtransrelT

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Spatial Relations
Introduced first in SolidGeometry 5.1, Creation date: 2022-01-31, Last change: 2025-09-15

transform the pose of a CPL from one coordinate system into another

Description

educational function

See Also: CPLanimateTL

Example Illustration

 missing image of CPLtransrelT(CPL,TA1,TA0)

Syntax

[CPLN,T]=CPLtransrelT(CPL,TA1,TA0)

Input Parameter

CPL: Contour for instance a crank
TA1: 2D Frame or Frame list for example the path of the crank point A1
TA0: 2D Frame or Frame list for example the path of the crank origin point A0

Output Parameter

CPLN: Contour to be move using TA0
T: Transformation matrix to covert CPL to CPLN

Examples


CPLtransrelT(CPLC,TA1,TA0);




Copyright 2022-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, CPLtransrelT, transforms the pose of a contour (CPL) from one coordinate system to another using transformation matrices.

Input Parameters

Output Results

Algorithm Steps

  1. Calculate the transformation matrix T by taking the inverse of the first frame of TA0 and multiplying it by the first frame of TA1:
    T = inv(TA0(:,:,1)) * TA1(:,:,1);
  2. Transform the contour CPL using the transformation matrix T to obtain CPLN:
    CPLN = PLtransT(CPL, T);
  3. If no output arguments are specified, visualize the transformation:
    • Plot the original contour CPL in green.
    • Plot the transformed contour CPLN in red.
    • Iterate over each frame in TA1 and TA0 to animate the transformation:
      • Delete previous plots.
      • Plot the transformed contours for each frame in magenta.
      • Update the animation axis and render the frame.
Algorithm explaination created using ChatGPT on 2025-08-19 01:30. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21