Namespace generateMushRoomLoopPoints
Defined in: naview.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Mushroom loop curve generating function.
|
Namespace Detail
generateMushRoomLoopPoints
Mushroom 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
3. Original and scaled centroid are returned.
4. Two new points (bulb points) are generated:
4a. They are created before the first point and after the second point (horizontally) by a given x_step
4b. Their vertical position is arranged at a percentage of the y step
5. Two new points (mushroom points) are generated:
5a. Their x coordinate is defined by a percentage of the centroid to p1 and p2
5b. Their y coordinate is arranged at a percentage of the 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
3. Original and scaled centroid are returned.
4. Two new points (bulb points) are generated:
4a. They are created before the first point and after the second point (horizontally) by a given x_step
4b. Their vertical position is arranged at a percentage of the y step
5. Two new points (mushroom points) are generated:
5a. Their x coordinate is defined by a percentage of the centroid to p1 and p2
5b. Their y coordinate is arranged at a percentage of the y step
- Parameters:
- {Array} p1
- point 1 (start)
- {Array} p2
- point 2 (end)
- {number} step_x
- number of pixels to scale bulb points
- {number} step_y
- number of pixels to scale centroid generating y scaled curve center
- {number} perc_center_x
- (0 to 1), percentage of p1-center and p2-center for mushroom points
- {number} perc_step_y1
- (0 to 1), percentage of y step to generate bulb points
- {number} perc_step_y2
- (0 to 1), percentage of y step to generate mushroom points
- {number} y_direction
- (1.0 or -1.0), y direction to scale step
- {number} x_skew_perc
- Optional percentual between centroid x and point 1 x to move the y scaled curve center
- {Object} add_wavefold_obj
- Optional: addition of a folding object. See