Search In
• More options...
Find results that contain...
Find results in...

# Circle approximations with tidy circumference

## Recommended Posts

This icosagon has a circumference of 512 units, textures like SKSPINE2 will neatly wrap around without missing pixels. The diagonals are formed from Pythagorean triples so each side is a whole number.

This dodecagon will tile with textures that repeat in steps of 32 units or smaller.
The circumference of this shape is 416 but it can easily be scaled.

neat :)

I wonder if anyone has experimented with curve-tool equivalents? e.g. "If you apply a 180° curve to a straight line of length X, the resulting curve will have length divisible by 32/64/128, etc..". I think I remember plums had a post about this some time ago.. too lazy to search.

These might not be the most smooth, but their advantage is that they fit on the 8 unit grid.

True, but I wanted to avoid inexact lengths (the 47 in your first pic is 46.64761....) as a fun experiment

Sorry, I didn't understand that until now. Here you go, then:

:D

EDIT: A little better one:

:)

Ribbiks said:

neat :)

I wonder if anyone has experimented with curve-tool equivalents? e.g. "If you apply a 180° curve to a straight line of length X, the resulting curve will have length divisible by 32/64/128, etc..". I think I remember plums had a post about this some time ago.. too lazy to search.

I did indeed.

https://www.doomworld.com/vb/doom-editing/69581-making-circles-and-polygons-that-fit-textures-properly/

Rereading that now, it's actually a bit hard to follow without some more visuals. I could update/redo it if anyone was interested.

This approach is pretty nice because of how it avoids fractional line lengths, though.

They look too perfect and unnatural. Rough shapes have a lot more character.

Avoiding fractional line lengths for better tiling of textures is actually a futile effort. Due to inaccuracies of geometrical functions in the Doom renderer, textures may appear tiling beyond their actual width anyway, frequently displaying pixels on their right side that theoretically should have been hidden (which is highly noticeable with textures that change color right beyond the right side of the linedef). Same with top and/or bottom pixels, depending on pegging. Line lengths should have fractional parts between .5 and .75 to be "the least harmful".

All renderers?

Eternity has a renderer that, if I'm not mistaken, uses floating point instead of fixed point. That makes it much more precise and less prone to all these off-by-one texel errors.

ZDoom moved to floating point recently as well; I'm not sure to what extent the renderer was affected though.