Syntax
PL=PLhook([h,w,o,a,r])
Input Parameter
h : | | height |
w : | | widht |
o : | | overhang |
a : | | angle; default is 45 degree |
r : | | radial edges |
Output Parameter
Examples
PLhook(30,10,[10 1],'',0)
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 algorithm generates the shape of a hook using a closed polygon list. It is part of the SolidGeometry library and was created by Tim Lueth. The function is called PLhook
and it takes several input parameters to define the hook's dimensions and shape.
Input Parameters
- h: Height of the hook. Default value is 20 mm.
- w: Width of the hook. Default value is 5 mm.
- o: Overhang of the hook. It can be a single value or a two-element vector. Default value is [2 1] mm.
- a: Angle of the hook in radians. Default value is Ã/4 (45 degrees).
- r: Radius for radial edges. Default value is 0.5 mm.
Algorithm Steps
- Retrieve the input parameters using the
getfuncparams
function. If a parameter is not provided, use the default value.
- If the overhang
o
is a single value, duplicate it to form a two-element vector.
- Calculate
A
as the horizontal distance from the top of the hook to the overhang using the formula A = o(1)/tan(a)
.
- Create the initial polygon list
PL
that defines the shape of the hook. The points are defined in a clockwise manner starting from the origin (0,0).
- Apply radial edges to the polygon using the
PLradialEdges
function with the specified radius r
.
- Translate the polygon
PL
vertically by subtracting [0 h-A-o(2)]
to adjust its position.
- If no output is requested, plot the hook using
SGfigure
and CPSplot
.
Algorithm explaination created using ChatGPT on 2025-08-19 00:29. (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