lace / vg

Vector-geometry toolbelt for 3D points and vectors

Home Page:https://vgpy.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: Reflections, trasformation matrix

MCilento93 opened this issue · comments

Why not add the reflections of a vector for given plane normal?
Or even, functions for building trasformation matrix for given actions

Thank you

Hi! Thanks for the suggestions.

Why not add the reflections of a vector for given plane normal?

Sure, I could see adding this vg.

I guess this is the computation you're looking for? https://math.stackexchange.com/questions/13261/how-to-get-a-reflection-vector

This method might be a good one to add to the plane class in polliwog. There's a chance it's a better fit in polliwog, may want to think about that a bit. (Some background here: #95)

Or even, functions for building trasformation matrix for given actions

This already exists in polliwog, which is the computational geometry library built around and designed to work with this toolket. The docs are here:

import numpy as np
from polliwog import CompositeTransform

transform = CompositeTransform()
transform.uniform_scale(10)
transform.reorient(up=np.array([0, 1, 0]), look=np.array([-1, 0, 0]))
transform.translate(np.array([0, -2.5, 0]))

points = np.array([[1.0, 1.0, 1.0], [2.0, 3.0, 4.0]])
transformed_points = transform(points)

Be sure to use the beta version: https://pypi.org/project/polliwog/1.0.0b10/

(The docs could be improved, would welcome a PR for that.)

Hi! Thanks for the suggestions.

Why not add the reflections of a vector for given plane normal?

Sure, I could see adding this vg.

I guess this is the computation you're looking for? https://math.stackexchange.com/questions/13261/how-to-get-a-reflection-vector

This method might be a good one to add to the plane class in polliwog. There's a chance it's a better fit in polliwog, may want to think about that a bit. (Some background here: #95)

Or even, functions for building trasformation matrix for given actions

This already exists in polliwog, which is the computational geometry library built around and designed to work with this toolket. The docs are here:

import numpy as np
from polliwog import CompositeTransform

transform = CompositeTransform()
transform.uniform_scale(10)
transform.reorient(up=np.array([0, 1, 0]), look=np.array([-1, 0, 0]))
transform.translate(np.array([0, -2.5, 0]))

points = np.array([[1.0, 1.0, 1.0], [2.0, 3.0, 4.0]])
transformed_points = transform(points)

Be sure to use the beta version: https://pypi.org/project/polliwog/1.0.0b10/

(The docs could be improved, would welcome a PR for that.)

Well!
Interesting, I was look at something like polliwog but with general Github finder I catch this package (vg) only.
So the both are connected from what I see!

I give a try at polliwog directly because I am lazy to implement from 0 computational geometry with vectors and array.
Why do you recommend new beta version? On pypi I see 0.2.0 is the stable release.

Thank you sir,

Why do you recommend new beta version? On pypi I see 0.2.0 is the stable release.

The new beta version is the one that's closest aligned with the active development. I'd love to get 1.0 released but I'm not sure exactly when that will happen.

If you're interested in adding features in polliwog, please feel free to open an issue there!