Syntax
CPLN=CPLcopyunionradial([CPL,ofs,n])
Input Parameter
CPL : | | Contour to copy; default is PLsquare (2 10) |
ofs : | | Radius; offset in [x and y] default is [0 8] |
n : | | radius segments; default is 16 |
Output Parameter
Examples
CPLcopyunionradial(PLsquare([2 10]),[0 8],16)
CPLcopyunionradial(PLsquare([2 10]),[3 8],16)
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 algorithm is designed to create radial copies of a given contour and unify them into a single contour. It is part of the SolidGeometry library and is implemented in MATLAB.
Input Parameters
- CPL: The contour to be copied. If not provided, the default is a square defined by
PLsquare([2 10])
.
- ofs: The offset radius in the x and y directions. The default value is
[0 8]
.
- n: The number of radial segments. The default value is
16
.
Output
- CPLN: The final unified contour after all radial copies have been created and merged.
Algorithm Steps
- Initialize
CPLN
as an empty list to store the final contour.
- Loop over each segment from
0
to n-1
:
- Calculate the rotation angle for the current segment as
-rot(2*pi/n*i)
.
- Translate the original contour
CPL
by the offset ofs
and rotate it by the calculated angle using PLtransR
.
- Unify the transformed contour
CPLi
with the current CPLN
using CPLunion
.
- After the loop, if no output argument is specified, plot the final contour
CPLN
in green and the original contour CPL
in red using SGfigure
and CPLplot
.
Example Usage
Two example calls to the function are provided:
CPLcopyunionradial(PLsquare([2 10]),[0 8],16)
CPLcopyunionradial(PLsquare([2 10]),[3 8],16)
These examples demonstrate how to use the function with different offsets.
Algorithm explaination created using ChatGPT on 2025-08-19 00:30. (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