CPLfillPattern

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 2.5.1, Creation date: 2015-09-11, Last change: 2025-09-14

fills a contour with copies of a pattern

Description

Written on SY Bontekoning at Marina Panacea Palma de Mallorca.
The filling algorithm is expecting that the pattern are centered around [0 0]; otherwise by using parameter pc, the function filling contour is moved into its bounding box center


See Also: CPLfillHoneycomb

Example Illustration

 missing image of CPLfillPattern(CPL,CPLA,w,d,cut,pc)

Syntax

[CPLN,XPL]=CPLfillPattern(CPL,CPLA,[w,d,cut,pc])

Input Parameter

CPL: Contour to be filled
CPLA: Filling pattern to be copied
w: border thickness of CPL; default is 1
d: distance between the pattern; default is w
cut: cut instead of removal of overlapping pattern; default is false
pc: 'c' moves the contour into the center; is 'c' on by default

Output Parameter

CPLN: CPL of resulting contour with punched patterns
XPL: CPL of punching patterns

Examples

Fill a circle with stars:
CPLfillPattern(PLcircle(30),PLstar(5,20),0,0); % Both contours are centered
CPLfillPattern(PLcircle(30),PLstar(5,20)+3,0,0); % Pattern shifting is ignored
CPLfillPattern(PLcircle(30)+10,PLstar(5,20),0,0); % Contour shifting is compensated
CPLfillPattern(PLcircle(30)+10,PLstar(5,20)+3,0,0,true,'x');




Copyright 2015-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

Last html export of this page out of FM database by TL: 2025-09-21