nophead / NopSCADlib

Library of parts modelled in OpenSCAD and a framework for making projects
GNU General Public License v3.0
1.17k stars 155 forks source link

Issue using vitamins/extrusion_brackets.scad> #252

Closed LenStruttmann closed 1 year ago

LenStruttmann commented 1 year ago

I guess that I am confused about how to use NopSCADlib vitamins.

This works fine: include <NopSCADlib/lib.scad>
extrusion(E2020, 50);

But this does not: include <NopSCADlib/lib.scad>
extrusion_corner_bracket(E2020);

I get the following error: Compiling design (CSG Tree generation)... WARNING: undefined operation (undefined / number) in file screws.scad, line 134 TRACE: called by 'find_screw' in file extrusion_bracket.scad, line 99 TRACE: called by 'screw_clearance_radius' in file extrusion_bracket.scad, line 99 TRACE: called by 'extrusion_corner_bracket' in file AZELD_Assembly-00.scad, line 19 Compiling design (CSG Products generation)...

What am I doing wrong?

Thanks

nophead commented 1 year ago

You have passed an extrusion instead of an extrusion bracket as the type parameter. E.g. E20_inner_corner_bracketor E20_corner_bracket.

LenStruttmann commented 1 year ago

Yes, I see that now. In my newbieness I was confused, not realizing that the parameter "type" means different things for extrusions and extrusion_brackets. Thanks!

As a suggestion, to avoid future newbie questions, you could change the documentation to explicitly specify "extrusion_type" and "extrusion_bracket_type". Just a thought.

Thanks! And thanks for the library! Len

nophead commented 1 year ago

I use type like this in C++ and self in Python, so every parametric object in the library has a type parameter. The documentation is made from the source code, so it has to match it. If they were given more meaningful names it would make the code a lot more verbose because the type parameter is always heavily used.