cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Mechanism Concept in Vuforia Studio- How to make rotation more easy

No ratings

Mechanism  Concept in Vuforia Studio- How to make rotation more easy

 

When we try to rotate a model or 3d modelitem about a particular space axis it seldom will rotate about the correct axis as we want. 

So, in this case we can try to solve this  when we use  some mathematical calculations. For example in the example(picture below)  -   door assembly we want to rotate  the door subassembly via the door hinges:

 

2018-06-05_15-38-33.jpg

 

but  when we  try to rotate the door model about 60degree it rotates undesired on the wrong axis.

 

2018-06-05_15-40-50.jpg

 

 The question is:  Which is this axis and how to change it?

The answer here is : When we have a PVZ model we cannot really change it! 

We can use some mathematical relations to get the correct behavior . In this particular sample case the correct javaScript relation should be something like :

 

...
$scope.simple_door_slider_change = function (angle, door_length) {
 var angle1=angle;
 var l_door=door_length;
 var angle1_rad=angle1*Math.PI/180.0;
$scope.view.wdg['modelItem-door-asm']['rx'] = angle1 ;
$scope.view.wdg['modelItem-door-asm']['y']  = 0.0 - l_door*Math.sin(angle1_rad);
$scope.view.wdg['modelItem-door-asm']['z']  = 0.0 - l_door*(1.0-Math.cos(angle1_rad));
$scope.app.params['door_angle']=  angle1;
};
...

 

So  calling $scope.simple_door_slider_change(70,0.950); will rotate  this particular door assembly on the correct place:

 

2018-06-05_15-49-57.jpg 

 

But what we can do to solve the problem  for more complex assemblies. For example when we want to rotate the door handle. Of course such calculation is no problem but this calculation will be more complex (containing movements and rotations ) and we need to invest significantly more  time for the creation of the mathematical concept of it. The main problem is that mostly we do not know what is the correct coordinate axis for each component.

 

Unfortunately, the only option, what we have here is to make some consideration already in the Creo Parametric design (or in another Cad tools) . So for example the following part have a default coordinate system. Here on the example picture is the name  PRT_CSYS_DEF.

 

2018-06-05_15-59-21.jpg

 

When we later rotate about the x  in Vuforia Studio  then it will rotate about the X axis of the default csys here “PRT_CSYS_DEF”  So, this means when we have some component which should be later rotated in Vuforia, in this case  we need to pay attention already   in the design and try to  assemble the component were  the default csys is on the correct location. 


2018-06-05_16-03-54.jpg

 

The default coordinate system in a Creo Parametric model is created with the model and it is not possible to change it later (there is a workaround where we can use an auxiliary  assembly where we can insert the model. In this case we can move the model inside  the auxiliary assembly. The auxiliary  assembly will rotate about the default coordinate axis).

 

So, the next step is to consider, how to design a more complex mechanism assembly.

Lets consider the following assembly:

 

2018-06-05_16-14-35.jpg

 

 

When we create a project and then try to rotate  different components (arms) via slider then we will have e.g. the following situation:

 

 

2018-06-05_16-16-43.jpg

 

So that the one (blue) component is rotated as desired but when we rotate the blue component the green component does not follow it.

Let's create another version of the mechanism were we have the correct behavior:

 

2018-06-05_16-19-25.jpg

 

What is there different?

 

The answer is that we used a different structure. Here we nested the moved component in further sub assemblies.

 

2018-06-05_16-26-02.jpg

 

 

It is important that in this case for the modelItems widget defintion in vuforia studio we are not using only a parts  but also  assemblies. So here the subassembly arm 2 was used  for the definition of modelitem which contains the arm1  (part) which is an addtional modelitem.

 

 

2018-06-05_16-30-10.jpg

2018-06-05_16-31-59.jpg

 

So in this case we could change the rotation value of the axis and they rotates as desired.  Man Happy

 

 

Version history
Last update:
‎Jun 30, 2019 08:49 PM
Updated by:
Labels (1)
Attachments
Contributors