textCPS

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 4.5, Creation date: 2019-02-15, Last change: 2025-09-14

writes text descriptors to CLPS



See Also: textT , textP , textVL , textCVL , textVLFL , VLFLfaceNormalplot , textVL

Example Illustration

 missing image of textCPS(CPS,c,s,nt,lb)

Syntax

h=textCPS(CPS,[c,s,nt,lb])

Input Parameter

CPS: CPS
c: color
s: size
nt: selector
lb: text

Output Parameter

h: handle to text

Examples


SGfigure; CPSplot(CPLsample(29)); CPS=CPSofgca; textCPS(CPS)




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, textCPS, is designed to write text descriptors to a given CPS (Closed Polygon Shape) object. It is part of the SolidGeometry library and was introduced in version 4.5. The function takes several input parameters and returns a handle to the text object created.

Input Parameters

Algorithm Steps

  1. Check if CPS is numeric. If so, convert it to a polyshape object without simplifying it.
  2. If CPS is a structure with a field 'ps', extract CPS.ps.
  3. If CPS contains only one element, convert it to its regions.
  4. Determine the number of regions, nc, in CPS.
  5. Retrieve optional parameters c, s, nt, and lb using getfuncparams with default values.
  6. Initialize a matrix PL to store the first vertex of each region's outer boundary.
  7. Loop through each region in CPS:
  8. Call textVL with PL, c, s, nt, and lb to create the text descriptors.
  9. Return the handle h to the created text object.
Algorithm explaination created using ChatGPT on 2025-08-19 00:18. (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