Builtin arguments: undef means not given; h/a aliases; linear_extrude default height 100 - #230
Merged
Merged
Conversation
…ight 100 getArg returned an argument given as undef as a value, so rotate_extrude(angle=undef) revolved 0 degrees instead of 360. Wrappers forward their own optional parameters as undef: BOSL2's new rotate_extrude override passes angle=angle, which flattened every plain rotate_extrude() into its profile (BelfrySCAD#680). Every upstream builtin treats undef as absent (if (v.isDefined())); getArg now does too. Checked against OpenSCAD 2026.02 argument by argument (47 cases): rotate_extrude angle, linear_extrude height, cylinder h, square size and text size/spacing were the ones that differed, and now match. Also, as upstream: linear_extrude accepts h= and rotate_extrude a= as aliases (BOSL2's overrides forward them), warning 'Specified both "height" and "h"' and taking the primary name when both are given; and linear_extrude's default height is 100, not 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 4, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs BelfrySCAD/BelfrySCAD#680
Summary
getArgreturned an argument given asundefas a value, sorotate_extrude(angle=undef)revolved 0° instead of 360°. Wrappers forward their own optional parameters asundef, and BOSL2's newrotate_extrudeoverride does exactly that (_rotate_extrude(angle=angle, ...)), so with current BOSL2 every plainrotate_extrude()came out as its flat profile (#680).Upstream treats
undefas absent in every builtin (if (v.isDefined())).getArgnow does too.Checked against OpenSCAD 2026.02
Every builtin argument I could reach, each called with
ARG=undefand with it left out (47 cases). Before this change six differed from OpenSCAD —rotate_extrudeangle,linear_extrudeheight,cylinderh,squaresize,textsize and spacing (several produced nothing at all). After it, none differ.Also, as upstream
linear_extrude(h=...)androtate_extrude(a=...)are accepted as aliases — BOSL2's new overrides forward them. Both given: warningSpecified both "height" and "h"(resp."angle"and"a"), and the primary name wins. Both added tobuiltinParamNames.linear_extrude()with no height is 100 tall, as upstream (it was 1).Not done here:
linear_extrude(v=...), upstream's extrusion-direction vector. It is declared inbuiltinParamNamesbut still not implemented; a separate change.Tests
tests/test_undef_args.cpp(5 tests): undef is the default for each of the six, positionally too; a wrapper forwarding its own optionalanglerevolves fully; the default height;h/awith no warning; both names given warns and the primary wins. Full ctest: 2019 passed. Binding tests: 61 passed. The reported BOSL2 case now matches OpenSCAD's bounding box exactly.Before releasing this: the full BOSL2 docsgen A/B.
🤖 Generated with Claude Code