SGgetCenterPoint

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 3.1, Creation date: 2016-12-04, Last change: 2025-09-14

returns a point in the center of all vertices

Description

used as simple mass center approximation. At later stage it makes sense to calculate it using SGarea and facet based

See Also: SGarea

Example Illustration

 missing image of SGgetCenterPoint(A)

Syntax

p=SGgetCenterPoint(A)

Input Parameter

A: Solid Geoemtry

Output Parameter

p: point




Copyright 2016-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, SGgetCenterPoint, calculates the center point of a solid geometry based on its vertices. It is a simple approximation of the mass center.

Input Parameters

Output Results

Algorithm Steps

  1. Calculate the bounding box of the vertices using the function BBofVL(A.VL). This function returns the minimum and maximum coordinates in each dimension.
  2. Compute the center point p by averaging all the vertices in A.VL. This is done using the expression p = (sum(A.VL) / size(A.VL, 1)), which sums all vertex coordinates and divides by the number of vertices.
  3. If no output is requested (i.e., nargout == 0), visualize the geometry and the center point:
Algorithm explaination created using ChatGPT on 2025-08-18 23:11. (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