Skip to content
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

Added Two.Arc #638

Merged
merged 7 commits into from
May 31, 2022
Merged

Added Two.Arc #638

merged 7 commits into from
May 31, 2022

Conversation

jonobr1
Copy link
Owner

@jonobr1 jonobr1 commented May 31, 2022

Resolves this issue: #605

By adding a Two.Arc class to /extras. You can use like so:

import { Arc } from 'two.js/extras/jsm/arc.js';
const x = two.width / 2;
const y = two.height / 2;
const width = 50;
const height = 33;
const startAngle = 0;
const endAngle = Math.PI * 0.5;
const arc = new Arc(x, y, width, height, startAngle, endAngle);
two.add(arc); // Don't forget to add it to a scene!

and it has the same properties as any Two.Path:

arc.fill = 'red';
arc.dashes = [5, 2];
arc.stroke = 'black';
arc.linewidth = 1;
arc.scale = 5;

@jonobr1 jonobr1 merged commit cf7bc4b into dev May 31, 2022
@jonobr1 jonobr1 deleted the issue-605 branch May 31, 2022 23:07
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.

None yet

1 participant