Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gridfinity-spiral-vase.scad: Assertion 'is_num(height_mm)' failed #180

Closed
vaz-ar opened this issue Apr 22, 2024 · 6 comments · Fixed by #181
Closed

gridfinity-spiral-vase.scad: Assertion 'is_num(height_mm)' failed #180

vaz-ar opened this issue Apr 22, 2024 · 6 comments · Fixed by #181

Comments

@vaz-ar
Copy link

vaz-ar commented Apr 22, 2024

I tried opening gridfinity-spiral-vase.scad in openSCAD and I got the following error:

Parsing design (AST generation)...
Compiling design (CSG Tree generation)...
[ERROR: Assertion 'is_num(height_mm)' failed in file gridfinity-rebuilt-utility.scad, line 419](https://github.com/kennetek/gridfinity-rebuilt-openscad/issues/419,C:/Users/Arnaud/Documents/_Workspace/gridfinity-rebuilt-openscad/gridfinity-rebuilt-utility.scad)
[TRACE: called by 'assert' in file gridfinity-rebuilt-utility.scad, line 419](https://github.com/kennetek/gridfinity-rebuilt-openscad/issues/419,C:/Users/Arnaud/Documents/_Workspace/gridfinity-rebuilt-openscad/gridfinity-rebuilt-utility.scad)
[TRACE: call of 'profile_wall(height_mm = undef)' in file gridfinity-rebuilt-utility.scad, line 418](https://github.com/kennetek/gridfinity-rebuilt-openscad/issues/418,C:/Users/Arnaud/Documents/_Workspace/gridfinity-rebuilt-openscad/gridfinity-rebuilt-utility.scad)
[TRACE: called by 'profile_wall' in file gridfinity-spiral-vase.scad, line 364](https://github.com/kennetek/gridfinity-rebuilt-openscad/issues/364,C:/Users/Arnaud/Documents/_Workspace/gridfinity-rebuilt-openscad/gridfinity-spiral-vase.scad)
[TRACE: called by 'if' in file gridfinity-spiral-vase.scad, line 364](https://github.com/kennetek/gridfinity-rebuilt-openscad/issues/364,C:/Users/Arnaud/Documents/_Workspace/gridfinity-rebuilt-openscad/gridfinity-spiral-vase.scad)
[TRACE: called by 'children' in file gridfinity-rebuilt-utility.scad, line 439](https://github.com/kennetek/gridfinity-rebuilt-openscad/issues/439,C:/Users/Arnaud/Documents/_Workspace/gridfinity-rebuilt-openscad/gridfinity-rebuilt-utility.scad)
[TRACE: called by 'children' in file generic-helpers.scad, line 161](https://github.com/kennetek/gridfinity-rebuilt-openscad/issues/161,C:/Users/Arnaud/Documents/_Workspace/gridfinity-rebuilt-openscad/generic-helpers.scad)
[TRACE: called by 'linear_extrude' in file generic-helpers.scad, line 160](https://github.com/kennetek/gridfinity-rebuilt-openscad/issues/160,C:/Users/Arnaud/Documents/_Workspace/gridfinity-rebuilt-openscad/generic-helpers.scad)
[TRACE: called by 'multmatrix' in file generic-helpers.scad, line 159](https://github.com/kennetek/gridfinity-rebuilt-openscad/issues/159,C:/Users/Arnaud/Documents/_Workspace/gridfinity-rebuilt-openscad/generic-helpers.scad)
[TRACE: called by 'for' in file generic-helpers.scad, line 158](https://github.com/kennetek/gridfinity-rebuilt-openscad/issues/158,C:/Users/Arnaud/Documents/_Workspace/gridfinity-rebuilt-openscad/generic-helpers.scad)
[TRACE: called by 'union' in file generic-helpers.scad, line 156](https://github.com/kennetek/gridfinity-rebuilt-openscad/issues/156,C:/Users/Arnaud/Documents/_Workspace/gridfinity-rebuilt-openscad/generic-helpers.scad)
[TRACE: call of 'sweep_rounded(width = 33.999, length = 33.999)' in file generic-helpers.scad, line 121](https://github.com/kennetek/gridfinity-rebuilt-openscad/issues/121,C:/Users/Arnaud/Documents/_Workspace/gridfinity-rebuilt-openscad/generic-helpers.scad)
[TRACE: called by 'sweep_rounded' in file gridfinity-rebuilt-utility.scad, line 438](https://github.com/kennetek/gridfinity-rebuilt-openscad/issues/438,C:/Users/Arnaud/Documents/_Workspace/gridfinity-rebuilt-openscad/gridfinity-rebuilt-utility.scad)

looking at the code I saw that profile_wall is called without any parameter (line 364)

                if (enable_lip) profile_wall();
                else profile_wall2();

and it looks like there are other issues in the file, like a call to profile_wall_sub that is not a defined module.

@jpypi
Copy link
Contributor

jpypi commented Apr 24, 2024

Looks like @EmperorArthur's PR #175 changed the definition of profile_wall to take a parameter and removed profile_wall_sub...

@EmperorArthur
Copy link
Collaborator

Looks like @EmperorArthur's PR #175 changed the definition of profile_wall to take a parameter and removed profile_wall_sub...

Downside of not using an IDE. Global search/replace is only per file, and will do partial words, so I avoid it.

It may be worth it to see about creating a github action to exercise some more of the code.

One of my goals is to slowly remove the need for non constant global variables, which is why that was added. At the least assertions help to find the problem sooner.

@EmperorArthur
Copy link
Collaborator

I am re-working PR #179 with some simple test cases . Which can then be expanded in the future to make sure I don't break anything else.

I am almost done and will work on fixing this issue next.

@Splarkszter
Copy link

Splarkszter commented Aug 5, 2024

Can confirm OpenSCAD nightly.

Parsing design (AST generation)...
Compiling design (CSG Tree generation)...
ERROR: Assertion 'is_num(height_mm)' failed in file gridfinity-rebuilt-utility.scad, line 369
TRACE: called by 'assert' in file gridfinity-rebuilt-utility.scad, line 369
TRACE: call of 'profile_wall2(height_mm = undef)' in file gridfinity-rebuilt-utility.scad, line 368
TRACE: called by 'profile_wall2' in file gridfinity-spiral-vase.scad, line 367
TRACE: called by 'if' in file gridfinity-spiral-vase.scad, line 366
TRACE: called by 'children' in file gridfinity-rebuilt-utility.scad, line 378
TRACE: called by 'children' in file generic-helpers.scad, line 163
TRACE: called by 'linear_extrude' in file generic-helpers.scad, line 162
TRACE: called by 'multmatrix' in file generic-helpers.scad, line 161
TRACE: called by 'for' in file generic-helpers.scad, line 160
TRACE: called by 'union' in file generic-helpers.scad, line 158
TRACE: call of 'sweep_rounded(width = 33.999, length = 75.999)' in file generic-helpers.scad, line 123
TRACE: called by 'sweep_rounded' in file gridfinity-rebuilt-utility.scad, line 377
Compiling design (CSG Products generation)...
Geometries in cache: 130
Geometry cache size in bytes: 494736
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
Normalized tree has 1 elements!
Compile and preview finished.
Total rendering time: 0:00:00.066``

@EmperorArthur
Copy link
Collaborator

PR #181 fixes this, but current settings require a review before it can be merged.

@Splarkszter
Copy link

PR #181 fixes this

Thanks.
I downloaded the modified file manually and saved it to the project folder, it kinda works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants