# shape()

# Example


Example 2 (click to open)

Example 3 Construction Modes

Example 4 Parameters

Example 5 Higher Order Functions

# Description

Creates a new primitive shape. All state changing commands (color, displacement, geometry modes) are encapsulated and will only have an affect within scope of the provided function. Useful for isolating components with their own distortions and materials. Shapes can be nested for hierarchical modeling.

# Syntax

shape(shape_func);

# Parameters

shape_func Function: A function which draws a shape.

# Returns

Function: An encapsulated version of shape_func which will not modify any drawing state outside of its own scope.
Note: Any arguments given to this function will be forwarded as arguments to shape_func.