module:extras/drawingtoy.DrawingToy
### new module:extras/drawingtoy.DrawingToy()
Generates curves similar to those possible using commercially available drawing toys containing gear-toothed rings and wheels. Curves generated currently assume that the radius of each ring and wheel is equal to its tooth count divided by 5.
Methods
- continuousHypo
Adds line segments that approximate one or more curves drawn by rolling a wheel inside a fixed ring (hypotrochoids), where each additional curve may be drawn from a different hole position, a different ring position, or both. - epi
Adds line segments that approximate a curve drawn by rolling a wheel outside a fixed ring (an epitrochoid). - hypo
Adds line segments that approximate a curve drawn by rolling a wheel inside a fixed ring (a hypotrochoid). - setColor
Sets the color to apply when drawing future curves with this object. - toMeshBuffer
TODO: Not documented yet.
### module:extras/drawingtoy~DrawingToy#continuousHypo(ringTeeth, wheelTeeth, hole, [phase], offset, holeStep, offsetStep, count)
Adds line segments that approximate one or more curves drawn by rolling a wheel inside a fixed ring (hypotrochoids), where each additional curve may be drawn from a different hole position, a different ring position, or both.
Parameters
ringTeeth
(Type: number)
Number of teeth in the fixed ring.wheelTeeth
(Type: number)
Number of teeth in the rolling wheel.hole
(Type: number)
Integer, starting from 1, identifying the hole within the wheel in which the drawing pen is placed. The greater the number, the closer the hole is to the center of the wheel.phase
(Type: number) (optional)
Phase, in degrees, of the angle where the ring’s and wheel’s teeth are engaged. This is the starting angle from the positive X axis toward the positive Y axis, in degrees. If null, undefined, or omitted, the default value is 0.offset
(Type: number)
X coordinate of the center of the fixed ring.holeStep
(Type: number)
Change in the hole number with each additional curve. Any integer, whether positive, negative, or 0.offsetStep
(Type: number)
Change in the X coordinate with each additional curve. Any number, whether positive, negative, or 0.count
(Type: number)
Number of curves to draw.
Return Value
This object. (Type: DrawingToy)
### module:extras/drawingtoy~DrawingToy#epi(ringTeeth, wheelTeeth, hole, [phase])
Adds line segments that approximate a curve drawn by rolling a wheel outside a fixed ring (an epitrochoid).
Parameters
ringTeeth
(Type: number)
Number of teeth in the fixed ring.wheelTeeth
(Type: number)
Number of teeth in the rolling wheel.hole
(Type: number)
Integer, starting from 1, identifying the hole within the wheel in which the drawing pen is placed. The greater the number, the closer the hole is to the center of the wheel.phase
(Type: number) (optional)
Phase, in degrees, of the angle where the ring’s and wheel’s teeth are engaged. This is the starting angle from the positive X axis toward the positive Y axis, in degrees. If null, undefined, or omitted, the default value is 0.
Return Value
This object. (Type: DrawingToy)
### module:extras/drawingtoy~DrawingToy#hypo(ringTeeth, wheelTeeth, hole, [phase], [offset])
Adds line segments that approximate a curve drawn by rolling a wheel inside a fixed ring (a hypotrochoid).
Parameters
ringTeeth
(Type: number)
Number of teeth in the fixed ring.wheelTeeth
(Type: number)
Number of teeth in the rolling wheel.hole
(Type: number)
Integer, starting from 1, identifying the hole within the wheel in which the drawing pen is placed. The greater the number, the closer the hole is to the center of the wheel.phase
(Type: number) (optional)
Phase, in degrees, of the angle where the ring’s and wheel’s teeth are engaged. This is the starting angle from the positive X axis toward the positive Y axis, in degrees. If null, undefined, or omitted, the default value is 0.offset
(Type: number) (optional)
X coordinate of the center of the fixed ring. If null, undefined, or omitted, the default value is 0.
Return Value
This object. (Type: DrawingToy)
### module:extras/drawingtoy~DrawingToy#setColor(color)
Sets the color to apply when drawing future curves with this object.
Parameters
-
color
(Type: Array.<number>number string)
A color vector or string identifying the color to apply.
Return Value
This object. (Type: DrawingToy)
### module:extras/drawingtoy~DrawingToy#toMeshBuffer()
TODO: Not documented yet.
Return Value
Return value. (Type: *)