Syntax
[SG,FL,FLb]=SGcone(H,[R,nf,Hc])
Input Parameter
H : | | Height |
R : | | Radius; default is H/2 |
nf : | | Number of facets, default is 16 |
Hc : | | height of the Truncated cone |
Output Parameter
SG : | | Vertex list |
FL : | | Facet list of the cone |
FLb : | | Facet list of the bottom |
Examples
SGcone(40,6)
SGcone(40,6,'',10)
Copyright 2017-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, SGcone
, generates a solid geometry of a cone using the parameters provided. It is part of the SG-Library and was developed by Tim Lueth.
Input Parameters
- H: Height of the cone. If not specified, defaults to 20.
- R: Radius of the cone's base. Defaults to half of the height (H/2).
- nf: Number of facets used to approximate the cone's surface. Defaults to 16.
- Hc: Height of the truncated cone. If not specified, defaults to infinity, meaning no truncation.
Output Results
- SG: A structure containing the vertex list of the cone.
- FL: A list of facets that make up the cone's surface.
- FLb: A list of facets that make up the bottom of the cone.
Algorithm Steps
- Retrieve the input parameters using the
getfuncparams
function, which assigns default values if parameters are not provided.
- Call the
VLFLcone
function with the parameters H
, R
, and nf
to generate the vertex list (VL
), facet list (FL
), and bottom facet list (FLb
).
- Store the vertex list in
SG.VL
and combine the facet lists into SG.FL
.
- If
Hc
is less than H
, truncate the cone using the SGcut
function, updating the facet list.
- If no output arguments are specified, plot the cone using
SGfigure
and SGplot
functions with a specific view angle.
Algorithm explaination created using ChatGPT on 2025-08-19 00:24. (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