VLFLsmoothboundary
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Surfaces
Introduced first in SolidGeometry 4.3, Creation date: 2018-09-12, Last change: 2025-09-14
creates facets to smoothen or closing open boundaries without adding points
Description
This function is a recursive function with valuable parameters.
First Parameter 'al' is the bend angle of two edges at a corner point. al' indicates which is the minimum bend angle at which two edges may be closed by a triangle. If the angle is small, almost straight lines are closed by a surface.
The second parameter "lr" excludes triangles when closing, if the edge lengths do not correspond to special criteria. "lr" specifies the maximum length ratio of the two legs of a triangle that may still be closed. If "lr" is less than zero, abs(lr) is the absolute maximum length of the trough in millimeters. If "lr" is exactly zero, then the longer of the two legs must not exceed the mean value of all triangular distances (automatic mode).
The third parameter 'al2' also restricts the triangles to be closed. Triangles with too little kink angle are not closed if the knee angle is smaller than 'al2'.
The fourth parameter "be" also restricts the triangles to be closed. It defines the surface angle difference, i.e. the orientation of the surface relative to the already existing surfaces. The larger the angle "be" is, the straighter the triangle walls are which are still allowed to close. If "be" > pi/1.5 is selected, there are almost only straight edges left. If "be" is ~ pi/2, then edges with surfaces can be closed at right angles.
See Also: VLFLremoveIntersectFacets
Example Illustration
Syntax
[FL,NFL]=VLFLsmoothboundary(VL,FL,[al,lr,al2,be])
Input Parameter
VL: | | Vertex list |
FL: | | Facet list |
al: | | closing if edge angle is > al; default is pi/4 |
lr: | | leg length maximum ratio; default is 1.5 |
al2: | | minimal angle value for closing; default is 0; |
be: | | required distance angle to parallel walls |
Output Parameter
FL: | | List of old and appended new facets |
NFL: | | List of New facets |
Examples
loadweb AAruffo_surf.mat % load some surface data sets
A=SG1; VLFLsmoothboundary(A.VL,A.FL);
A=SG1; VLFLsmoothboundary(A.VL,A.FL,0.01,1000,0,0); % Close all angles - too simple approach
A=SG1; VLFLsmoothboundary(A.VL,A.FL,0.01,1000,0,pi/1.3); % Close all angles if walls are straight
A=SG1; VLFLsmoothboundary(A.VL,A.FL,0.01,0,0,pi/1.3); % Close angles of similar size/wall straight
A=SG1; VLFLsmoothboundary(A.VL,A.FL,0,0,0.5,pi/1.3); % Avoid closing straight lines
A=SG1; VLFLsmoothboundary(A.VL,A.FL,0,-10,0.5,pi/1.3); % Close up tom 10mm leg length
Copyright 2018-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
Last html export of this page out of FM database by TL: 2025-09-21