poseofPSanalyze

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - 4Bar/Linkages
Introduced first in SolidGeometry 4.4, Creation date: 2019-01-27, Last change: 2025-09-14

returns a Pose and a CPL from an analyzeed 3 Pose Polygon

Description

Auxiliary function to automatically select contours and creates poses from them

See Also: PSanalyze , TofPose , Posesample , Poseplot , Posenorm , Poseui

Example Illustration

 missing image of poseofPSanalyze(XX,i)

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

Output Results

Algorithm Steps

  1. Convert the XX.id field into an array using elem2array.
  2. Find the maximum value in this array, a.
  3. 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.
  4. Extract the subset YY from XX where the element equals i.
  5. Extract the subset ZZ from XX where the element is not equal to 1, and convert it to an array of poses.
  6. 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.
  7. Extract the vertices of the first element in YY to form CPL.
  8. 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.
  9. Assign CPL to PS.CPL.
  10. 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