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
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
- CPS: An optional polyshape input. If provided, it should be a numeric array with more than one element. If not provided, an empty array is assumed.
- col: An optional color parameter. The default value is 'r' (red).
- linw: An optional line width parameter. The default value is 2.
Output
- CPS: The final polyshape after modifications.
Algorithm Steps
- 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.
- Retrieve the second input parameter,
col
, using getfuncparams
. If not provided, default to 'r'.
- Retrieve the third input parameter,
linw
, using getfuncparams
. If not provided, default to 2.
- 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
.
- Call
VLui
with the CPL
, color, and line width parameters to allow interactive modifications.
- Convert the modified
CPL
back to a polyshape without simplifying it.
Mouse Interactions
- Left Mouse Button: Set, remove, and shift points.
- Right Mouse Button: Shift at edges and rotate at corners.
- Middle Mouse Button: Exit the interactive mode.
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