discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

surface() png horizontal scaling

FH
Father Horton
Sat, Feb 28, 2026 8:48 PM

The documentation says that the vertical scale goes 1-100 based on the
brightness, but it doesn't say how the horizontal dimensions are
determined. I tried it and it doesn't look like it's quite 1 unit per
pixel. Is it, and my eyes are just deceiving me?

The documentation says that the vertical scale goes 1-100 based on the brightness, but it doesn't say how the horizontal dimensions are determined. I tried it and it doesn't look like it's quite 1 unit per pixel. Is it, and my eyes are just deceiving me?
FH
Father Horton
Sat, Feb 28, 2026 9:42 PM

Actually, it looks more like two units/pixel, but not quite.
On Sat, Feb 28, 2026 at 2:48 PM Father Horton fatherhorton@gmail.com
wrote:

The documentation says that the vertical scale goes 1-100 based on the
brightness, but it doesn't say how the horizontal dimensions are
determined. I tried it and it doesn't look like it's quite 1 unit per
pixel. Is it, and my eyes are just deceiving me?

Actually, it looks more like two units/pixel, but not quite. On Sat, Feb 28, 2026 at 2:48 PM Father Horton <fatherhorton@gmail.com> wrote: > The documentation says that the vertical scale goes 1-100 based on the > brightness, but it doesn't say how the horizontal dimensions are > determined. I tried it and it doesn't look like it's quite 1 unit per > pixel. Is it, and my eyes are just deceiving me? >
JB
Jordan Brown
Sun, Mar 1, 2026 3:52 AM

On 2/28/2026 12:48 PM, Father Horton via Discuss wrote:

The documentation says that the vertical scale goes 1-100 based on the
brightness, but it doesn't say how the horizontal dimensions are
determined. I tried it and it doesn't look like it's quite 1 unit per
pixel. Is it, and my eyes are just deceiving me?

One unit per pixel.  However, remember your fenceposts
https://en.wikipedia.org/wiki/Off-by-one_error#Fencepost_error, and
know that the pixels are at the corners of the 1x1 squares, not in the
center.

Thus, for a 10x10 image, the lower-left pixel is at 0,0, and the
upper-right is at 9,9.

On 2/28/2026 12:48 PM, Father Horton via Discuss wrote: > The documentation says that the vertical scale goes 1-100 based on the > brightness, but it doesn't say how the horizontal dimensions are > determined. I tried it and it doesn't look like it's quite 1 unit per > pixel. Is it, and my eyes are just deceiving me? One unit per pixel.  *However*, remember your fenceposts <https://en.wikipedia.org/wiki/Off-by-one_error#Fencepost_error>, and know that the pixels are at the corners of the 1x1 squares, not in the center. Thus, for a 10x10 image, the lower-left pixel is at 0,0, and the upper-right is at 9,9.
FH
Father Horton
Sun, Mar 1, 2026 12:11 PM

Thank you.

On Sat, Feb 28, 2026 at 9:52 PM Jordan Brown openscad@jordan.maileater.net
wrote:

On 2/28/2026 12:48 PM, Father Horton via Discuss wrote:

The documentation says that the vertical scale goes 1-100 based on the
brightness, but it doesn't say how the horizontal dimensions are
determined. I tried it and it doesn't look like it's quite 1 unit per
pixel. Is it, and my eyes are just deceiving me?

One unit per pixel.  However, remember your fenceposts
https://en.wikipedia.org/wiki/Off-by-one_error#Fencepost_error, and
know that the pixels are at the corners of the 1x1 squares, not in the
center.

Thus, for a 10x10 image, the lower-left pixel is at 0,0, and the
upper-right is at 9,9.

Thank you. On Sat, Feb 28, 2026 at 9:52 PM Jordan Brown <openscad@jordan.maileater.net> wrote: > On 2/28/2026 12:48 PM, Father Horton via Discuss wrote: > > The documentation says that the vertical scale goes 1-100 based on the > brightness, but it doesn't say how the horizontal dimensions are > determined. I tried it and it doesn't look like it's quite 1 unit per > pixel. Is it, and my eyes are just deceiving me? > > One unit per pixel. *However*, remember your fenceposts > <https://en.wikipedia.org/wiki/Off-by-one_error#Fencepost_error>, and > know that the pixels are at the corners of the 1x1 squares, not in the > center. > > Thus, for a 10x10 image, the lower-left pixel is at 0,0, and the > upper-right is at 9,9. > > >