PLkidney

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - PL/Point Lists
Introduced first in SolidGeometry 2.6.1, Creation date: 2015-09-21, Last change: 2025-09-14

returns a kindey shaped point list

Description

Tim Lueth's primitive version of Yannick Krieger's advanced kidney function

See Also: PLcircle , PLcircseg , PLevolvente , PLgearDIN , PLrand , PLspiral , PLsquare , PLstar

Example Illustration

 missing image of PLkidney(RI,RO,w,n)

Syntax

PL=PLkidney(RI,RO,[w,n])

Input Parameter

RI: Inner radius
RO: Outer Radius
w: angle of circular segment
n: number of points per element;default is '' = auto

Output Parameter

PL: Point List

Examples


PLkidney(40,60,pi/2,40)
PLkidney(40,60,100,40)
PLkidney(2,10,pi,10)




Copyright 2015-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, PLkidney, generates a kidney-shaped point list. It is a simplified version of a more advanced function by Yannick Krieger, created by Tim Lueth.

Input Parameters

Output

Algorithm Steps

  1. Calculate the radius difference: Rc = (RO - RI) / 2.
  2. Set the default angle w to À/2. If a third argument is provided, update w with its value. Divide w by 2 for further calculations.
  3. Determine the default number of points n using the function nofrd(RO). If a fourth argument is provided, update n with its value.
  4. Create two circular segments using PLcircseg for the inner and outer radii, from -w to +w. The outer segment is flipped upside down.
  5. Generate a circle with radius Rc and n points using PLcircle, and translate it to the position [RI + Rc, 0] using PLtransP.
  6. Combine the segments and translated circle using CPLbool with the '+' operation, rotating the circle by w and -w using PLtransR and rot.
  7. Check the orientation of the combined point list CPL using CPLisccw. If it is not counter-clockwise, flip it upside down.
  8. Remove the last point to open the contour, as the function is called PLkidney.
  9. If no output is requested, visualize the point list using PLFLofCPLdelaunay and enable the axis.
Algorithm explaination created using ChatGPT on 2025-08-19 07:29. (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