Syntax
[A,B]=SGattach2SG(A,B)
Input Parameter
A : | | Solid A to attach to Solid B |
B : | | Solid B |
Output Parameter
Examples
load JACO_robot.mat
SGattach2SG(JC1,JC2)
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 is designed to attach two solid objects, A and B, by aligning their surfaces using frames. The process involves several steps and parameters, which are detailed below.
Input Parameters
- A: The first solid object to be attached to solid B.
- B: The second solid object to which solid A will be attached.
- varargin: Additional optional parameters that can be passed to the function.
Output Results
- A: The modified solid A after attachment.
- B: The modified solid B after attachment.
Algorithm Steps
- Initialize Parameters: The function begins by setting the variable
fname
to 'ATTACH'. It then retrieves additional parameters using the getfuncparams
function:
usez:
A boolean parameter indicating whether to use the z-axis, retrieved from the first optional parameter.
minmaxR:
A range of radii, retrieved from the second optional parameter, with a default value of [1.0, inf].
- Calculate Bounding Box: The function calculates the bounding box of solid A using
sofBB(A)
.
- Transform Solid A: Solid A is transformed relative to solid B using the
SGtransrelSG
function, aligning their centers and right sides.
- Set Radii Limits: The function sets the radii limits for both solids A and B using the
SGTsetofRL
function, which is crucial for handling large radii, especially for tubular structures.
- Register Frames: The function registers frames for the attachment using
SGTregisterframes
, which aligns the frames of solids A and B based on the specified parameters.
- Apply Transformation: The transformation matrix
T
obtained from the frame registration is applied to solid A using SGtransT
.
- Visualization: The function visualizes the attachment process by plotting the solids using
SGfigure
and SGTplotalpha
, with solid B in white and solid A in green. Annotations are added to indicate which solid is which.
Algorithm explaination created using ChatGPT on 2025-08-19 06:44. (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