Syntax
SG=SGofCPLhatch([CPL,d,a,zz,"cross"])
Input Parameter
CPL : | | Contour |
d : | | [thickness and distance of hatch bars] |
a : | | angle of hatch or [hatch crosshatch] angles; default is 51 degree |
zz : | | height of solid |
"cross" : | | if used; there will be crossed angle=[a a+90] |
Output Parameter
Examples
SGofCPLhatch(CPLsample(14)+[123 23],.4,'');
SGofCPLhatch(CPLsample(14)+[123 23],.2,'');
Copyright 2022-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 algorithm creates a solid geometry from a contour using a hatching technique. It is part of the SolidGeometry library and was introduced in version 5.2.
Input Parameters
- CPL: The contour of the shape to be hatched.
- d: A vector specifying the thickness and distance of the hatch bars.
- a: The angle of the hatch lines. It can also be a vector specifying crosshatch angles. The default angle is 51 degrees.
- zz: The height of the resulting solid geometry.
- "cross": An optional parameter. If used, it creates a crosshatch pattern with angles [a, a+90].
Output
- SG: The resulting solid geometry.
Algorithm Steps
- Check if the "cross" parameter is present and adjust the input parameters accordingly.
- Extract the contour (CPL), hatch parameters (d), angle (a), and height (zz) from the input arguments.
- If the angle 'a' is a vector with two elements, set the second element as 'am' and mark the hatch as crossed.
- Calculate the hatch distance using the
CPLhatch
function.
- Create a buffer around the contour using
CPLbuffer
with a negative offset.
- Generate the initial hatch pattern using
CPLhatch
on the buffered contour.
- If the hatch is crossed, create an additional hatch pattern at angle 'am' and combine it with the initial pattern using
CPLunion
.
- Subtract the buffered contour from the original contour and combine it with the hatch pattern.
- Attempt to create the solid geometry using
SGofCPLz
. If an error occurs, plot the contour and display an error message.
- If no output is requested, plot the solid geometry with transparency.
Algorithm explaination created using ChatGPT on 2025-08-19 07:45. (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