Namespace generateSwirlLoopPoints
Defined in: naview.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Swirled loop curve generating function.
|
Namespace Detail
generateSwirlLoopPoints
Swirled loop curve generating function.
1. A centroid is calculated between two points
2. This centroid y position is raised by a given step in a given direction (scaled_centroid point)
2a. A skew value CAN added to the x positioning of this centroid point
2b. A swirl value is added to the x positioning of this centroid point
3. Original and scaled centroid are returned.
4. Two new points (swirl points) are generated.
4a. Their x coordinates are guided by the opposite swirl value (-1*) of the centroid swirl
4b. Their y coordinates are guided by a percentage of the total y step
1. A centroid is calculated between two points
2. This centroid y position is raised by a given step in a given direction (scaled_centroid point)
2a. A skew value CAN added to the x positioning of this centroid point
2b. A swirl value is added to the x positioning of this centroid point
3. Original and scaled centroid are returned.
4. Two new points (swirl points) are generated.
4a. Their x coordinates are guided by the opposite swirl value (-1*) of the centroid swirl
4b. Their y coordinates are guided by a percentage of the total y step
- Parameters:
- {Array} p1
- point 1 (start)
- {Array} p2
- point 2 (end)
- {number} swirl_x
- swirling value to generate wavy curve
- {number} step_y
- number of pixels to scale centroid generating y scaled curve center
- {number} perc_step_y
- (0 to 1), percentage of y step to generate swirl points
- {number} y_direction
- (1.0 or -1.0), y direction to scale step
- {Object} add_wavefold_obj
- Optional: addition of a folding object. See