Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

**First time visiting? Here are some places to start:**

- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Options

# Rotate plane by degrees about an axis

mark_stouffer
Member Posts:

**9**✭
I am trying to create a series of similar bodies in different different orientations. They are like fingers on a hand.

I am able to create each finger currently, but am having some difficulty orienting them. I pass in a plane to the function that creates each finger, but then I have to rotate several features on each finger.

The passed-in plane parameter needs to be slightly rotated on the x axis. Then when I construct the finger I have to rotate several planes to construct the additional fingers. Right now I am rotating the additional fingers with respect to the original base plane. For the additional features I should be rotating the feature planes with respect to the x-rotated passed-in plane parameter.

I can use opTransform to rotate each finger after it's construction, but is seems to me like it would be more appropriate to construct the bodies on the appropriate plane first, to simplify further construction process.

Is there a method or function that accepts a plane, a degree * number, and a rotationAxis to move the plane or return a new rotated plane?

Thanks for any help or suggestions of a better way to perform such a construction.

I am able to create each finger currently, but am having some difficulty orienting them. I pass in a plane to the function that creates each finger, but then I have to rotate several features on each finger.

The passed-in plane parameter needs to be slightly rotated on the x axis. Then when I construct the finger I have to rotate several planes to construct the additional fingers. Right now I am rotating the additional fingers with respect to the original base plane. For the additional features I should be rotating the feature planes with respect to the x-rotated passed-in plane parameter.

I can use opTransform to rotate each finger after it's construction, but is seems to me like it would be more appropriate to construct the bodies on the appropriate plane first, to simplify further construction process.

Is there a method or function that accepts a plane, a degree * number, and a rotationAxis to move the plane or return a new rotated plane?

Thanks for any help or suggestions of a better way to perform such a construction.

Tagged:

0

## Comments

1,291✭✭✭✭✭9✭9✭... and then it looks like I can parse some values out of pipRotation["linear"] but I thought there might already be a function for rotating a plane along an axis without having to parse the contents of a transform.

1,291✭✭✭✭✭newNormal = pipRotation*oldPlane.normal

newOrigin = pipRotation*oldPlane.origin

newX = pipRotation*oldPlane.x

https://cad.onshape.com/FsDoc/library.html#Transform

9✭9✭1,291✭✭✭✭✭1,1751,291✭✭✭✭✭canbe used for the normal and x, since they're just direction vectors centered on the origin, but would it yield an incorrect result to use the whole transform? Does applying a translation to a direction vector end up changing its direction?Also, in the overloaded operator, the normal is transformed by inverse(tranpose(transform.linear)). What does using the inverse of the transpose do?

1,175The inverse transpose is the correct way to transform a normal if your transform does not preserve right angles: when you apply a transform to a plane, you're actually transforming the basis vectors. If you transform the normal the same way, the result may not be orthogonal to the transformed basis. A more mathematical explanation is here: https://computergraphics.stackexchange.com/questions/1502/why-is-the-transposed-inverse-of-the-model-view-matrix-used-to-transform-the-nor

1,291✭✭✭✭✭9✭Rotation * Plane. WhereasPlane * Rotationfails. This does not conform to the commutative property of the multiplication operator, which I think coders could reasonably expect. I don't think I've ever seen it disregarded before.1,291✭✭✭✭✭matrix multiplication, which is not a commutative operation.9✭1,646To give a little more detail: Matrix multiplication is not commutative, and the origin and normal of the plane being transformed are column vectors.

If you were to want to apply a more complicated transformation to the plane than one rotation, you could do something like:

(transform1) * (transform2) * (plane)

Which is not the same transformation as:

(transform2) * (transform1) * (plane)

(^ as a note here in case you are interested, these multiplications

areassociative, just not commutative)because of the way matrix multiplication operates

(plane) * (transform)

or more specifically

(origin) * (transform) and

(normal) * (transform)

are not valid matrix multiplications (the dimensions of the matrices don't line up)

https://en.wikipedia.org/wiki/Matrix_multiplication