KDWPosevariation

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

returns three variant lists for center3Pose as a first recommendation



See Also: center3Pose

Example Illustration

 missing image of KDWPosevariation(PS,nk,nd,dw)

Syntax

[K,D,W]=KDWPosevariation(PS,[nk,nd,dw])

Input Parameter

PS: Pose to be searched using center3Pose
nk: number if k variants; default is
nd: number of d variants; default is 5
dw: degree resolution ; default is 15

Output Parameter

K: List for k values; default are 40.
D: List for d values; default are 5
W: List for values; ; default are 24 for 15 degree

Examples


PS=Posesample(7);
[K,D,W]=KDWPosevariation(PS); center3Pose(PS.A,PS.B,K,D,W);S=ans; whos S
hideingca('text'); hideingca('polygon');




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)

The function KDWPosevariation generates three variant lists for use with the center3Pose function. It is part of the SG-Library and was introduced in SolidGeometry 4.5.

Input Parameters

Output Results

Algorithm Steps

  1. Retrieve the number of k variants (nk), d variants (nd), and degree resolution (dw) using the getfuncparams function. Default values are used if not provided.
  2. Determine if nk and nd are scalars or arrays. If they are scalars, set default values for nk and nd.
  3. Calculate the number of w variants (nw) as 360 divided by dw.
  4. Check if the PS structure has a field CPLE. If not, create a default contour using PLsquare.
  5. Calculate the bounding box of the contour using BBofCPL and sofBB to get the size s.
  6. Round the size values s(1) and s(2) to two significant figures, storing them in sk and sd respectively.
  7. Generate the list K using a range from -d*sk to d*sk with nk steps.
  8. Generate the list D using a range from -h*sd to h*sd with nd steps.
  9. Generate the list W using a range from -pi to pi with nw steps, slightly adjusted to avoid overlap.

Example Usage

To use the function, you can call it with a pose sample:

PS = Posesample(7);
[K, D, W] = KDWPosevariation(PS);
center3Pose(PS.A, PS.B, K, D, W);
S = ans;
whos S

This example demonstrates how to generate the variant lists and use them with center3Pose.

Algorithm explaination created using ChatGPT on 2025-08-19 07:22. (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