pgrid

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 1.0, Creation date: 2011-12-27, Last change: 2025-09-14

returns a point of a 2D grid

Description

This procedure can be used in combination with VLFLexpboard to set objects on top of the grid of VLFLexpboard.

Example Illustration

 missing image of pgrid(x,y,lx,ly,nx,ny,type)

Syntax

p=pgrid(x,y,lx,ly,nx,ny,[type])

Input Parameter

x: x-grid
y: y-grid
lx: x-size of the grid
ly: y-size of the grid
nx: number of grid points in x
ny: number of grid points in y
type: 0 = grid starts at 0; 1=grid starts at lx(nx)/2; default is 1

Output Parameter

p: point (1:3,1) of the grid

Examples

Position (1,1) of a 5x5 grid as part of a 50x50mm board
pgrid(1,1,50,50,4,4,0)




Copyright 2011-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, pgrid, is designed to calculate a point on a 2D grid. It is part of the SG-Library and can be used in conjunction with the VLFLexpboard to position objects on a grid.

Input Parameters

Output

Algorithm Details

The function begins by setting the default value of type to 1. If the number of input arguments is 7 or more, it assigns the seventh argument to type.

Switch Conditions

The function returns the calculated point p and exits.

Algorithm explaination created using ChatGPT on 2025-08-18 23:36. (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