-
Notifications
You must be signed in to change notification settings - Fork 2
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
Vmath node pass1 #28
Vmath node pass1 #28
Conversation
Yeah this will need some extra work. Partly why I made the script node to speed up iterations of this. |
also my numpy is a little rusty now.. if we can keep the function names close to their numpy namesake's that would be great. |
now.. the main question here is... what to do in these scenarios
|
It will turn into a lot of code like the following I guess out = np.zeros((max_len, 4))
out[:,:3] = a[:,:3]+b[:,:3]
out[:, 3] = max(a[0,3], b[0,3])
return out |
we can limit w to |
It should be either 1.0 or 0.0, the result from cross product be 0, for the others it is depending on the input. |
I am working actively on this right now. |
Cool. I pushed all I had time for. Was considering a wrapper for the repetitious stuff . Not at dev machine |
I just slugging through it now, maybe do a pass later for beauty, kind of regretting 4 vectors right now... |
Yes kind of slows things down initially. A decorator that matches arrays and chops w and lets you set w before returning . Omg the guy fixing our boiler just yelled "god-daamed". Bbl |
I hope your boiler is ok. Made a heavy slugging pass and realized there isn't that much common code to exploit, I am sure the similarities could be used somehow but not up to right now. |
Okay I think it is in mostly working conditions. The angle ones can be composed from the existing functions but taking a short break from this... Because the ugliness @node_func(id=18)
def scale(u: Vector = ZEROS, s: Float = 1.0 ) -> Vertices:
u, s = make_compatible(u, s[:, np.newaxis])
out = u.copy()
out[:, :3] = u[:, :3] * s[:, :3]
return out |
The beauty and the beast, but the other way around. @node_func(id=18)
def scale(u: Vector = ZEROS, s: Float = 1.0 ) -> Vertices:
u, s = make_compatible(u, s[:, np.newaxis])
out = u.copy()
out[:, :3] = u[:, :3] * s[:, :3]
return out
@node_func(id=22)
def scale_reciprocal(u: Vector = ZEROS, s: Float = 1.0 ) -> Vertices:
return scale(u, 1 / s) |
Will merge as is. The reaming modes can be done in master or as a new pull request. |
then let's add those remaining functions on a need-to-have basis. |
They are needed I think but there are other things to do as well. And just having this in master is also important. |
box ticked doesn't mean they have any extensive testing yet, some may not even work yet.