SGshearing

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Surfaces
Introduced first in SolidGeometry 5.2, Creation date: 2022-03-31, Last change: 2025-09-15

shearing or bending of a Solid Geometry



See Also: linearinterp , SGbending , SGofCPLbendonadrum

Example Illustration

 missing image of SGshearing(SG,PL,dd)

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

SGN: Sheared SG

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

Output

Algorithm Steps

  1. Check if the 'mesh' parameter is present in the input arguments using getfuncparamStr. If true, convert SG to a tetrahedral mesh using SGtetramesh.
  2. Extract the point list (PL) and direction (dd) from the input arguments using getfuncparams.
  3. 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.
  4. Initialize SGN as a copy of SG. Extract X, Y, and Z coordinates from SG's vertex list (VL).
  5. 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.
  6. Update SGN's vertex list with the new X, Y, and Z coordinates.
  7. If the 'mesh' parameter was true, remove surface edge points from SGN using SGremsurfedgepoints.
  8. 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