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

First time visiting? Here are some places to start:

  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

rotate a vector and points

Otaola_FrancoOtaola_Franco Member Posts: 54 EDU
hello,
how can I rotate vectors and points around a line with a given angle in FS? (to move them by the angle given)
as opTransform only accepts bodies....

Tagged:

Answers

  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 944
    opTransform is for rotating geometry in the context.  For transforming vectors (and other things like lines and planes) you can just multiply the transform by the point:
    var myTransform = rotationAround(myLine, 30 * degree);
    var newPoint = myTransform * (vector(1, 2, 3) * meter);
    Ilya Baran \ Director, Architecture and FeatureScript \ Onshape Inc
  • Otaola_FrancoOtaola_Franco Member Posts: 54 EDU
    edited August 29
    opTransform is for rotating geometry in the context.  For transforming vectors (and other things like lines and planes) you can just multiply the transform by the point:
    var myTransform = rotationAround(myLine, 30 * degree);
    var newPoint = myTransform * (vector(1, 2, 3) * meter);
    i cant succed to make it work....
    trying this :(point1 and 2 are previously defined)
    var Line1=line(point1,point2);
    var transf=rotationAround(X_AXIS,definition.xangle);
    var linerotated= transf*Line1;

    it needed a unit. thanks!
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 944
    Without the specific error (including line number) and the whole feature, it's impossible to debug.  Please post a link to a public document.
    Ilya Baran \ Director, Architecture and FeatureScript \ Onshape Inc
  • Otaola_FrancoOtaola_Franco Member Posts: 54 EDU
    Without the specific error (including line number) and the whole feature, it's impossible to debug.  Please post a link to a public document.
    it is okey, actually when i tried same thing that you told me with vectors, it didnt work, but after i gave them units it worked. so, i solved to translate the points and after do the line.

    thanks anyway
Sign In or Register to comment.