Syntax
[VL,FL]=VLFLrotsymRLELn(RL,CEL,[n])
Input Parameter
RL : | | Point list 2D |
CEL : | | Contour edge list |
n : | | number of point on the polygon; default is nofrd |
Output Parameter
VL : | | Vertex list of torus solid |
FL : | | Facet list of torus solid |
Examples
RL=[5 0; 10 5; 15 10; 15 40],
VLplot (RL,'r*-'), axis equal, view (0,90)
[VL,FL]=VLFLrotsymRLELn (RL,CEL,40);
VLFLplot (VL,FL,'m'), view (30,30)
Copyright 2013-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, VLFLrotsymRLELn, is designed to generate a 3D torus-like solid by rotating a 2D contour around an axis. The function takes in a point list (RL), a contour edge list (CEL), and an optional parameter n, which specifies the number of points on the polygon.
Input Parameters
- RL: A 2D point list representing the contour to be rotated.
- CEL: A contour edge list that defines the connections between points in RL.
- n: The number of points on the polygon. If not provided, it defaults to a value determined by the function nofrd, which is based on the maximum x-coordinate in RL.
Output Results
- VL: The vertex list of the resulting torus solid.
- FL: The facet list of the resulting torus solid.
Algorithm Steps
- Determine the number of points, n, using the nofrd function based on the maximum x-coordinate in RL. If n is provided as an argument, use that value instead.
- Calculate the number of points in the contour, m, using the size of RL.
- Generate a circle point list, PL, using the PLcircle function with radius 1 and n points.
- Repeat the radius list, RL, n times to form the initial vertex list, VL.
- Repeat the circle list, PL, m times and reshape it to match the dimensions of VL.
- Calculate the x, y, and z coordinates for the vertices by multiplying the circle coordinates with the radius values and using the z-values from RL.
- Form the final vertex list, VL, by combining the x, y, and z coordinates.
- Generate the contour wall facet list, FLW, using the FLcontourwallELn function with CEL and m.
- Create an offset array, a, to adjust the indices for each rotation step.
- Repeat and adjust the facet list, FLW, for each rotation step, ensuring indices wrap around correctly.
- Reshape and adjust the facet indices to form the final facet list, FL.
- Swap the facet indices using the FLswap function to ensure correct orientation.
Algorithm explaination created using ChatGPT on 2025-08-19 08:18. (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