You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/shape/curves.js
+14-116
Original file line number
Diff line number
Diff line change
@@ -214,109 +214,6 @@ function curves(p5, fn){
214
214
returnthis;
215
215
};
216
216
217
-
/**
218
-
* Sets the number of segments used to draw Bézier curves in WebGL mode.
219
-
*
220
-
* In WebGL mode, smooth shapes are drawn using many flat segments. Adding
221
-
* more flat segments makes shapes appear smoother.
222
-
*
223
-
* The parameter, `detail`, is the number of segments to use while drawing a
224
-
* Bézier curve. For example, calling `bezierDetail(5)` will use 5 segments to
225
-
* draw curves with the <a href="#/p5/bezier">bezier()</a> function. By
226
-
* default,`detail` is 20.
227
-
*
228
-
* Note: `bezierDetail()` has no effect in 2D mode.
229
-
*
230
-
* @method bezierDetail
231
-
* @param {Number} detail number of segments to use. Defaults to 20.
232
-
* @chainable
233
-
*
234
-
* @example
235
-
* <div>
236
-
* <code>
237
-
* // Draw the original curve.
238
-
*
239
-
* function setup() {
240
-
* createCanvas(100, 100);
241
-
*
242
-
* background(200);
243
-
*
244
-
* // Draw the anchor points in black.
245
-
* stroke(0);
246
-
* strokeWeight(5);
247
-
* point(85, 20);
248
-
* point(15, 80);
249
-
*
250
-
* // Draw the control points in red.
251
-
* stroke(255, 0, 0);
252
-
* point(10, 10);
253
-
* point(90, 90);
254
-
*
255
-
* // Draw a black bezier curve.
256
-
* noFill();
257
-
* stroke(0);
258
-
* strokeWeight(1);
259
-
* bezier(85, 20, 10, 10, 90, 90, 15, 80);
260
-
*
261
-
* // Draw red lines from the anchor points to the control points.
262
-
* stroke(255, 0, 0);
263
-
* line(85, 20, 10, 10);
264
-
* line(15, 80, 90, 90);
265
-
*
266
-
* describe(
267
-
* 'A gray square with three curves. A black s-curve has two straight, red lines that extend from its ends. The endpoints of all the curves are marked with dots.'
* // Draw red lines from the anchor points to the control points.
303
-
* stroke(255, 0, 0);
304
-
* line(35, -30, -40, -40);
305
-
* line(-35, 30, 40, 40);
306
-
*
307
-
* describe(
308
-
* 'A gray square with three curves. A black s-curve is drawn with jagged segments. Two straight, red lines that extend from its ends. The endpoints of all the curves are marked with dots.'
0 commit comments