SGaddfacetcenterpoints

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SG/Solids
Introduced first in SolidGeometry 4.9.1, Creation date: 2020-08-24, Last change: 2025-09-14

creates additional vertices in the middle of each facet

Description

the number of facets is length(FL)*3
the number of vertices is length(VL) + length(FL)*3
Poinct cloud of SG

See Also: PCofSG , VLFLaddfacetcenterpoints , SGtetramesh , SGremsurfedgepoints , SGremsurfpoints , SGremedgepoints

Example Illustration

 missing image of SGaddfacetcenterpoints(SG,n,md)

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

SGN: New Solid

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

Output

Algorithm Steps

  1. The function begins by ensuring the input SG is a valid solid geometry object using SGofSG(SG).
  2. It retrieves the parameters n and md using getfuncparams. If these are not provided, default values are used.
  3. 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.
  4. 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:

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