Syntax
SGN=SGaddfacetcenterpoints(SG,[n,md])
Input Parameter
SG : | | Original solid |
n : | | recursive number of calls; default is 1 |
md : | | minimum distance between old and new points; default is 0 |
Output Parameter
Examples
A=SGbox([30,20,10]);
SGaddfacetcenterpoints(A);
SGaddfacetcenterpoints(A,5);
SGaddfacetcenterpoints(A,5,5);
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 function, SGaddfacetcenterpoints
, is designed to add additional vertices to a solid geometry object by placing new points at the center of each facet. The function is part of the SolidGeometry library and was introduced in version 4.9.1.
Input Parameters
- SG: The original solid geometry object. It contains vertex and facet lists.
- n: The recursive number of calls. This parameter determines how many times the function will recursively add center points. The default value is 1.
- md: The minimum distance between old and new points. This parameter ensures that new points are not added too close to existing points. The default value is 0.
Output
- SGN: The new solid geometry object with additional vertices at the center of each facet.
Algorithm Steps
- The function begins by ensuring the input
SG
is a valid solid geometry object using SGofSG(SG)
.
- It retrieves the parameters
n
and md
using getfuncparams
. If these are not provided, default values are used.
- The core operation is performed by
VLFLaddfacetcenterpoints
, which calculates the new vertex list (VL
) and facet list (FL
) by adding center points to each facet.
- If no output argument is specified, the function visualizes the new solid using
SGfigure
and SGplotalpha
to plot the solid with specified color and transparency.
Example Usage
Here are some example calls to the function:
A=SGbox([30,20,10]);
- Creates a box solid.
SGaddfacetcenterpoints(A);
- Adds center points to the facets of the box.
SGaddfacetcenterpoints(A,5);
- Recursively adds center points 5 times.
SGaddfacetcenterpoints(A,5,5);
- Adds center points with a minimum distance of 5 units between old and new points.
Algorithm explaination created using ChatGPT on 2025-08-19 01:22. (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