# Gimp-Forum.net

Full Version: tiling a circle with an offset (math)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I want to tile tightly packed circles with an offset of 50%.

It seems the Y Shift per Row is -13,4%.

Is there a mathematical formula for this ?

(I tried googling the problem but nothing turns up...)

(06-14-2018, 07:28 PM)Espermaschine Wrote: [ -> ]I want to tile tightly packed circles with an offset of 50%.

It seems the Y Shift per Row is -13,4%.

Is there a mathematical formula for this

In terms of ?? what

The y offset is the height of the isosceles triangle joining the centers of the circles

As a value of the radius r it is 2.r.cos30 = diameter x 0.866 I suppose that is the 13.4 % (1-0.866)X100
Still editing it Struggling with a wonky net book, keyboard has a mind of its own, and my mind is shot, it has been a long day.

The 'y' offset center-to-center of circles is diameter x 0.866
(06-14-2018, 08:24 PM)rich2005 Wrote: [ -> ]The 'y' offset center-to-center of circles is diameter x 0.866

Thanks !

(im afraid my brain is unable to refresh that faint memory from school, but good somebody else knows the math behind it)
(06-14-2018, 08:42 PM)Ofnuts Wrote: [ -> ]https://en.wikipedia.org/wiki/Circle_packing

Awesome !

BTW, i was following this tutorial:
https://design.tutsplus.com/tutorials/ho...-cms-25936

Tiling a pattern with an offset is always a headache in Inkscape.
Even if i want to make the pattern for Gimp, i have to tile 3 rows, but then calculating the overlap of the strokes as a percentage is a math nightmare.

[attachment=1841]
Ofnuts' scripts to the rescue.

1. path-shaped-grid: triangular grid, use separate paths, keep only one of the three... (do not use the Integer pixels option)
2. ofn-path-to-shape: Shapes>On Segments>Circles or ellipses and use Diameter.
[attachment=1840]

path-shaped-grid is the ugly duckling in my collection. When used with oftn-path-to-shape (and its also overlooked Transform Segments>Resize) it can do amazing things.
(06-14-2018, 09:16 PM)Ofnuts Wrote: [ -> ]Ofnuts' scripts to the rescue.

Wow !
You have written so many path tools, that its very hard to keep an overview.
These two seem very powerful.

What i dont understand is, how can i use your script to tile my circular ornament into the hexagonal seamless pattern ?

[attachment=1842]
You have to cheat a bit, since the true hexagonal pattern hasn't got an integer "rational" (in the mathematical sense) period and so cannot be tiled. But the grid script has an "integer pixel" option that slightly distorts the grid (alters its aspect ratio slightly) to give it that fractional period. With some luck this can be masked by the thickness of the lines.

For the stars you use the same segments, but use path to-shape to draw stars on them (using the "Diameter" reference)(orange). For the other set of stars, you use path-to-shape Segment>Transform>Rotate on these diameter segment to rotate them by 30°, then use the result as diameter for stars (green)(if the stars had an odd number or rays, you would just use the same segment for the diameter in both sets, and use the start on Summit/Side option to generate each set.

I will give this a try tomorrow. Its close to bedtime here.

If i understand your post correctly, you are using your scripts to replicate the star pattern.

I was looking for a more universal method to tile the artistical insides of any circle shaped work into the hexagonal packed pattern.
Pages: 1 2