Oscillators
Oscillator scaling functions can be used to modify values over an extrusion. They have the following signature: Osc(OscType type, float amplitude, float cycleCount, float center)
- OscType: The kind of oscillator, Sawtooth, Sine, Square, or Triangle
- Amplitude: The amplitude of the waveform. A value of 1.0 means a range of -1.0 to 1.0
- Cycle Count: How many cycles/periods of the waveform during the extrusion
- Center: Offset the waveform by a certain amount, default is 0. Value of 2 means the waveform will have values from (center - amplitude to center + amplitude)
Oscillator Types |
---|
OscType.SAW |
OscType.SINE |
OscType.SQUARE |
OscType.TRIANGLE |
Oscillator Translation
Translate an extrusion using a sawtooth oscillator
hex = Hexagon(3)
shape = extrude(hex, 20)
shape.translateXY = Osc(OscType.SAW, 1, 2.9)
shape.stepCountHint = 100
render(shape)
Oscillator Scaling
Scale an extrusion using a triangle oscillator
circle = Circle(3)
shape = extrude(circle, 20)
shape.scaleXY = Osc(OscType.TRIANGLE, 1, 2, 1.5)
shape.stepCountHint = 100
render(shape)