Syntax
CPL=SGdimensioningTop(SG,[pnt,acc])
Input Parameter
SG : | | Solid geometry |
pnt : | | crossing point |
acc : | | accuracy; default is 0.1 |
Output Parameter
Examples
SGsample(27); SG=ans;
SGdimensioningTop(SG);
Copyright 2020-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)
The function SGdimensioningTop
is designed to create a top view dimensioning figure for a given solid geometry. Below is a detailed explanation of the algorithm and its parameters:
Input Parameters
- SG: This is the solid geometry input, which is the primary data structure the function operates on.
- pnt: This is the crossing point. It is an optional parameter that defaults to the mean of the vertices of the solid geometry if not provided. If provided as a scalar, it is converted to a 3D point with the format [0, 0, pnt].
- acc: This is the accuracy parameter, which defaults to 0.1 if not specified. It determines the precision of the dimensioning.
Algorithm Steps
- Initialize two angles,
ang1
and ang2
, to 0 and 90 degrees, respectively. These angles are used for the top view dimensioning.
- Retrieve the
pnt
and acc
parameters using the getfuncparams
function. This function checks if the parameters are provided in the varargin
and assigns default values if not.
- If
pnt
is a scalar, convert it to a 3D point by setting it to [0, 0, pnt].
- If
pnt
is empty, calculate the mean of the vertices of the solid geometry SG
and assign it to pnt
.
- Call the function
SGofSG
with SG
as an argument to process the solid geometry.
- Check the number of output arguments using
nargout
:
- If
nargout
is 0, call SGdimensioning
with SG
, ang1
, ang2
, an empty string, and acc
as arguments. Assign the result to CPL
.
- If
nargout
is not 0, call SGdimensioning
with SG
, ang1
, ang2
, pnt
, and acc
as arguments. Assign the result to CPL
.
Output
The function returns CPL
, which is the dimensioning of the top view of the solid geometry.
Algorithm explaination created using ChatGPT on 2025-08-19 00:37. (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