# [snappyHexMesh] rotate searchableBox

 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 17, 2017, 09:15 rotate searchableBox #1 Member   Fridrik Magnusson Join Date: Aug 2017 Location: Denmark Posts: 34 Rep Power: 8 Hallo Everyone Im trying to rotate a searchableBox 60 deg (pi/3) with the following command: Code: ```refinementBox4 { type searchableBox; min (0.355 0.190 -0.01); max (0.485 0.250 0.12); transform { coordinateSystem { type cartesian; origin (0 0 0); coordinateRotation { type localAxesRotation; e3 (60 0 0); } } } }``` but it is not rotating at all, can anybody give me a hint of what im doing wrong ?

August 12, 2018, 07:41
#2
New Member

KAWA
Join Date: Mar 2018
Posts: 4
Rep Power: 8
Quote:
 Originally Posted by Fridrik Hallo Everyone Im trying to rotate a searchableBox 60 deg (pi/3) with the following command: Code: ```refinementBox4 { type searchableBox; min (0.355 0.190 -0.01); max (0.485 0.250 0.12); transform { coordinateSystem { type cartesian; origin (0 0 0); coordinateRotation { type localAxesRotation; e3 (60 0 0); } } } }``` but it is not rotating at all, can anybody give me a hint of what im doing wrong ?

Hi Fridrik,
Have you solved this problem, I have exactly the same problem?

Regards

November 9, 2019, 09:56
#3
New Member

Kristina
Join Date: May 2018
Posts: 4
Rep Power: 8
Quote:
 Originally Posted by KMM080 Hi Fridrik, Have you solved this problem, I have exactly the same problem? Regards
I'm posting my solution in the following. Hope it will help someone.

I rotated searchableBox for 45 deg. around y-axes.

Code:
```zone1
{
name zone1;
type searchableRotatedBox;
span    (1 1 1); //dimensions of the box
origin  (0 0 -0.707); //first corner of the box - origin of local coordinate system

//definition of the axes of the local coordinate system (cartesian, left-handed coordinate system)

e1      (0.707 0 0.707); //relationship of e1 local axes and global coord.system
e3      (-0.707 0 0.707); //relationship of e3 local axes and global coord.system
}```

July 31, 2023, 03:19
#4
New Member

Join Date: Jun 2023
Location: Brest
Posts: 21
Rep Power: 3
Quote:
 Originally Posted by KKV_88 I'm posting my solution in the following. Hope it will help someone. I rotated searchableBox for 45 deg. around y-axes. Code: ```zone1 { name zone1; type searchableRotatedBox; span (1 1 1); //dimensions of the box origin (0 0 -0.707); //first corner of the box - origin of local coordinate system //definition of the axes of the local coordinate system (cartesian, left-handed coordinate system) e1 (0.707 0 0.707); //relationship of e1 local axes and global coord.system e3 (-0.707 0 0.707); //relationship of e3 local axes and global coord.system }```
Your solution is very interesting, but it seems that with you solution you can't decide where in your domain your box is. If I understood correctly, you set the length of each dimension of the box, then the origin for the rotation and the two vectors for the rotation.

Suppose my box is located with : min(x1, y1, z1), max(x2, y2, z2), and that the origin for the rotation is outside my box. How do I do that?

If you have a solution, I would be glad because I could not find anything relevant but your post.

 July 31, 2023, 05:42 #5 Senior Member   M Join Date: Dec 2017 Posts: 660 Rep Power: 12 Cool - I was not aware this is possible. However - I would not approach this on the snappy-Level, but build this kind of geometry in a CAD tool where I can convince myself visually that it comes out right, export that to stl and use it as a refinement region.

 August 1, 2023, 04:19 #6 New Member   Join Date: Jun 2023 Location: Brest Posts: 21 Rep Power: 3 I guess this is the simplest way and a no-echec solution, but that can take a lot of time if there is 3 internal refined meshes to rotate for 12 different angles. Good solution though. Thanks

 Tags rotating, searchablebox, shm