Package topo :: Package pattern :: Module basic :: Class Disk
[hide private]
[frames] | no frames]

Class Disk

source code

                        object --+        
                                 |        
 param.parameterized.Parameterized --+    
                                     |    
base.patterngenerator.PatternGenerator --+
                                         |
                                        Disk

2D disk pattern generator.

An elliptical disk can be obtained by adjusting the aspect_ratio of a circular disk; this transforms a circle into an ellipse by stretching the circle in the y (vertical) direction.

The Gaussian fall-off at a point P is an approximation for non-circular disks, since the point on the ellipse closest to P is taken to be the same point as the point on the circle before stretching that was closest to P.

Nested Classes [hide private]

Inherited from param.parameterized.Parameterized: __metaclass__

Instance Methods [hide private]
 
function(self, params)
Function to draw a pattern that will then be scaled and rotated.
source code

Inherited from base.patterngenerator.PatternGenerator: __call__

Inherited from param.parameterized.Parameterized: __getstate__, __init__, __repr__, __setstate__, __str__, debug, defaults, force_new_dynamic_value, get_param_values, get_value_generator, inspect_value, message, print_param_values, script_repr, set_dynamic_time_fn, state_pop, state_push, verbose, warning

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Class Methods [hide private]

Inherited from param.parameterized.Parameterized: params, print_param_defaults

Class Variables [hide private]
  aspect_ratio = param.Number(default= 1.0, bounds= (0.0, None),...
Ratio of width to height; size*aspect_ratio gives the width of the disk.
  size = param.Number(default= 0.5, doc= "Top to bottom height o...
Top to bottom height of the disk
  smoothing = param.Number(default= 0.1, bounds= (0.0, None), so...
Width of the Gaussian fall-off

Inherited from base.patterngenerator.PatternGenerator: bounds, mask, mask_shape, offset, orientation, output_fn, position, scale, x, xdensity, y, ydensity

Inherited from param.parameterized.Parameterized: name, print_level

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

function(self, params)

source code 

Function to draw a pattern that will then be scaled and rotated.

Instead of implementing __call__ directly, PatternGenerator subclasses will typically implement this helper function used by __call__, because that way they can let __call__ handle the scaling and rotation for them. Alternatively, __call__ itself can be reimplemented entirely by a subclass (e.g. if it does not need to do any scaling or rotation), in which case this function will be ignored.

Overrides: base.patterngenerator.PatternGenerator.function
(inherited documentation)

Class Variable Details [hide private]

aspect_ratio

Ratio of width to height; size*aspect_ratio gives the width of the disk.
Value:
param.Number(default= 1.0, bounds= (0.0, None), softbounds= (0.0, 2.0), precedence\
= 0.31, doc= "Ratio of width to height; size*aspect_ratio gives the width of the d\
isk.")

size

Top to bottom height of the disk
Value:
param.Number(default= 0.5, doc= "Top to bottom height of the disk")

smoothing

Width of the Gaussian fall-off
Value:
param.Number(default= 0.1, bounds= (0.0, None), softbounds= (0.0, 0.5), precedence\
= 0.61, doc= "Width of the Gaussian fall-off")