Syntax
[PLs,hp]=PLofhandle(h,[ascell])
Input Parameter
h : | | handle or string such as 'point', 'line', 'text', 'polygon', 'patch' etc. |
ascell : | | result as separeted list; default is false |
Output Parameter
PLs : | | Point lists |
hp : | | handle to objects if input handle was a string |
Examples
SGfigure; PLcircle(1)
PLofhandle('line')
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)
Input Parameters:
- h: A handle or a string representing graphics objects such as 'point', 'line', 'text', 'polygon', 'patch', etc.
- ascell: A boolean indicating if the result should be a separated list. Default is false.
Output Results:
- PLs: Point lists of the graphics objects.
- hp: Handle to objects if the input handle was a string.
Algorithm Steps:
- Retrieve the
ascell
parameter using getfuncparams
, defaulting to false if not provided.
- Determine if
h
is a string. If so, use findingca
to get the handle hp
. Otherwise, set hp
to h
.
- Calculate the number of elements in
hp
and initialize PLs
as a cell array of the same size.
- Iterate over each element in
hp
:
- Extract the X, Y, and Z data from the current handle and store it in
PLi
.
- If the last X value in
PLi
is NaN, remove the last row from PLi
and store it in PLs
. Otherwise, store PLi
as is.
- If
ascell
is false, concatenate all point lists into a single matrix PL
:
- Calculate the total number of rows needed for
PL
, including NaN separators.
- Initialize
PL
with NaN values.
- Iterate over each point list in
PLs
, copying its contents into PL
and adding a NaN row separator.
- Remove the last NaN row from
PL
and set PLs
to PL
.
Algorithm explaination created using ChatGPT on 2025-08-19 08:05. (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