Syntax
SG=SGdumbbell([type])
Input Parameter
type : | | design method such as 'bool' or 'rot' |
Output Parameter
Examples
SGdumbbell
SGdumbbell('bool')
SGdumbbell('rot')
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)
The function SGdumbbell
generates a dumbbell-shaped solid geometry. It accepts an optional input parameter type
which determines the design method. The default value for type
is 'rot'. The function returns a solid geometry object SG
.
Input Parameters
- type: A string that specifies the design method. It can be 'bool' or 'rot'.
Output
- SG: The resulting solid geometry object.
Algorithm Steps
- The function starts by retrieving the
type
parameter using getfuncparams
, defaulting to 'rot' if not provided.
- A
switch
statement is used to handle different design methods based on the type
parameter.
- Case 'bool':
- The function creates a solid geometry using
SGofCPLcommand
with a specific command string that defines the shape.
- The geometry is then processed with
SGsurfacemeltbool
to modify its surface.
- Case 'rot':
- A control point list
CPL
is defined to outline the shape.
SGofCPLrot
is used to create a solid geometry by rotating the control points.
- The geometry is grown using
SGgrow
and combined with the original using SGcat2
.
- Otherwise:
- The same steps as in the 'rot' case are executed.
- The resulting geometry is optimized using
SGshortopti
.
- If no output is requested, the geometry is visualized using
SGfigure
and SGplotsurfaces
.
- The function checks for errors with
SGcheckmeshlab
and rechecks if any errors are found.
Algorithm explaination created using ChatGPT on 2025-08-19 08:18. (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