CPLsplitui

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 4.5, Creation date: 2019-02-09, Last change: 2025-09-14

splits a CPL interactively into two CPLs

Description

same as CPLsplitbool

See Also: CPLsplitbool , VLui , CPSlineui , CPLui , CPSui , PLui , PLsquareui , PLcircleui , VLFLui , SGui , Poseofimageui , Poseui

Example Illustration

 missing image of CPLsplitui(CPLA)

Syntax

[CPLA,CPLB,CPLC]=CPLsplitui(CPLA)

Input Parameter

CPLA: Original Contour

Output Parameter

CPLA: contour left after removal (BLUE)
CPLB: removed contour (RED)
CPLC: contour used to cut (DASHED)

Examples


imreadlastchanged;I=ans; CPLofimage(I); CPL=ans; CPLsplitui(CPL);




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, CPLsplitui, is designed to split a closed polygon list (CPL) interactively into two separate CPLs. It is part of the SolidGeometry library and was introduced in version 4.5.

Input Parameters

Output Results

Algorithm Steps

  1. The function CPLsplitui is called with the original contour CPLA as input.
  2. Internally, the function CPLsplitbool is called twice. The first call is with CPLsub and varargin to obtain CPLsub, CPLxor, and CPLC.
  3. The second call to CPLsplitbool is with CPLA to obtain CPLB, CPLA, and CPLC.
  4. If no output arguments are specified (nargout==0), a new figure is created using SGfigure.
  5. The function CPLplot is used to plot CPLC as a dashed red line.
  6. CPLplotasPS is used to plot CPLB with a red face color, followed by CPLplot to plot it as a solid red line with a thickness of 2.
  7. CPLplotasPS is used to plot CPLA with a blue face color, followed by CPLplot to plot it as a solid blue line with a thickness of 2.

Example Usage

An example of how to use this function is provided:

imreadlastchanged;
I = ans;
CPLofimage(I);
CPL = ans;
CPLsplitui(CPL);

This example reads the last changed image, converts it to a CPL, and then splits it using CPLsplitui.

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