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.
### 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)
Phase, in degrees, of the angle where the ring’s and wheel’s teeth are engaged. If null, undefined, or omitted, the default value is 0. TODO: Document this parameter more exactly.offset
(Type: number)
X coordinate of the center of the fixed ring.holeStep
(Type: number)
TODO: Not documented yet.offsetStep
(Type: number)
TODO: Not documented yet.count
(Type: number)
TODO: Not documented yet.
Return Value
This object. (Type: 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. If null, undefined, or omitted, the default value is 0. TODO: Document this parameter more exactly.
Return Value
This object. (Type: 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. If null, undefined, or omitted, the default value is 0. TODO: Document this parameter more exactly.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)
### 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)
TODO: Not documented yet.
Return Value
Return value. (Type: *)