SGofCPLhatch

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Surfaces
Introduced first in SolidGeometry 5.2, Creation date: 2022-06-27, Last change: 2025-09-15

creates a solid using CPLhatch



See Also: CPLhatch , SGofCPLz , CPLradialhatch

Example Illustration

 missing image of SGofCPLhatch(CPL,d,a,zz,

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

SG: Solid Geometry

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

Output

Algorithm Steps

  1. Check if the "cross" parameter is present and adjust the input parameters accordingly.
  2. Extract the contour (CPL), hatch parameters (d), angle (a), and height (zz) from the input arguments.
  3. If the angle 'a' is a vector with two elements, set the second element as 'am' and mark the hatch as crossed.
  4. Calculate the hatch distance using the CPLhatch function.
  5. Create a buffer around the contour using CPLbuffer with a negative offset.
  6. Generate the initial hatch pattern using CPLhatch on the buffered contour.
  7. If the hatch is crossed, create an additional hatch pattern at angle 'am' and combine it with the initial pattern using CPLunion.
  8. Subtract the buffered contour from the original contour and combine it with the hatch pattern.
  9. Attempt to create the solid geometry using SGofCPLz. If an error occurs, plot the contour and display an error message.
  10. 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