using vector operations (subtract)
-
Hello,
yesterday I needed to modify my 2 axis slicer script for it to be compatible with latest v2 version. The error shown into web console was about subtract, so I first thought there was a problem with CSG subtract and discarded the code using it, but indeed it was vec3.subtract that I'm using as a replacement of now deprecated minus(). I replaced it with//d = vec3.subtract(b[1], b[0]); d = [b[1][0]-b[0][0], b[1][1]-b[0][1], b[1][2]-b[0][2]];but isn't there anymore a way to use vector operations like subtract() because it helps keeping the code easy to read.
-
@gilboonet you hit one of the differences in the maths.
Change
subtract(a, b) to subtract(a, a, b)
If you need to then create a new vec.
subtract(vec3.create(), a, b)
-
You can find the API documentation at www.Openjscad.xyz/docs/
There should be some simple examples as well.
-
@z3dev Thanks, I will change to subtract(a, a, b)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login