Syntax
CVL=CVLofCPLbendsinus(CPL,[dim,hwv,scl])
Input Parameter
CPL : | | CPL |
dim : | | wave dimension; default is 'x' |
hwv : | | number of sin waves; default is 1 |
scl : | | default is sofCPL/10 |
Output Parameter
Examples
CVLofCPLbendsinus(CPLaddauxpoints(CPLsample(37),1),'',1);
CVLofCPLbendsinus(CPLaddauxpoints(CPLsample(37),1),'x',.5,50); % strong bending
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)
This function, CVLofCPLbendsinus
, is designed to apply a sinusoidal wave transformation to a Closed Polygon List (CPL) and return a Closed Vertex List (CVL). The function is part of the SolidGeometry library and was introduced in version 5.0.
Input Parameters
- CPL: The Closed Polygon List to be transformed.
- dim: The dimension along which the wave is applied. The default is 'x'.
- hwv: The number of sine waves to apply. The default is 1.
- scl: The scale of the wave, defaulting to one-tenth of the size of the bounding box of the CPL.
Output
- CVL: The resulting Closed Vertex List after applying the sinusoidal transformation.
Algorithm Steps
- Calculate the size and bounding box of the CPL using
sofBB
and BBofCPL
.
- Retrieve the parameters
dim
, hwv
, and scl
using getfuncparams
, with defaults as specified.
- Initialize the CVL by adding a zero z-coordinate to the CPL using
VLaddz
.
- Determine the minimum x-coordinate in the CVL and the corresponding minimum z-coordinate.
- Apply a sinusoidal transformation to the z-coordinates of the CVL based on the x-coordinates, using the formula:
scl * sin((CVL(:,1) - mx) / ss(1) * 2 * pi * hwv)
.
- Optionally, plot the transformed CVL and the original CPL if no output is requested, using
SGfigure
, CVLplot
, and CPLplot
.
Example Usage
Two examples are provided to demonstrate the function:
CVLofCPLbendsinus(CPLaddauxpoints(CPLsample(37),1),'',1);
- Applies a default wave transformation.
CVLofCPLbendsinus(CPLaddauxpoints(CPLsample(37),1),'x',.5,50);
- Applies a strong bending with specified parameters.
Algorithm explaination created using ChatGPT on 2025-08-19 06:43. (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