Syntax
SG=SGtrapezoid([r,h,rad,n])
Input Parameter
r : | | [rin rout] |
h : | | height |
rad : | | radial edges radius |
n : | | number of points on the rotation circle |
Output Parameter
Examples
SGtrapezoid(1);
SGtrapezoid([1 2]);
SGtrapezoid([2 1],'','',4);
SGtrapezoid([2 1],5,2);
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, SGtrapezoid, is designed to create trapezoid pins for molding forms. It is part of the SolidGeometry library and was introduced in version 4.8. The function takes several input parameters and returns a solid geometry object.
Input Parameters
- r: A vector [rin, rout] representing the inner and outer radii. If a scalar is provided, it is converted to a vector [r*0.8, r].
- h: The height of the trapezoid. If not specified, it defaults to 5 times the inner radius.
- rad: The radius of the radial edges. Defaults to 0.5 if not specified.
- n: The number of points on the rotation circle. If not specified, it defaults to an empty value.
Algorithm Steps
- Retrieve the input parameters using the
getfuncparams
function. This function checks the provided arguments and assigns default values if necessary.
- If the radius
r
is a scalar, convert it to a vector [r*0.8, r].
- Define the polygonal line (PL) for the trapezoid using the radii and height:
PL = [0 0; r(1) 0; r(2) h/2; r(1) h; 0 h]
.
- Plot the initial polygonal line using
PLplot(PL)
.
- Apply radial edges to the polygonal line using
PLradialEdges(PL, rad)
.
- Create the solid geometry by rotating the polygonal line using
SGofCPLrot(PL, n)
.
- If no output is requested, display the geometry using
SGfigure
, set the view angle, plot the geometry with transparency, and apply a metal material appearance.
Output
The function returns a solid geometry object SG
representing the trapezoid pin.
Algorithm explaination created using ChatGPT on 2025-08-19 00:22. (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