Syntax
cs=colofPose(cs4Bar)
Input Parameter
cs4Bar : | | color string using 4Bar link/area desciption letters such as 'E--' for effector dashed |
Output Parameter
cs : | | that uses standard Matlab colors such as 'r--' |
Examples
cla; CPSplot(PLcircle(10),colofPose('W')); shg
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)
The function colofPose
is designed to convert a color string that uses specific 4Bar link/area description letters into standard MATLAB color codes. This function is part of the SG-Library and was introduced in SolidGeometry 5.1.
Input Parameters
- cs4Bar: A color string using 4Bar link/area description letters. For example, 'E--' represents an effector with a dashed line style.
Output Results
- cs: A color string that uses standard MATLAB colors, such as 'r--' for red with a dashed line style.
Algorithm Explanation
The function colofPose
uses the strrepn
function to replace specific characters in the input string cs4Bar
with corresponding MATLAB color codes. The replacements are as follows:
- 'E' (Effector) is replaced with 'g' (green).
- 'C' (Crank) is replaced with 'b' (blue).
- 'S' (Swing) is replaced with 'c' (cyan).
- 'W' (Restricted area) is replaced with 'r' (red).
- 'G' (Ground) is replaced with 'y' (yellow).
The function does not contain any switch conditions, so the explanation is limited to the character replacements performed by strrepn
.
Algorithm explaination created using ChatGPT on 2025-08-18 23:14. (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