Syntax
CPL=CPLintersect(A,B);
Input Parameter
Output Parameter
Examples
CPLintersect(PLcircle(10,6),PLcircle(5,6)+[7 0]);
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, CPLintersect
, computes the Boolean intersection of two closed polygon lists (CPLs), A and B. It is part of the SolidGeometry library and was introduced in version 4.9.
Input Parameters
- A: The first closed polygon list (CPL).
- B: The second closed polygon list (CPL).
- varargin: Optional parameters for relative transformation.
Output
- CPL: The resulting CPL after performing the Boolean intersection.
Algorithm Steps
- Check if there are any additional transformation parameters in
varargin
. If present, transform CPL B relative to CPL A using CPLtransrelCPL
.
- Call the function
CPLbool
with the operation 'ISEC' to compute the intersection of CPL A and CPL B.
- If no output is requested (i.e.,
nargout == 0
), visualize the result:
- Open a new figure with
SGfigure
and set the view to top-down (0, 90 degrees).
- Plot CPL A in green, CPL B in red, and the resulting CPL in magenta using
CPLplot
.
- Use
CPSplot
to plot the resulting CPL with specific styling.
- Add a plot annotation to describe the color coding of the plot.
Example
The function can be used as follows: CPLintersect(PLcircle(10,6),PLcircle(5,6)+[7 0]);
This example computes the intersection of two circles, one with a radius of 10 and the other with a radius of 5, where the second circle is translated by 7 units along the x-axis.
Algorithm explaination created using ChatGPT on 2025-08-18 23:34. (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