Skip to content

Commit cf449f4

Browse files
authored
some minor fixes.
1 parent 3b8f573 commit cf449f4

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

src/shape/custom_shapes.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,6 +1670,7 @@ function customShapes(p5, fn) {
16701670
* It works the same way with any number of points.
16711671
*
16721672
*
1673+
*
16731674
* ```js
16741675
* beginShape();
16751676
*
@@ -1685,6 +1686,8 @@ function customShapes(p5, fn) {
16851686
* endShape();
16861687
* ```
16871688
*
1689+
* <img src="assets/openCurveSpline.png"></img>
1690+
*
16881691
*
16891692
* Passing in `CLOSE` to `endShape()` closes the spline smoothly.
16901693
* ```js
@@ -1702,6 +1705,9 @@ function customShapes(p5, fn) {
17021705
* endShape(CLOSE);
17031706
* ```
17041707
*
1708+
* <img src="assets/closeCurveSpline.png"></img>
1709+
*
1710+
*
17051711
* By default (`ends: INCLUDE`), the curve passes through
17061712
* all the points you add with `splineVertex()`, similar to
17071713
* the <a href="#/p5/spline">spline()</a> function. To draw only
@@ -1913,13 +1919,11 @@ function customShapes(p5, fn) {
19131919
* You can also set it to `EXCLUDE` i.e. `splineProperty('ends', EXCLUDE)`,
19141920
* which makes the spline pass through all points except the endpoints.
19151921
*
1916-
* INCLUDE case will have the spline passing through
1922+
* `INCLUDE` case will have the spline passing through
19171923
* all points, like this:
19181924
*
1919-
* // TODO: add images.
1920-
*
19211925
* ```js
1922-
* splineProperty('ends', INCLUDE);
1926+
* splineProperty('ends', INCLUDE); // no need to set this, as it is the default
19231927
* spline(25, 46, 93, 44, 93, 81, 35, 85);
19241928
*
19251929
* point(25, 46);
@@ -1928,9 +1932,13 @@ function customShapes(p5, fn) {
19281932
* point(35, 85);
19291933
* ```
19301934
*
1935+
* <img src="assets/includeSpline.png"></img>
1936+
*
1937+
*
19311938
* EXCLUDE case will have the spline passing through
19321939
* the middle points, like this:
19331940
*
1941+
*
19341942
* ```js
19351943
* splineProperty('ends', INCLUDE);
19361944
* spline(25, 46, 93, 44, 93, 81, 35, 85);
@@ -1941,6 +1949,8 @@ function customShapes(p5, fn) {
19411949
* point(35, 85);
19421950
* ```
19431951
*
1952+
* <img src="assets/excludeSpline.png"></img>
1953+
*
19441954
* By default, the tightness property is set to `0`,
19451955
* producing a smooth curve that passes evenly through
19461956
* the vertices. Negative values make the curve looser,
@@ -1971,9 +1981,9 @@ function customShapes(p5, fn) {
19711981
* spline(25, 46, 93, 44, 93, 81, 35, 85);
19721982
* ```
19731983
*
1974-
* In all cases, the splines in p5.js are cardinal splines.
1984+
* In all cases, the splines in p5.js are <a href = "https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline">cardinal splines</a>.
19751985
* When tightness is 0, these splines are often known as
1976-
* Catmull-Rom splines. (TODO: add links.)
1986+
* <a href="https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull%E2%80%93Rom_spline">Catmull-Rom splines</a>
19771987
*
19781988
* @method splineProperty
19791989
* @param {String} property
@@ -1989,11 +1999,6 @@ function customShapes(p5, fn) {
19891999
* function setup() {
19902000
* createCanvas(100, 100);
19912001
*
1992-
* describe('A black spline forms a sideways U shape through
1993-
* four points. The spline passes through the points more loosely
1994-
* as the mouse moves left of center (negative tightness), and more
1995-
* tightly as it moves right of center (positive tightness). The
1996-
* tightness is displayed at the bottom.');
19972002
* }
19982003
*
19992004
* function draw() {
@@ -2027,6 +2032,7 @@ function customShapes(p5, fn) {
20272032
* noStroke();
20282033
* textSize(10);
20292034
* text(`tightness: ${round(t, 1)}`, 15, 90);
2035+
* describe('A black spline forms a sideways U shape through four points. The spline passes through the points more loosely as the mouse moves left of center (negative tightness), and more tightly as it moves right of center (positive tightness). The tightness is displayed at the bottom.');
20302036
* }
20312037
* </code>
20322038
* </div>

0 commit comments

Comments
 (0)