SGarea

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Geometric Queries
Introduced first in SolidGeometry 2.8, Creation date: 2016-01-10, Last change: 2025-09-14

returns the area of the surfaces (VL/PL)

Description

With respect to Heron: A=sqrt(s(s-a)(s-b)(S-c)); s=0.5*(a+b+c).


See Also: SGarea , VLFLarea , CPLarea

Example Illustration

 missing image of SGarea(SG)

Syntax

[ASUM,A]=SGarea(SG)

Input Parameter

SG: Solid Geoemtry

Output Parameter

ASUM: Area of the surfaces
A: Area list for facet list

Examples

Try:
SGarea(SGbox([30,20,10])




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, SGarea, calculates the area of surfaces in a solid geometry object, specifically using the vertices and facet list of the object. The function is part of the SG-Library and was created by Tim Lueth.

Input Parameters

Output Results

Algorithm Explanation

The function begins by checking the number of output arguments requested by the caller using nargout.

The function VLFLarea is assumed to calculate the area of each facet using Heron's formula, which is mentioned in the comments. Heron's formula is used to calculate the area of a triangle when the lengths of all three sides are known. The semi-perimeter s is calculated as 0.5 * (a + b + c), where a, b, and c are the lengths of the sides of the triangle. The area A is then calculated as sqrt(s * (s - a) * (s - b) * (s - c)).

The function is designed to be used with solid geometry objects that have a defined structure with vertices and facets, allowing for the calculation of surface areas for 3D models.

Algorithm explaination created using ChatGPT on 2025-08-18 22:07. (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