openframeworks / openframeworks/openFrameworks

ofPolyline - extra point added when using addVertex and bezierTo

Open
#1,664 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug core prelim-analysis section-2D
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

when creating a bezier curve,
bezierTo() function requires that at least one point is added to ofPolyline before it can be used.

so to kick things off, i add my first point
polyline.addVertex(0, 0);

i then add my bezier curve,
polyline.bezierTo(cx1, cy1, cx2, cy2, px2, py2);

when inspecting the resulting ofPolyline im seeing the first two points as identical - both (0, 0)

the second point is a duplicate.
so the first bezier point should be ignored as it has already been added as a vertex.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using ofPolyline with addVertex(0, 0) followed by bezierTo(cx1, cy1, cx2, cy2, px2, py2), then inspect the resulting points. Start with the addVertex and bezierTo entry points; done means the initial point is not duplicated in the resulting polyline.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.