Syntax
CISG=SGconvexofSGintersect(SG,SGinter)
Input Parameter
SG : | | Solid Geometry A to intersect |
SGinter : | | Intersecting Solid B |
Output Parameter
CISG : | | Convex intersecting solid that contains alls surfaces of SG intersecting with SGinter |
Examples
SGconvexofSGintersect(SGsphere(15),SGbox)
Copyright 2020-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, SGconvexofSGintersect
, is designed to compute the convex hull of the intersection between two solid geometries, SG and SGinter. It is part of the SolidGeometry library and was introduced in version 5.0.
Input Parameters
- SG: The first solid geometry to intersect.
- SGinter: The second solid geometry that intersects with SG.
Output
- CISG: The convex intersecting solid that contains all surfaces of SG intersecting with SGinter.
Algorithm Steps
- Calculate the face indices of SG that intersect with SGinter using the function
FLofcrossingSG
.
- Extract the vertices and faces of SG that are involved in the intersection using the indices obtained in the previous step.
- Use the function
VLFLshort
to create a new structure with these vertices and faces.
- Suppress specific warnings related to triangulation using
warning('off',...)
.
- Generate a convex hull from the vertices using
SGofVLdelaunay
.
- Remove unnecessary surface edge points using
SGremsurfedgepoints
.
- Restore the previous warning state.
- If no output is requested, visualize the result using
SGfigure
and SGplotalpha
to plot SG, SGinter, and the resulting convex hull with different colors.
Visualization
If the function is called without an output argument, it will display a 3D plot with:
- SG in red.
- SGinter in white.
- The convex hull of the intersection in green.
Annotations are added to the plot to describe the color coding.
Algorithm explaination created using ChatGPT on 2025-08-19 06:58. (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