Syntax
CPLF=CPLhatchgridofCPL(CPLOrg,[dim])
Input Parameter
CPLOrg : | | Original contour of a solid cross section/projection or a solid |
dim : | | Wall and bar width and distance default is [2 20] |
Output Parameter
CPLF : | | Contoor with a simple squared mesh |
Examples
CPLhatchgridofCPL(CPLsample(31)*20);
CPLhatchgridofCPL(CPLsample(31)*20,'fill');
CPLhatchgridofCPL(SGsample(29),'fill',[1 5]);
CPLhatchgridofCPL(SGsample(29),[1 5]);
Copyright 2024-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, CPLhatchgridofCPL
, creates a filling mesh similar to a slicer for a given contour of a solid cross-section or projection. It is part of the SolidGeometry library and was introduced in version 5.5.
Input Parameters
- CPLOrg: The original contour of a solid cross-section or projection. It can also be a solid geometry object.
- dim: An optional parameter specifying the wall and bar width and distance. The default value is [2 20].
Output Results
- CPLF: The resulting contour with a simple squared mesh.
Algorithm Steps
- Check if the 'fill' option is specified in the input parameters using
getfuncparamStr
.
- Retrieve the
dim
parameter using getfuncparams
, defaulting to [2 20] if not provided.
- If
CPLOrg
is a solid geometry object, convert it to a contour using CPLofSGprojection
.
- Assign
CPLOrg
to CPLO
.
- If the 'fill' option is specified, fill the inside of the contour using
CPLfillinside
.
- Create a buffer around the contour with a negative offset using
CPLbuffer
and subtract it from the original contour using CPLsubtract
.
- Generate a hatch pattern at 90 and 0 degrees using
CPLhatch
and combine them with the subtracted contour using CPLunion
.
- If no output is requested, plot the resulting contour using
SGfigure
, CPSplot
, and CPLplot
.
Example Usage
CPLhatchgridofCPL(CPLsample(31)*20);
CPLhatchgridofCPL(CPLsample(31)*20,'fill');
CPLhatchgridofCPL(SGsample(29),'fill',[1 5]);
CPLhatchgridofCPL(SGsample(29),[1 5]);
Algorithm explaination created using ChatGPT on 2025-08-19 07:04. (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