|Samuel H. (modelleicher)||26.06.2016 19:14|
Recently i found myself experimenting with split shapes and i've come across the testSplitShape() function in the chainsaw script.
testSplitShape(self.curSplitShape, x,y,z, nx,ny,nz, yx,yy,yz, self.cutSizeY, self.cutSizeZ);
I've tried to implement the function into my script, but so far without any success. First i tried the reference transform for the x, y, z position pointing in the same direction as on the chainsaw, and used the same lines of code for nx, ny, nz and yx, yy, yz.. But i got nothing.
So i tried the same with findSplitShape() and i got a result once. But never at the point where i pointed to.
So the main question is, what exactly are nx, ny, nz and yx, yy, yz?
My initial guess was nx, ny and nz are the direction, yx, yy, yz are some sort of up vectors same as for the setDirection() function but it doesn't make too much sense to me.
My main goal is to get the thickness/diameter (and center point) in Y/Z direction of a splitshape by simply pointing at it with a transformGroup to add something like the ringSelector to the tree.
|Emil Drefers (Unknown)||27.06.2016 07:47|
it's the other waay round.
nx,ny,nz are the components of an upvector for the cutting plane (rather area as it is limited in size).
yx,yy,yz form one vector of the cutting plane (rather area).
The second vector for the cutting area can be calculated from the cross product of these two vectors.
So, in the end you get two vectors or the definition of a plane and a limitation of the plane by the calues for the cutSizes.
Anyhow, you need to call teh testSplitShape function with a valid splitShape as the very first argument.
As soon as you get valid results it should be no problem to calculate a thickness.
|Samuel H. (modelleicher)||27.06.2016 12:07|
Thank you! Works like a charm ;)
Note: Log in to post. Create a new account here.