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

Attach does not apply rotation with connectors pointing in opposite directions #2

Open
cun83 opened this issue Mar 23, 2013 · 1 comment

Comments

@cun83
Copy link

cun83 commented Mar 23, 2013

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]);
}

@truejavi
Copy link

truejavi commented Jun 1, 2017

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.

I'm new in github, how can I show you it?

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

No branches or pull requests

2 participants