VLlink2P

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SG/Solids
Introduced first in SolidGeometry 1.0, Creation date: 2012-04-19, Last change: 2025-09-14

returns links of special shapes between two points in 2D.

Description

This procedure is used in combination with VLFLexpandPL(VL',bx,h,false,bx/2)

Example Illustration

 missing image of VLlink2P(p1,p2,shape,excent)

Syntax

VL=VLlink2P(p1,p2,[shape,excent])

Input Parameter

p1: Start point or vertex
p2: End point or vertex
shape: 'straight' or 'zigzag'
excent: size of the eccentric part

Output Parameter

VL: Vertex list of the shaped line

Examples

Create a 2.5 D Object of a given link between two points
LVL=VLlink2P (p1,p2,'zigzag',1);
VLplot (LVL,'k-'); view (0,90); VLFLplot (NVL,NFL);
[NVL,NFL]=VLFLexpandPL(LVL',bx,h,false,bx/2);
NVL=VLtransP (NVL,[0;0;by/2]);
[VL,FL]=VLFLcat2(VL,FL,NVL,NFL);




Copyright 2012-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, VLlink2P, generates a list of vertices representing a line between two points in 2D space. The line can be either straight or zigzag-shaped.

Input Parameters

Output

Algorithm Steps

  1. Check if p1 and p2 are column vectors. If not, transpose them.
  2. Set the third component of p1 and p2 to 0 to ensure they are 2D points.
  3. Calculate the distance l between p1 and p2.
  4. Compute the normalized direction vector pn from p1 to p2.
  5. Calculate a perpendicular vector po to pn.
  6. Use a switch statement to determine the shape of the line:
Algorithm explaination created using ChatGPT on 2025-08-19 07:26. (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