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
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
- RI: Inner radius of the kidney shape.
- RO: Outer radius of the kidney shape.
- w: Angle of the circular segment. Default is Ã/2 if not provided.
- n: Number of points per element. Default is determined automatically if not provided.
Output
- PL: A list of points representing the kidney shape.
Algorithm Steps
- Calculate the radius difference:
Rc = (RO - RI) / 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.
- Determine the default number of points
n
using the function nofrd(RO)
. If a fourth argument is provided, update n
with its value.
- Create two circular segments using
PLcircseg
for the inner and outer radii, from -w
to +w
. The outer segment is flipped upside down.
- Generate a circle with radius
Rc
and n
points using PLcircle
, and translate it to the position [RI + Rc, 0]
using PLtransP
.
- Combine the segments and translated circle using
CPLbool
with the '+' operation, rotating the circle by w
and -w
using PLtransR
and rot
.
- Check the orientation of the combined point list
CPL
using CPLisccw
. If it is not counter-clockwise, flip it upside down.
- Remove the last point to open the contour, as the function is called
PLkidney
.
- 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