Syntax
SG=SGboxradial([siz,rrr,ddd])
Input Parameter
siz : | | [x y z] size |
rrr : | | radius for radial edges;de fault is 2 |
ddd : | | optional extrusion direction; default is 'z' |
Output Parameter
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 is a MATLAB function named SGboxradial
that creates a 3D geometric shape with radial edges. It is part of the SolidGeometry library.
Input Parameters
- siz: A vector [x y z] representing the size of the box. Default is [30 20 10].
- rrr: The radius for the radial edges. Default is 2.
- ddd: The direction of extrusion, which can be 'x', 'y', or 'z'. Default is 'z'.
Output
- SG: The resulting 3D shape with radial edges.
Algorithm Steps
- Retrieve the input parameters
siz
, rrr
, and ddd
using the getfuncparams
function, with default values if not provided.
- Use a
switch
statement to determine the extrusion direction based on ddd
:
- Case 'z':
- Create a 2D square profile using
PLsquare
with dimensions siz([1 2])
.
- Convert the profile to a closed polyline using
CPLofPL
.
- Add radial edges to the polyline using
PLradialEdges
with radius rrr
.
- Extrude the polyline in the 'z' direction using
SGofCPLextrude
with height siz(3)
.
- Case 'y':
- Create a 2D square profile using
PLsquare
with dimensions siz([1 3])
.
- Convert the profile to a closed polyline using
CPLofPL
.
- Add radial edges to the polyline using
PLradialEdges
with radius rrr
.
- Extrude the polyline in the 'y' direction using
SGofCPLextrude
with height siz(2)
.
- Case 'x':
- Create a 2D square profile using
PLsquare
with dimensions siz([2 3])
.
- Convert the profile to a closed polyline using
CPLofPL
.
- Add radial edges to the polyline using
PLradialEdges
with radius rrr
.
- Extrude the polyline in the 'x' direction using
SGofCPLextrude
with height siz(1)
.
- Otherwise:
- Display an error message if the extrusion direction is not 'x', 'y', or 'z'.
- Translate the shape to the origin using
SGtrans0
.
- Create a basic box shape using
SGbox
with the given size siz
.
- Copy the radial shape onto the basic box using
SGTcopy
.
- If no output is requested, plot the shape using
SGfigure
and SGTplotalpha
.
Algorithm explaination created using ChatGPT on 2025-08-19 01:07. (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