Syntax
SGN=SGshearing(SG,[PL,dd])
Input Parameter
SG : | | Solid Geometry |
PL : | | point list; if scalar the value describes the delta |
dd : | | direction such as 'xz' or 'yz' |
Output Parameter
Examples
SGshearing(SGbox,10,'xz');
SGshearing(SGbox,10,'yz');
SGshearing( SGtetramesh(SGbox),PLcircle(20,'',pi),'xz'); % bending in x
SGshearing( SGtetramesh(SGbox),PLcircle(20,'',pi),'yz'); SG=ans; % bending in y
SGremsurfedgepoints(SG)
Copyright 2022-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, SGshearing, is designed to perform shearing or bending operations on a Solid Geometry (SG) object. Below is a detailed explanation of the algorithm and its parameters.
Input Parameters
- SG: The Solid Geometry object to be sheared or bent.
- PL: A point list. If provided as a scalar, it represents the delta value for shearing.
- dd: The direction of shearing, specified as 'xz' or 'yz'.
Output
- SGN: The resulting sheared Solid Geometry object.
Algorithm Steps
- Check if the 'mesh' parameter is present in the input arguments using
getfuncparamStr
. If true, convert SG to a tetrahedral mesh using SGtetramesh
.
- Extract the point list (PL) and direction (dd) from the input arguments using
getfuncparams
.
- If PL is a scalar, calculate the bounding box of SG using
BBofSG
and set PL based on the direction (dd):
- Case 'xz': PL is set to
[bb(1) 0; bb(2) PL]
.
- Case 'yz': PL is set to
[bb(3) 0; bb(4) PL]
.
- Otherwise: An error is thrown if the direction is unsupported.
- Initialize SGN as a copy of SG. Extract X, Y, and Z coordinates from SG's vertex list (VL).
- Perform shearing based on the direction (dd):
- Case 'xz': Calculate the shearing effect using
linearinterp
on PL and X, then update Z coordinates.
- Case 'yz': Calculate the shearing effect using
linearinterp
on PL and Y, then update Z coordinates.
- Otherwise: An error is thrown if the direction is unsupported.
- Update SGN's vertex list with the new X, Y, and Z coordinates.
- If the 'mesh' parameter was true, remove surface edge points from SGN using
SGremsurfedgepoints
.
- If no output is requested, plot the original and sheared geometries using
SGfigure
and SGplotalpha
.
Algorithm explaination created using ChatGPT on 2025-08-19 08:24. (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