Skip to content

[BUG] offset(path,...) weird results with fixed $fn #1778

@pipatron

Description

@pipatron

I realized BOSL2 offset(path,r=…) does not use $fs and $fa the same way as OpenSCAD offset(r=…) CHILDREN; so I tried using $fn with weird results. I don't know if this is a bug exactly, but it's very unexpected and it prevents me to get control over the relative number of faces for rounding — it seems to be mostly all-or-nothing.

I tried to demonstrate the problem with the following code:

include <BOSL2/std.scad>
rainbow([0,1,2,3,4])
  let(fn=3+$item*2)
    for(y=[0:3])
      move([$item,y]*25)
        let(path=offset(regular_ngon(3+y*2,5),r=5,$fn=fn)) {
          stroke(path,width=0.5,joints="dot",closed=true);
          text(str("$fn=",fn),halign="center",valign="center",size=4);
        }

It shows what happens when trying to offset different polygons using different $fn, somewhat arbitrarily chosen to show the problem. Unfortunately I couldn't understand the source code for offset(), it was a lot more code than I expected!

Image

I think that ideally it should work the same or similar to OpenSCAD built-in offset() with more gradual increase of edges, at least in the same ballpark/

  • OpenSCAD 2025.08.12.nightly
  • BOSL2 e940b69

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions