fourbarposesearchcouplercurve

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - 4Bar/Linkages
Introduced first in SolidGeometry 5.2, Creation date: 2022-03-03, Last change: 2025-09-15

sorts 4bar solutions wrt minimal distance of coupler path to a given set of points

Description

The solutions are sorted by the square distance to points of the point list CPLF. If only the start and end points of a straight line are specified, then only these two points are optimized. If you want to search a straight line, then many points must lie on this straight line. For this you can use PLaddauxpoints, RLaddauxpoints, CPLaddauxpoints. The point distribution can also be used to achieve a weighting of the locality fidelity by allowing the important points to occur more frequently in the point list.
Since the Points of CPLF are used to calculate the minimal distance, the non fitting part of the Pose does not disadvantage a solution
it is also possible to add an angle diffence list

See Also: fourBarposesyntheses , fourBarposesortsolution , fourBarposeplotsolution

Example Illustration

 missing image of fourbarposesearchcouplercurve(PS,CPLF,acc,rots)

Syntax

[PSX,di]=fourbarposesearchcouplercurve(PS,[CPLF,acc,rots])

Input Parameter

PS: Pose struct
CPLF: Point List or contour considered as SET of points!
acc: [min max]; default is [0 inf]
rots: true==rotating, false=non rotating; default is ''

Output Parameter

PSX: Pose struct sorted by minimal square distance
di: sum of minimal square distance

Examples


Posesample(29); PS=ans; % Just squares
Posesample(29); PS=ans; fourBarposesyntheses(PS,1,[16]);PS=ans; % 57104 solution were found using 1-Pose-Synthesis.
CPLF=[0 0 ; 30 30]; fourbarposesearchcouplercurve(PS,CPLF); PSX=ans; SGfigure;PLplot(CPLF,'b-',2); fourBarposeplotsolution(PSX,1,'animate')
SGfigure; PLplot(CPLF,'k-',2);PLplot(CPLF([1,end],:),'k*',2); fourBarposeplotsolution(PSX,1,'animate');
CPLF=[-0 -0 ; 10 20; 30 30]; CPLF=PLaddauxpoints(CPLF,5); fourbarposesearchcouplercurve(PS,CPLF); PSX=ans;
CPLF=PLcircle(50,'',pi/2)+[10 20]; fourbarposesearchcouplercurve(PS,CPLF); PSX=ans;
CPLF=PLcircle(50,'',pi/2)+[10 20]; fourbarposesearchcouplercurve(PS,CPLF,[1 5],true); PSX=ans; % only rotating




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

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