Syntax
[CPLN,CPL,nn]=CPLradialslots([Riw,ls,nmax,off])
Input Parameter
Riw : | | [Ri Ro] |
ls : | | length of the slot |
nmax : | | maximum number of slots |
off : | | offset angle |
Output Parameter
CPLN : | | Complete Conotur |
CPL : | | 1st Segment |
nn : | | |
Examples
CPLradialslots([28 29],10,5),1)
Copyright 2024-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, CPLradialslots
, generates a rotating circle segment contour for socket connectors. It is part of the SolidGeometry library and is designed to create closed polygon lists.
Input Parameters
- Riw: A vector [Ri, Ro] where Ri is the inner radius and Ro is the outer radius. The function sorts these values to ensure Ri is the smaller value.
- ls: The length of the slot.
- nmax: The maximum number of slots allowed.
- off: The offset angle for the slots.
Output Results
- CPLN: The complete contour of the slots.
- CPL: The first segment of the contour.
- nn: The actual number of slots used.
Algorithm Steps
- Retrieve and sort the input parameters using
getfuncparams
. Default values are provided if not specified.
- Calculate the difference
d
between the outer and inner radii.
- Determine the maximum number of slots
nn
that can fit around the circle using the formula floor(2*pi*Ri/ls)
. If this exceeds nmax
, set nn
to nmax
.
- Calculate the angular width
w
of each slot using 2*pi*ls/(2*pi*Ri)
.
- Set the offset angle
off
using getfuncparams
, defaulting to -w/2
.
- Create the contour
CPL
by generating two circles: one at radius Ri+d
and another at Ri
, with the specified width and offset.
- Generate the complete contour
CPLN
by copying and rotating the initial contour CPL
using CPLcopyunionradial
and CPLradialEdges
.
- If no output arguments are specified, plot the results using
SGfigure
, CPSplot
, CPLplot
, and SGplotalpha
.
Algorithm explaination created using ChatGPT on 2025-08-19 07: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