OpenSCAD v0.5.2 OpenSCAD.Renderable protocol View Source

We'll try and render anything, because it could be a deeply nested structure of things to render, so we'll keep going until we hit something we can't handle.

Link to this section Summary

Types

Rendering Options

t()

The types of renderables

Functions

Returns a string of what is hopefully valid OpenSCAD, but it's possible the programmer is asking for something invalid, like a circle with an 'eleventeen' radius. It'll try and pass that along to OpenSCAD, and it would fail just as OpenSCAD should.

Returns the type of the renderable, the important ones being :object and :transformation, which will be used to generate different functionallity via the OpenSCAD.Action.before_compile macro

Link to this section Types

Link to this type

options()

View Source
options() :: {:indent, nil | non_neg_integer()} | {:raise, boolean()}

Rendering Options:

  • indent: nil | integer()

    • number of spaces to prefix this renderable with
    • nil skips indenting all together
  • raise: boolean()

    • true (default) - raises if any child is unrenderable
    • false - skips the child entirely, renders what it can
Link to this type

types()

View Source
types() :: :string | :list | :object | :transformation | :nope

The types of renderables

Link to this section Functions

Link to this function

to_scad(thing, opts \\ [indent: 0, raise: true])

View Source
to_scad(any(), [options()]) :: String.t()

Returns a string of what is hopefully valid OpenSCAD, but it's possible the programmer is asking for something invalid, like a circle with an 'eleventeen' radius. It'll try and pass that along to OpenSCAD, and it would fail just as OpenSCAD should.

Will raise if something isn't renderable within the structure.

Returns the type of the renderable, the important ones being :object and :transformation, which will be used to generate different functionallity via the OpenSCAD.Action.before_compile macro