Skip to content

Meta Data Use Cases

Torsten Paul edited this page Nov 15, 2015 · 4 revisions

Model Meta Data

Note: Syntax borrowed from Java Annotations, just to show how it's meant to be used.

References

(Global) Variables

Example use case is a parameter window similar to the Thingiverse Customizer. The meta-data adds information about the model parameter like description, default value and date range.

See http://files.openscad.org/video/screencast-parameter-window.webm

  • Parameter GUI / Customizer
@Param(default = 3, values = [ 1, 3, 6])
variable = 0;

Module definitions

@Description(text = "Metric screw")
module screw(@Param() diameter, @Param() length) {
  ...
}

Example use case could be an automatically generated list of available modules: Import the library -> Compile -> List of available parts with description for the module and parameters is generated.

See http://files.openscad.org/video/screencast-library-window.webm

  • Library parts descriptions

Module instantiation

module model2D(diameter, length) {
  ...
}

@DxfLayer(name = "layer1")
model2D();

@DxfLayer(name = "layer2")
translate([20, 0]) model2D();

Attached to module instantiation the meta data can allow to collect data like bills of materials. This would also need to include values of the instance (e.g. the diameter and length of a screw() module).

  • Bill of Material
  • Additional information for slicers, e.g. Modifier Meshes / Layer height
  • Export options, e.g. Layers for DXF, Multiple volumes for AMF
  • Labels for modules to show in the viewport
Clone this wiki locally