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

Moving a .stl File

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 5, 2016, 04:37
Default Moving a .stl File
  #1
Member
 
gereksiz
Join Date: Mar 2015
Posts: 42
Rep Power: 11
clktp is on a distinguished road
Hello,

I have a stl file but I need to change its position. I know I can scale or rotate it by using surfaceTransformPoints but I couldn't find a way to move it. Is it possible to do it without a CAD program by an OF utility, a script or something like that?

Regards,
clktp is offline   Reply With Quote

Old   February 5, 2016, 05:01
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
surfaceTransformPoints does seem to have a translate feature. Did you try it?

https://github.com/OpenFOAM/OpenFOAM...nsformPoints.C
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   February 5, 2016, 06:02
Default
  #3
Member
 
gereksiz
Join Date: Mar 2015
Posts: 42
Rep Power: 11
clktp is on a distinguished road
Honestly I couldn't use it if it's used for moving it.

for example I used this script and nothing changed.

#!/bin/bash
export FILE="first.stl"
surfaceTransformPoints -translate "(1 1 300)" $FILE
surfaceTransformPoints -rollPitchYaw "(0 0 0 )" $FILE second.stl
clktp is offline   Reply With Quote

Old   February 5, 2016, 09:37
Default
  #4
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
I just tried it and it works. If you properly included your script here it doesn't work because you made a mistake in the command. If not, perhaps the version of the utility you are using is too old.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   February 11, 2016, 11:59
Default
  #5
Member
 
gereksiz
Join Date: Mar 2015
Posts: 42
Rep Power: 11
clktp is on a distinguished road
Yeah it worked, thanks. The reason why it didn't work at the first time is that I didn't write the output file, at least I guess so.

It works like this. It moves the geometry 300 meters in z direction.

#!/bin/bash
export FILE="first.stl"
surfaceTransformPoints -translate "(0 0 300)" $FILE second.stl
clktp 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] funkyDoCalc with OF2.3 massflow NiFl OpenFOAM Community Contributions 14 November 25, 2020 03:30
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation 4 August 14, 2014 06:42
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 03:23
pisoFoam compiling error with OF 1.7.1 on MAC OSX Greg Givogue OpenFOAM Programming & Development 3 March 4, 2011 17:18
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


All times are GMT -4. The time now is 12:24.