You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have 2 connector pointing in exactly opposite direction, then attaching 2 parts with these connector will not apply the 180 degree rotation. Supposedly the cross product of the vectors is 0, and therefor the OpenScad rotate() function does nothing, because it is given a zero vector to rotate around.
I think I've found something. This is because of a problem whith the cross product in two vectors. If they are in the same direction it is [0,0,0].
I've solved it with one if.
If you have 2 connector pointing in exactly opposite direction, then attaching 2 parts with these connector will not apply the 180 degree rotation. Supposedly the cross product of the vectors is 0, and therefor the OpenScad rotate() function does nothing, because it is given a zero vector to rotate around.
Example:
c1 = [[0,0,0] , [-1,0,0], 0];
c2 = [[0,0,0] , [1,0,0], 0];
c3 = [[0,0,0] , [1,0.0001,0], 0];
connector(c1);
connector(c2);
connector(c3);
//not working correctly
attach(c1,c2) {
color("blue") cube([30,10,5]);
}
//workaround by moving the connector vector a tiny bit
attach(c1,c3) {
color("red") cube([30,10,5]);
}
The text was updated successfully, but these errors were encountered: