Syntax
PLK=PLknurled([R,n,k,m])
Input Parameter
R : | | Radius os sequence of Radius (SGLib 5.4) |
n : | | nofrd(R) |
k : | | number of waves |
m : | | offset to R; default is R/20 |
Output Parameter
PLK : | | CPLof of knureld contour |
Examples
PLknurled(5)
PLstar(5,100,'','','',0.95);
PLknurled([20 18]-1,'',8,1) & Outer Radus is 20 or 18
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, PLknurled
, generates a sinusoidal contour on a circle. It is part of the SG-Library and was introduced in SolidGeometry 4.9. The function is used in SGDIN464 and was created by Tim Lueth.
Input Parameters
- R: Radius or sequence of radii. If multiple radii are provided, the function processes each one separately.
- n: Number of points on the circle. If not provided, it is calculated using the function
nofrd(m)*k
.
- k: Number of waves in the sinusoidal pattern. If not provided, it defaults to
ceil(32 + l/10)
, where l
is the circumference of the circle.
- m: Offset to the radius, defaulting to
R/20
.
Output
- PLK: A closed polygon list (CPL) representing the knurled contour.
Algorithm Steps
- Retrieve the input parameters using
getfuncparams
. If parameters are not provided, default values are used.
- Calculate the circumference
l
of the circle using 2 * pi * R
.
- If multiple radii are provided, iterate over each radius and recursively call
PLknurled
for each one. Concatenate the results, separating them with NaN
values.
- If a single radius is provided, generate a circle using
PLcircle
with n
points.
- Calculate the angular positions
w
for each point on the circle.
- Convert the Cartesian coordinates of the circle to polar coordinates
(t, r)
.
- Apply a sinusoidal offset
s
to the radius r
using sin(w * k) * m
.
- Convert the modified polar coordinates back to Cartesian coordinates
(x, y)
.
- Store the result in
PLK
.
- If no output is requested, plot the result using
SGfigure
and CPSplot
.
Algorithm explaination created using ChatGPT on 2025-08-19 01:33. (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