CPSui

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

interactive fnct to create and modify CPLS (Only one Contur)

Description

Left Mouse button => Set remove and shift points by
Right Mouse button => Shift at edges, Rotate at corners
Middle Mouse Button => exit
More or less: CPL=VLui(CPL,'','',col,'',linw);

See Also: VLui , CPSlineui , CPLui , PLui , PLsquareui , PLcircleui , VLFLui , SGui , CPLsplitui , Poseofimageui , Poseui , SGTui

Example Illustration

 missing image of CPSui(CPS,col,linw);

Syntax

CPS=CPSui([CPS,col,linw]);

Input Parameter

CPS: Optional polyshape
col: Optional color; default is 'r'
linw: optional line width; default is 2

Output Parameter

CPS: Final CPS

Examples


cla; CPLui()
cla; CPSui(polyshape(CPLsample(3)))
cla; CPSui(polyshape(CPLsample(3)),'b',3)




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, CPSui, is an interactive tool for creating and modifying closed polygon lists (CPLs) using mouse interactions. It is part of the SolidGeometry library and was introduced in version 4.5.

Input Parameters

Output

Algorithm Steps

  1. Retrieve the first input parameter, CPS, using getfuncparams. If CPS is numeric and has more than one element, convert it to a polyshape without simplifying it.
  2. Retrieve the second input parameter, col, using getfuncparams. If not provided, default to 'r'.
  3. Retrieve the third input parameter, linw, using getfuncparams. If not provided, default to 2.
  4. If CPS is not empty and has more than one element, convert it to a closed polygon list (CPL) using CPLofCPS. Otherwise, use CPS as CPL.
  5. Call VLui with the CPL, color, and line width parameters to allow interactive modifications.
  6. Convert the modified CPL back to a polyshape without simplifying it.

Mouse Interactions

Example Usage

cla; CPLui()
cla; CPSui(polyshape(CPLsample(3)))
cla; CPSui(polyshape(CPLsample(3)),'b',3)
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