Skip to content

Adds new operation 'arc' to draw arcs on current path. #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 24, 2023

Conversation

GPrimola
Copy link
Contributor

@GPrimola GPrimola commented Aug 7, 2023

This PR adds a new operation arc to add arcs to current path.

Motivation

Today we only have 2 interfaces to have arcs:

  1. draw_arc/4: which draws an arc on a new path;
  2. arc_to/6: which adds an arc on the current path.

The need for a third arc operation is that none of the above functions provide a flexible interface for arcs as the nvgArc does.

So this new operation arc have the same parameters as nvgArc, which gives a more flexible interface for drawing arcs.

Further notes

This PR is a dependency to ScenicFramework/scenic#326, thus it should be merged first.

Comment on lines 127 to 128
FLAG_CCW = 0X01,
FLAG_CW = 0X02,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
FLAG_CCW = 0X01,
FLAG_CW = 0X02,
SWEEP_DIR_CCW = 0X01,
SWEEP_DIR_CW = 0X02,

@@ -148,6 +154,7 @@ SCRIPT_FUNC(line_to, coordinates_t a);
SCRIPT_FUNC(arc_to, coordinates_t a, coordinates_t b, float radius);
SCRIPT_FUNC(bezier_to, coordinates_t c0, coordinates_t c1, coordinates_t a);
SCRIPT_FUNC(quadratic_to, coordinates_t c, coordinates_t a);
SCRIPT_FUNC(arc, coordinates_t c, float radius, float a0, float a1, int sweep_dir);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SCRIPT_FUNC(arc, coordinates_t c, float radius, float a0, float a1, int sweep_dir);
SCRIPT_FUNC(arc, coordinates_t c, float radius, float a0, float a1, sweep_dir_t sweep_dir);

@GPrimola GPrimola requested a review from ringlej August 13, 2023 16:34
Copy link
Contributor

@ringlej ringlej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@crertel crertel merged commit 0400504 into ScenicFramework:main Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants