Thingiverse

OpenSCAD Module_Help by txoof
by Thingiverse
Last crawled date: 4 years, 2 months ago
I got tired of cracking open libraries that I wrote and trying to decipher the comments and documentation that I left for myself. Instead, I thought it would be nice if I could just use <./path/to/library> and then call help_libraryName() to get a list of the available functions and module calls.
This is an attempt to add a standardized way of documenting modules.
The current version will be hosted on Git Hub: https://github.com/txoof/module_help
Add the module help_YourLibraryNameHere() {} to your OpenSCAD library to provide some
callable help.
Usage from an imported library:
//provide a list of all help topics in the "colors" library:
use <./libraries/colors.scad>
help_colors();
//output:
ECHO: "Available Help Topics in this Library:"
ECHO: "colorArray"
ECHO: "chord"
ECHO: "RGB"
ECHO: "RGBScale"
ECHO: "red"
ECHO: "redScaled"
//get help on a particular topic from the "colors" library:
help_colors("colorAray");
//output:
ECHO: "Help for module/function: colorArray"
ECHO: "function: colorAray(columns =, rows = )"
ECHO: "returns:"
ECHO: "Description: returns column X rows vector of interpolated RGB values"
ECHO: "Paramaters:"
ECHO: " columns 1-255 columns"
ECHO: " rows 1-255 rows"
ECHO: " scaled scale the colors from white to full color"
The model library included below requires a library name and a vector containing specific
help information. See the examples below:
//Examples
LibraryName = "Name of your library";
modules = [
["nameOfModuleOrFunction", //callable name of module
// module/function: callable name of function (paramater1 = )
"module: nameOfModuleOrFunction(param1 = "),
//returns: description of return OR none (module)
"returns: none (module)",
//description of function
"Description: This module does things",
//Paramaters: - list of paramaters, data types and an explanation of use
"Paramaters: ",
//paramater one
" radius radius of bolt head"
//paramter two
" number number of objects to draw"
], //following modules can be described using the same format
];
This is an attempt to add a standardized way of documenting modules.
The current version will be hosted on Git Hub: https://github.com/txoof/module_help
Add the module help_YourLibraryNameHere() {} to your OpenSCAD library to provide some
callable help.
Usage from an imported library:
//provide a list of all help topics in the "colors" library:
use <./libraries/colors.scad>
help_colors();
//output:
ECHO: "Available Help Topics in this Library:"
ECHO: "colorArray"
ECHO: "chord"
ECHO: "RGB"
ECHO: "RGBScale"
ECHO: "red"
ECHO: "redScaled"
//get help on a particular topic from the "colors" library:
help_colors("colorAray");
//output:
ECHO: "Help for module/function: colorArray"
ECHO: "function: colorAray(columns =
ECHO: "returns:
ECHO: "Description: returns column X rows vector of interpolated RGB values"
ECHO: "Paramaters:"
ECHO: " columns
ECHO: " rows
ECHO: " scaled
The model library included below requires a library name and a vector containing specific
help information. See the examples below:
//Examples
LibraryName = "Name of your library";
modules = [
["nameOfModuleOrFunction", //callable name of module
// module/function: callable name of function (paramater1 = )
"module: nameOfModuleOrFunction(param1 = "),
//returns: description of return OR none (module)
"returns: none (module)",
//description of function
"Description: This module does things",
//Paramaters: - list of paramaters, data types and an explanation of use
"Paramaters: ",
//paramater one
" radius
//paramter two
" number
], //following modules can be described using the same format
];