Skip to content
ExamplesOpen editor ↗

ntlhanaBezier

→ bezierVertex()

Adds one Bézier point to the shape you are building.

ntlhanaBezier(x, y)

Between simololaPopego and feleletsaPopego, ntlhanaBezier(x, y) adds one point of a Bézier curve.

⚠ It takes two numbers only. Each call adds one point; you call ntlhanaBezier repeatedly to build the curve.

The number of calls must be 1 + a multiple of 3. The first call is the starting place; after that each curve takes three calls — two control points and one end point. So one curve needs 4 calls, and two curves need 7.

⚠ Get the count wrong and the sketch stops with an unreadable error — “Cannot read properties of undefined”. Measured: 2, 3, 5 and 6 all fail; 1, 4 and 7 work.

⚠ It does not work when you have given simololaPopego a kind. It does not fail quietly — it throws.

NameTypeDescription
xpaloThe x coordinate of the point.
ypaloThe y coordinate of the point.
A leaf drawn from two curves
tiro setaLoeto() {
  thalaKanefase(400, 260);
  bokamorago(245);
  tlogelaMothalo();
  tlatsaMmala(70, 150, 90);

  // 7 dibitso = 1 ya go simolola + dikonego tse pedi tsa 3
  simololaPopego();
  ntlhanaBezier(80, 130);
  ntlhanaBezier(140, 20);
  ntlhanaBezier(260, 20);
  ntlhanaBezier(320, 130);
  ntlhanaBezier(260, 240);
  ntlhanaBezier(140, 240);
  ntlhanaBezier(80, 130);
  feleletsaPopego();

  tlhalosa('Popego e e talatala e e jaaka letlhare kgotsa lee, e thadilwe ka dikonego tse pedi tsa Bezier.');
}

simololaPopego, thalaBezier, ntlhana, ntlhanaKonego