VLcrossingSG

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Geometric Queries
Introduced first in SolidGeometry 2.4, Creation date: 2015-08-08, Last change: 2025-09-14

returns crossing points of two solid geometries

Description

Extreme fast, powerful, and useful function
Supports also cell list of Solids
based on mesh2mesh

See Also: mesh2mesh , VLFLinpolyhedron , SGisInterior , crossingfacets2VLFL

Example Illustration

 missing image of VLcrossingSG(SGA,SGB)

Syntax

VL=VLcrossingSG(SGA,SGB)

Input Parameter

SGA: Solid A or cell list of solids
SGB: Solid B or cell list of solids

Output Parameter

VL: Vertex list of all crossing point

Examples

Crossing points of 2 boxes
A=SGbox([30,20,10]);
VLcrossingSG(A,SGtrans(A,rotdeg(90)));




Copyright 2015-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, VLcrossingSG, calculates the crossing points of two solid geometries, SGA and SGB. It is designed to be extremely fast and powerful, supporting both individual solids and cell lists of solids.

Input Parameters

Output Results

Algorithm Steps

  1. Check if SGA is a cell array. If true, initialize empty vertex list VL and face list FL. Iterate over each solid in SGA, concatenating their vertex and face lists using VLFLcat2. Convert the combined lists into a solid using SGofVLFL.
  2. Check if SGB is a cell array. If true, perform the same operations as in step 1 for SGB.
  3. Check if the vertex lists of SGA and SGB are collocated using iscollofVLBB. If they are, calculate the crossing points using mesh2meshTL with the face and vertex lists of both solids.
  4. If the vertex lists are not collocated, set VL to an empty array.
  5. If no output arguments are specified, plot the results. Close all figures, create a new figure with SGfigure, and set the view angle. Plot SGA in red and SGB in green. Remove duplicate rows from VL and plot the unique crossing points in blue. Use VLFLplotlight to adjust lighting.

Example

To find the crossing points of two boxes:

A = SGbox([30,20,10]); 
VLcrossingSG(A, SGtrans(A, rotdeg(90)));
Algorithm explaination created using ChatGPT on 2025-08-19 07:36. (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