CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

How to rotate a STL file with a fixed point by using surfaceTransformPoints

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By olesen

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 23, 2017, 04:11
Default How to rotate a STL file with a fixed point by using surfaceTransformPoints
  #1
Member
 
Lewis
Join Date: Jun 2016
Posts: 34
Rep Power: 10
Lewis Liang is on a distinguished road
Currently, I build up a horizontal cylinder with the STL file as shown in the attached figure. The cylinder is placed in the XY plane and perpendicular to X- axis. Then, I try to rotate the cylinder to a position (90 degree) which is same as the red line with its central point A. I have tried to type these codes from some online tutorial about the surfaceTransformPoints command:
Code:
export FILE="cylinder_v2.stl"
#surfaceTransformPoints -yawPitchRoll "(0 90 0)" cylinder.stl $FILE
#surfaceTransformPoints -rollPitchYaw "(0 90 0)" cylinder.stl $FILE
#surfaceTransformPoints -rotate '( (1 0 0) (0 0 1) )' cylinder.stl $FILE
#surfaceTransformPoints -scale '(1 1 -1)' cylinder.stl $FILE
However, the new STL file is not what I expect after checking in the paraview. Could anyone please give me some tips to deal with this problem?

Thanks in advance!

Zuodong
Attached Images
File Type: jpg sketch.jpg (25.3 KB, 32 views)
Lewis Liang is offline   Reply With Quote

Old   January 4, 2018, 11:37
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by Lewis Liang View Post
Currently, I build up a horizontal cylinder with the STL file as shown in the attached figure. The cylinder is placed in the XY plane and perpendicular to X- axis.
This problem may now be easier to solve. In OpenFOAM-1712 the surfaceTransformPoints and transformPoints now have some additional options.
  • The -rotate-angle option allows convenient specification of a rotation about an arbitrary axis. Eg, -rotate-angle '((1 1 1) 45)'
  • The -origin option can be used to temporarily shift the origin for the rotation operations. Eg, mirroring -origin '(0 0 1)' -rotate-angle '((1 0 0) 180)
You should also note that you can also use a scalar for uniform scaling factors.
Eg '-scale 0.001' instead of -scale '(0.001 0.001 0.001)' for less typing and fewer mistakes.
blttkgl and Lewis Liang like this.
olesen is offline   Reply With Quote

Old   January 7, 2018, 01:24
Default
  #3
Member
 
Lewis
Join Date: Jun 2016
Posts: 34
Rep Power: 10
Lewis Liang is on a distinguished road
Quote:
Originally Posted by olesen View Post
This problem may now be easier to solve. In OpenFOAM-1712 the surfaceTransformPoints and transformPoints now have some additional options.
  • The -rotate-angle option allows convenient specification of a rotation about an arbitrary axis. Eg, -rotate-angle '((1 1 1) 45)'
  • The -origin option can be used to temporarily shift the origin for the rotation operations. Eg, mirroring -origin '(0 0 1)' -rotate-angle '((1 0 0) 180)
You should also note that you can also use a scalar for uniform scaling factors.
Eg '-scale 0.001' instead of -scale '(0.001 0.001 0.001)' for less typing and fewer mistakes.
Hi! @olesen! Thanks for your advice! I will try it later.
Cheers!
Zuodong
Lewis Liang is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] swak4foam for OpenFOAM 4.0 mnikku OpenFOAM Community Contributions 80 May 17, 2022 08:06
[foam-extend.org] problem when installing foam-extend-1.6 Thomas pan OpenFOAM Installation 7 September 9, 2015 21:53
Trouble compiling utilities using source-built OpenFOAM Artur OpenFOAM Programming & Development 14 October 29, 2013 10:59
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 01:41
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08


All times are GMT -4. The time now is 01:27.