Skip to content

[BUG] convexity too high in gears? #1866

@wosym

Description

@wosym

Describe the bug
It was discovered that on OpenSCAD v2021.01 the camera controls become very unresponsive when combining a diff() with a spur_gear. See reproduction code below.
The diff in itself is fine. the gear in itself is fine. Even attaching multiple gears works fine. But when doing both the diff of the tubes and the gear, moving the camera becomes very slow.
Note that on Openscad v2025.12.23 the issue does not exist.

Code To Reproduce Bug

include <../BOSL2/std.scad>
include <../BOSL2/transforms.scad>
include <../BOSL2/gears.scad>

$fn = 10;

gear_pitch = 4;

diff("remove")
tube(id=6, od=150, h=6)
{
    // tag("remove") attach(CENTER)
    //      tube(od=10, id=5, h=3);
    attach(CENTER)
        spur_gear(circ_pitch=gear_pitch,
                  teeth=ceil((PI*150)/gear_pitch),
                  thickness=6,
                  shaft_diam=6,
                  helical=25,
                  herringbone=true);
}

Analysis
With some help of @adrianVmariano it was discovered that the convexity parameter in gears.scad is probably to blame. When setting it to a lower value (either increasing the divisor, or a fixed value of 10) the problem disappears.

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