Syntax
[PS,CPL]=poseofPSanalyze(XX,i)
Input Parameter
XX : | | Result of PSanalyze |
i : | | optional selection if there several polygon as set of at least 3 copies |
Output Parameter
PS : | | PS.A start points PS.B end Point PS.CPL moving CPL. |
CPL : | | Kontour of a CPL that exist at least 3 times |
Examples
XX=PSanalyze; XX.id
poseofPSanalyze(XX); PS=ans;
Copyright 2019-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, poseofPSanalyze
, is designed to process the output of the PSanalyze
function and extract specific pose information from it. The function takes two input parameters and provides two output results.
Input Parameters
- XX: This is the result of the
PSanalyze
function. It contains data about analyzed polygons.
- i: This is an optional parameter used to select a specific polygon if there are multiple sets of at least three copies.
Output Results
- PS: This is a structure containing:
PS.A
: Start points of the pose.
PS.B
: End points of the pose.
PS.CPL
: The moving contour polygon line (CPL).
- CPL: The contour of a CPL that exists at least three times.
Algorithm Steps
- Convert the
XX.id
field into an array using elem2array
.
- Find the maximum value in this array,
a
.
- Iterate from 1 to
a
to find the first index i
where the sum of elements equals 3. This indicates a set of three polygons.
- Extract the subset
YY
from XX
where the element equals i
.
- Extract the subset
ZZ
from XX
where the element is not equal to 1, and convert it to an array of poses.
- Initialize
CPLB
based on the number of elements in ZZ
. If there is only one element, set CPLB
to its vertices. Otherwise, concatenate the vertices of each element, separated by NaN
values.
- Extract the vertices of the first element in
YY
to form CPL
.
- For each of the first three elements in
YY
:
- Set
PS.A
to the translation component of the transformation matrix T
.
- Set
PS.B
to the translation component plus the first column of T
.
- Transform
CPL
using the transformation matrix T
and store it in CPLi
.
- Assign
CPL
to PS.CPL
.
- If no output arguments are specified, plot the pose and the contour using
SGfigure
, Poseplot
, and CPLplot
.
Algorithm explaination created using ChatGPT on 2025-08-19 08:10. (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