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

Vmath node pass1 #28

Merged
merged 11 commits into from
Feb 8, 2017
Merged

Vmath node pass1 #28

merged 11 commits into from
Feb 8, 2017

Conversation

zeffii
Copy link
Contributor

@zeffii zeffii commented Feb 6, 2017

box ticked doesn't mean they have any extensive testing yet, some may not even work yet.

  • Add
  • Sub
  • Cross
  • Scale
  • Scale Reciprocal
  • length
  • dot product
  • opposite
  • distance
  • round
  • Normalize
  • Angle Rad,
  • Angle Deg,
  • Project,
  • Reflect,
  • Componentwise-multiplication,

@ly29
Copy link
Contributor

ly29 commented Feb 6, 2017

Yeah this will need some extra work. Partly why I made the script node to speed up iterations of this.

@zeffii
Copy link
Contributor Author

zeffii commented Feb 6, 2017

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.

@zeffii
Copy link
Contributor Author

zeffii commented Feb 7, 2017

now.. the main question here is... what to do in these scenarios

( Add, (0,0,0,1) (0,0,0,1) ) = (0,0,0,2)

@ly29
Copy link
Contributor

ly29 commented Feb 7, 2017

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

@zeffii
Copy link
Contributor Author

zeffii commented Feb 7, 2017

we can limit w to 0.0...1.0 i think..

@ly29
Copy link
Contributor

ly29 commented Feb 7, 2017

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.

@ly29
Copy link
Contributor

ly29 commented Feb 8, 2017

I am working actively on this right now.

@zeffii
Copy link
Contributor Author

zeffii commented Feb 8, 2017

Cool. I pushed all I had time for. Was considering a wrapper for the repetitious stuff . Not at dev machine

@ly29
Copy link
Contributor

ly29 commented Feb 8, 2017

I just slugging through it now, maybe do a pass later for beauty, kind of regretting 4 vectors right now...

@zeffii
Copy link
Contributor Author

zeffii commented Feb 8, 2017

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

@ly29
Copy link
Contributor

ly29 commented Feb 8, 2017

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.

@ly29
Copy link
Contributor

ly29 commented Feb 8, 2017

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

@ly29
Copy link
Contributor

ly29 commented Feb 8, 2017

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)

@ly29
Copy link
Contributor

ly29 commented Feb 8, 2017

Will merge as is. The reaming modes can be done in master or as a new pull request.

@ly29 ly29 merged commit 732becb into master Feb 8, 2017
@zeffii
Copy link
Contributor Author

zeffii commented Feb 8, 2017

then let's add those remaining functions on a need-to-have basis.

@ly29
Copy link
Contributor

ly29 commented Feb 8, 2017

They are needed I think but there are other things to do as well. And just having this in master is also important.

@ly29 ly29 deleted the vmath_node_pass1 branch February 8, 2017 14:03
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

2 participants