Syntax
SG=SGhook4rail([DR,WS,DL])
Input Parameter
DR : | | Diameter of Rail; default is 30mm |
WS : | | Wall size; default is DR/3 |
DL : | | Elongation for hook; default is DR/2 |
Output Parameter
Examples
SGhook4rail(30,6,'','Biker''s Dream'); SG=ans
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 generates a solid model of a rail hook using specified parameters. The function SGhook4rail
is designed to create a hook that can be used for applications such as hanging a motorcycle helmet on a 30mm IKEA rail.
Input Parameters
- DR: Diameter of the rail. Default value is 30mm.
- WS: Wall size of the hook. Default value is one-third of the rail diameter (DR/3).
- DL: Elongation for the hook. Default value is half of the rail diameter (DR/2).
- NM: Name or text to be added to the hook. Default is an empty string.
Algorithm Steps
- Retrieve input parameters using
getfuncparams
function, with default values if not provided.
- Calculate the outer diameter
DO
as DR + 2 * WS
.
- Create the inner contour of the hook using
PLcircleoval
with a radius of DR/2
and a length of 2*DR + DL
.
- Create the outer contour using
PLcircleoval
with a radius of DO/2
and the same length.
- Combine the inner and outer contours into a single contour list
CPL
.
- Remove the opening from the contour using
PLsquare
and CPLsubtract
.
- Adjust the edges of the contour using
CPLradialEdges
.
- Create the solid model of the hook using
SGofCPLzchamfer
with the contour list and a chamfer radius of DR/2
.
- If a name
NM
is provided, create a text solid using SGoftext
and transform it using SGtransrelSG
.
- Concatenate the text solid with the hook solid using
SGconcat
.
- If no output is specified, plot the hook using
SGfigure
, CPSplot
, and SGplotalpha
.
Algorithm explaination created using ChatGPT on 2025-08-19 08:25. (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