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
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
- w1: A vector [angle 1, length 1] that defines the angle and length of the first edge of the first triangle.
- w2: A vector [angle 2, length 2] that defines the angle and length of the second edge of the first triangle.
- w3: A scalar angle for rotation against the axis.
Algorithm Steps
- Initialize a default length
l to 1.
- Retrieve the parameters
w1, w2, and w3 using the getfuncparams function, which assigns default values if not provided.
- Extract lengths and angles from
w1 and w2.
- Calculate the vertices
VL of the two triangles using trigonometric functions to determine the positions based on the angles and lengths.
- Add a z-coordinate to the vertices using
VLaddz.
- Use
mirroringatline3D to find the mirrored point and transformation matrix T for the rotation.
- Rotate the second triangle around the edge using the transformation matrix
T and the rotation angle w3.
- Calculate the distance
dd to check if the triangles are coplanar.
- Define the face list
FL for the two triangles.
- Store the vertices
VL and face list FL in the output structure SG.
- 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