PoseofCPLcutui
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - 4Bar/Linkages
Introduced first in SolidGeometry 4.9, Creation date: 2020-08-16, Last change: 2025-09-14
allows the interactive shaping and move of poses of contours
Description
This function is helpful if you want to cut out from a background
used first in exp_2019_01_27_chair
See Also: Poseofimageui
, Poseorderchange
, Posetransui
, PoseofCPLui
Example Illustration
Syntax
PS=PoseofCPLcutui(CPL,[CPLW])
Input Parameter
CPL: | | Effektor contour |
CPLW: | | Background Contour |
Output Parameter
PS: | | Pose Struct include A, B, CPLE, CPLB, CPLW |
Examples
CPL=PLcircle(70,'','',80); CPLW=PLcircle(60,'','',70); CPL=[CPL; nan nan; CPLW];
PoseofCPLcutui (CPL,CPLW); PS=ans
Copyright 2020-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, PoseofCPLcutui, is designed to interactively shape and move poses of contours, specifically for cutting out an effector contour from a background contour. It is part of the SolidGeometry library and was introduced by Tim Lueth.
Input Parameters
- CPL: The effector contour, which is the main shape to be manipulated or cut out.
- CPLW: The background contour, which serves as the backdrop from which the effector contour is cut out. This parameter is optional and can be provided through
varargin.
Output Results
- PS: A structure containing the following fields:
- A: Not explicitly defined in the code, but typically part of the pose structure.
- B: Not explicitly defined in the code, but typically part of the pose structure.
- CPLE: The effector contour after processing.
- CPLB: The background contour after processing.
- CPLW: The original background contour.
Algorithm Steps
- Retrieve the background contour
CPLW from the input parameters using getfuncparams.
- Initialize a new figure using
SGfigure and plot the effector contour CPL in red using CPLplot.
- Create a polygon shape from
CPL using polyshape and plot it in blue with CPSplot.
- Plot the background contour
CPLW in red.
- Add an annotation to the figure to guide the user in defining a contour to cut out the effector from the background.
- Split the contour
CPL into background and effector parts using CPLsplitbool, resulting in CPLB and CPLE.
- Clear the current plot and re-plot
CPLE in green and CPLB in black.
- Store
CPLW, CPLB, and CPLE in the output structure PS.
- Attempt to call
PoseofCPLui with CPLE, CPLB, and CPLW to further process the contours. If an error occurs, it is caught and ignored.
- Ensure
CPLB and CPLW are stored in PS after the attempt.
Algorithm explaination created using ChatGPT on 2025-08-19 07:00. (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