SGof2facets

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - VLFL/Surfaces
Introduced first in SolidGeometry 5.1, Creation date: 2021-04-10, Last change: 2025-09-15

creates a surface consisting of two faces

Description

In this example the second triangle is rotated using the edge as rotation matrix.

See Also: mirroringatline3D

Example Illustration

 missing image of SGof2facets (w1,w2,w3)

Syntax

SGof2facets([w1,w2,w3])

Input Parameter

w1: [angle 1 length 1]
w2: [angle 2 length 2]
w3: angle rotation agains axis

Examples


SGof2facets(pi/3,pi/2,pi/3)




Copyright 2021-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, SGof2facets, creates a surface consisting of two triangular faces. It uses three input parameters to define the geometry of the triangles.

Input Parameters

Algorithm Steps

  1. Initialize a default length l to 1.
  2. Retrieve the parameters w1, w2, and w3 using the getfuncparams function, which assigns default values if not provided.
  3. Extract lengths and angles from w1 and w2.
  4. Calculate the vertices VL of the two triangles using trigonometric functions to determine the positions based on the angles and lengths.
  5. Add a z-coordinate to the vertices using VLaddz.
  6. Use mirroringatline3D to find the mirrored point and transformation matrix T for the rotation.
  7. Rotate the second triangle around the edge using the transformation matrix T and the rotation angle w3.
  8. Calculate the distance dd to check if the triangles are coplanar.
  9. Define the face list FL for the two triangles.
  10. Store the vertices VL and face list FL in the output structure SG.
  11. If no output is requested, plot the triangles using SGfigure and VLFLplotalpha functions, and annotate the plot with vertex and face labels.
Algorithm explaination created using ChatGPT on 2025-08-19 01:40. (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