-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Add ability to draw 3d circles #6
Comments
Closed
For anyone interested: You can draw an approximation of a circle using the const precision = 42;
let circleXYPoints = {
x: [],
y: [],
z: [],
}
for (let i = 0; i <= Math.PI * 2; i = i + (Math.PI / precision)) {
circleXYPoints.x.push(Math.cos(i) * r);
circleXYPoints.y.push(Math.sin(i) * r);
circleXYPoints.z.push(0);
}
points.push({
id: 'circle',
type: 'QuadraticBezier',
color: 'red',
...circleXYPoints,
}); |
Hi @fuddl , thanks your the input, here's the plugin if anyone's interested: it would be nice if it's possible to draw circles that are "angled" in 3d space, circles which are not parallel to the |
I will have to think about it |
I think you can use this function
- rotateXYZmatrix
const rotateXYZmatrix = (euler: { x: number; y: number; z: number }):
matrix4x4
to pass the angles in degrees on the x y z
direction and the multiply that with
(x, y, z, 0) point vector.. to get the resulting rotated point of each
circle.
when my sched frees up i’ll make a concrete example… thank you! 😊
…On Tue, Mar 29, 2022 at 2:49 AM fuddl ***@***.***> wrote:
I will have to think about it
—
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMX2FJDKJ6BEWFSXWT6RLTVCH5LNANCNFSM4QPQAAGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Algorithm
The text was updated successfully, but these errors were encountered: