discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

New organization for OpenSCAD Language manual

DM
doug moen
Mon, Mar 21, 2016 6:53 PM

Larry Boyd said: @Doug: I basically agree with your suggested order for the
language portion of the manual. Why don't you post it in a new thread?

Okay. Here's a reorganized table of contents for the language manual.

  1. General
    functional/declarative programming
    scripts, statements, expressions
    statements: assign, if for ; {}
    expressions: let() ?: operator precedence
    function/module calls, positional and named arguments
    data types: undef, bool, number, string, list, range
    3 namespaces: variables, functions, modules,
    scoping rules, lexical scoping, special variables
  2. Constructing 3D Objects
    cube(), sphere(), cylinder(), polyhedron(),
    linear_extrude(), rotate_extrude()
    import stl and off, surface()
  3. Constructing 2D Objects
    square(), circle(), polygon(), projection(), text(),
    import dxf
  4. Geometric Operations
    4.1 Affine Transformations: scale, rotate, translate, mirror, multmatrix
    4.2 Set Operations: union, intersection, difference, intersection_for
    4.3 Other: resize, offset, minkowski, hull
  5. Booleans
    true, false, &&, ||, !
    if, ?:
  6. Numbers
    numeric literals, NaN, Inf
    +, -, *, /, %,
    trig: PI,cos,sin,tan,acos,asin,atan,atan2,
    transcendental: exp,ln,log,pow,sqrt,
    abs,ceil,floor,max,min,rands,round,sign
  7. Strings
    string literals
    x[i], len(),str(),chr()
  8. Lists and Ranges
    syntax: list literals, list comprehensions, ranges
    x[i], concat(),len(),search(),
    for()
  9. Linear Algebra (Vectors and Matrices)
    cross(),norm(), + - * / on vectors and matrices
  10. Function and Module Definitions
    function, module, children()
  11. External Library Scripts
    use<>, include<>, variable override behaviour
  12. Other
    Preview: color(), render(), convexity arguments
    Animation: $t, $vpr, $vpt, $vpd
    Modifiers: % # ! *
    echo(), version(), version_num(),
    parent_module(), $parent_modules

This isn't a strict reference manual, with an alphabetical list of
primitives, each defined in exactly one place. It's organized by topic, and
sometimes the same primitive needs to be discussed under several topics.
Eg, + is specified in General/operator precedence, Numbers, and Linear
Algebra, while len() is specified in String and List. There will be See
Also links to other sections where appropriate.

Larry Boyd said: @Doug: I basically agree with your suggested order for the language portion of the manual. Why don't you post it in a new thread? Okay. Here's a reorganized table of contents for the language manual. 1. General functional/declarative programming scripts, statements, expressions statements: assign, if for ; {} expressions: let() ?: operator precedence function/module calls, positional and named arguments data types: undef, bool, number, string, list, range 3 namespaces: variables, functions, modules, scoping rules, lexical scoping, special variables 2. Constructing 3D Objects cube(), sphere(), cylinder(), polyhedron(), linear_extrude(), rotate_extrude() import stl and off, surface() 3. Constructing 2D Objects square(), circle(), polygon(), projection(), text(), import dxf 4. Geometric Operations 4.1 Affine Transformations: scale, rotate, translate, mirror, multmatrix 4.2 Set Operations: union, intersection, difference, intersection_for 4.3 Other: resize, offset, minkowski, hull 5. Booleans true, false, &&, ||, ! if, ?: 6. Numbers numeric literals, NaN, Inf +, -, *, /, %, trig: PI,cos,sin,tan,acos,asin,atan,atan2, transcendental: exp,ln,log,pow,sqrt, abs,ceil,floor,max,min,rands,round,sign 7. Strings string literals x[i], len(),str(),chr() 8. Lists and Ranges syntax: list literals, list comprehensions, ranges x[i], concat(),len(),search(), for() 9. Linear Algebra (Vectors and Matrices) cross(),norm(), + - * / on vectors and matrices 10. Function and Module Definitions function, module, children() 11. External Library Scripts use<>, include<>, variable override behaviour 12. Other Preview: color(), render(), convexity arguments Animation: $t, $vpr, $vpt, $vpd Modifiers: % # ! * echo(), version(), version_num(), parent_module(), $parent_modules This isn't a strict reference manual, with an alphabetical list of primitives, each defined in exactly one place. It's organized by topic, and sometimes the same primitive needs to be discussed under several topics. Eg, + is specified in General/operator precedence, Numbers, and Linear Algebra, while len() is specified in String and List. There will be See Also links to other sections where appropriate.