Syntax
SGB=SGofCPLbendonadrum(CPLN,[h,ol,res])
Input Parameter
CPLN : | | Contour to bend |
h : | | height of the material in z |
ol : | | overlap; default is 0 |
res : | | resolution for CPL mesh grid; default is r/10 |
Output Parameter
Examples
SGofCPLbendonadrum(PLsquare([10,20]),.5);
CPLstent([5 5 5 5 10 5 5 5 5],2,.5,17); X=ans;
SGofCPLbendonadrum(X,.5)
Copyright 2019-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, SGofCPLbendonadrum
, is designed to bend a contour pattern (CPL) into a cylindrical shape or roll it onto a drum. It is part of the Solid Geometry Library (SG-Lib) and is used for applications such as creating patient-specific stents.
Input Parameters
- CPLN: The contour pattern to be bent.
- h: The height of the material in the z-direction.
- ol: The overlap amount, with a default value of 0.
- res: The resolution for the CPL mesh grid, with a default value of
r/10
.
Output
- SGB: The resulting solid geometry after bending the CPL pattern.
Algorithm Steps
- Calculate the bounding box of the CPL using
BBofCPL
and determine the length in the y-dimension (ly
).
- Retrieve the height
h
from the input parameters or use the default value of 0.5.
- Retrieve the overlap
ol
from the input parameters or use the default value equal to h
.
- Calculate the outer radius
r
using the formula: r = (ly - ol) / (2 * pi)
.
- Determine the diameter increment
di
using the formula: di = 2 * pi * r / nofrd(r) / 2
.
- Set the resolution
res
to [di, di]
or retrieve it from the input parameters.
- Flip the CPL pattern horizontally using
fliplr
.
- Create a Delaunay grid of the CPL using
SGofCPLzdelaunayGrid
with the specified height and resolution.
- Bend the grid into a cylindrical shape using
SGbending
with the calculated radius and height.
- Rotate the bent geometry around the z-axis by -90 degrees using
SGrotate
.
- Translate the geometry using
SGtrans1
.
- Create a cylinder with the inner radius
r-h
and the height equal to the x-dimension of the bounding box.
- Rotate the cylinder around the y-axis by -90 degrees and align it with the bent geometry using
SGtransrelSG
.
- If no output is requested, plot the resulting geometry using
SGfigure
and SGplotalpha
, and annotate the plot with the outer and inner radii.
Algorithm explaination created using ChatGPT on 2025-08-19 08:29. (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