CPLcrosslineauxpoints

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 5.1, Creation date: 2021-12-01, Last change: 2025-09-15

creates crossing points of a line a a contour with a grid size

Description

will be improved in future. Function is used to create base points for mechanisms design along of straigt lines within a defined contour

See Also: crossC2P , CPLofPLcrossCPL

Example Illustration

 missing image of CPLcrosslineauxpoints(CPL,p1,p2,md)

Syntax

GPL=CPLcrosslineauxpoints(CPL,p1,p2,md)

Input Parameter

CPL: Contour
p1: Start Point
p2: End Point
md: distance; default is 1mm

Output Parameter

GPL: Gridpointlist

Examples


CPLcrosslineauxpoints(CPLsample(18),[0 -30],[0 +30],5)




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, CPLcrosslineauxpoints, is designed to create crossing points of a line with a contour, using a specified grid size. It is part of the SolidGeometry library and is used for mechanism design along straight lines within a defined contour.

Input Parameters

Output

Algorithm Steps

  1. Calculate the direction vector ov from p1 to p2 and normalize it.
  2. Use the function crossC2P to find the crossing points cc and their associated parameters ac.
  3. If crossing points exist, sort them based on ac.
  4. Check if the start or end points are inside the contour using insideCPL and adjust cc accordingly.
  5. Calculate the distance dd between the first and last crossing points.
  6. Determine the number of intervals ni and the interval distance nd.
  7. Create an array ai of distances from the first crossing point.
  8. Generate the grid points GPL along the line using the calculated distances.
  9. Remove grid points that are not inside the contour using insideCPL.
  10. If no output is requested, plot the contour, line, and grid points for visualization.
Algorithm explaination created using ChatGPT on 2025-08-19 08:15. (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