Syntax
CPL=CPLxor(A,B);
Input Parameter
Output Parameter
Examples
CPLxor(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 algorithm performs a Boolean exclusive OR (XOR) operation on two closed polygon lists (CPLs), A and B. The function is part of the SolidGeometry library and is designed to handle geometric operations on polygons.
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 XOR operation.
Algorithm Steps
- Check if there are any additional transformation parameters in
varargin
. If present, apply a relative transformation to B using CPLtransrelCPL
.
- Repair both CPLs A and B using the
CPLrepair
function to ensure they are in a suitable state for Boolean operations.
- Perform the XOR operation on the repaired CPLs A and B using the
CPLbool
function with the 'xor' operation type.
- Repair the resulting CPL to ensure it is in a valid state.
- If no output is requested (i.e.,
nargout==0
), visualize the operation:
- Open a new figure with a top-down view.
- Plot CPL A in green, CPL B in red, and the resulting CPL in magenta.
- Annotate the plot to indicate that the magenta color represents the intersection.
Algorithm explaination created using ChatGPT on 2025-08-19 00:11. (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