Syntax
SG=SGofCPLztwist([CPL,z,w])
Input Parameter
CPL : | | CPL (centered at origin) |
z : | | height or [zmin zmax] |
w : | | turning angle |
Output Parameter
Examples
SGofCPLztwist(PLrope([2 0.3],[1 .5],true),10)
SGofCPLztwist(PLrope([2 0.3],[1 .5],false),10)
SGofCPLztwist(PLrope([4 1],[1 .5],true),5)
SGofCPLztwist(PLrope([4 1],[1 .5],false),5)
Copyright 2022-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, SGofCPLztwist, creates twisted solids from a given center profile line (CPL) by applying a series of transformations. It is part of the SolidGeometry library and was introduced in version 5.2.
Input Parameters
- CPL: The center profile line, centered at the origin. It can be a predefined shape or a custom profile.
- z: The height of the solid. It can be a single value or a range [zmin, zmax]. If a single value is provided, it is interpreted as [0, z].
- w: The turning angle for the twist. It can be a single value or a range [wmin, wmax]. If a single value is provided, it is interpreted as [0, w].
Algorithm Steps
- Retrieve the input parameters using the
getfuncparams
function. Default values are provided for each parameter if not specified.
- Calculate the bounding box size
s
of the CPL using sofBB
and BBofCPL
.
- Determine the number of segments
n
required for the twist based on the size s
and the turning angle w
.
- If
n
is zero, adjust the turning angle w
to ensure at least one segment is created.
- Calculate the incremental changes in height
dz
and angle dw
for each segment.
- Initialize a transformation matrix
TL
to store the transformations for each segment.
- Loop through each segment, calculating the transformation matrix using
TofPez
for the current height and angle.
- Apply the transformations to the CPL using
SGofCPLtransT
to create the twisted solid.
- If no output is specified, visualize the result using
SGfigure
and SGTplotalpha
, and annotate the plot with the number of segments.
Algorithm explaination created using ChatGPT on 2025-08-19 08:11. (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