Sat 19 Jan 2013 11:45:50 AM UTC, comment #1:
You are correct. This has been fixed in commit 4ee899.
Actually, I used x.reshape(1,-1) to avoid the .T
x = dotpr(n,(x-P)).reshape(-1,1)
return self - x*n
I guess that the error was undetected for so long because the function was mostly used with a single plane. And the only cases of projections on multiple planes that I could find used parallel planes with a single normal, in which case the function worked well.
I'm closing the bug, but if anyone finds misbehavior because of the change, please reopen.
|
Fri 18 Jan 2013 08:58:02 AM UTC, original submission:
I think projectOnPLane in coords.py should be modified:
(1402) - return self + outer(x,n).reshape(self.shape)
(1402) + return self+(n.T*x).T
When,
shape(a)=(i,j)
shape(b)=(k,l)
then,
shape(outer(a,b))=(ij,kl)
Here,
shape(x)= (1) or (k)
shape(n)= (1,3) or (k,3)
Thus,
shape(outer(x,n))= (1,3), (k,3), (1,3k) or (k,3k)
where (1,3k) and (k,3k) are not reshapeable to self.shape(=(3) or (k,3))
I think (n.T*x).T should do fine instead, but it should be checked as I assume that projectOnPLane has been used in multiple script already.
|