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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Model widget & resource co-ordinate relation

venkatraj
12-Amethyst

Model widget & resource co-ordinate relation

I added a model widget into the canvas with  xyz co-ordinate as say 0,0,0 (center of canvas). Now when I add the resource (.pvz file) into that widget, those co-ordinates changes by itself say (0,0.35,0.254). On what basis this is changing. When I import the components of a sub-assembly individually into the canvas, it is not sitting on the correct position. What is the best way to assemble your components inside your canvas.

Coordinates after adding resourceCoordinates after adding resourceempty model widget coordinatesempty model widget coordinates

Thanks!!!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @venkatraj,

thank you for the further explanation. Yes, I could agree that this behavior is a little strange and not intuitively. I see that you are working with Creo parametric and this will make it easily to clarify the problem.

Actually, the good news is that you exactly determine the position of a component via the setting of the coordinates (manually or via script) . But it  will be very difficult to add component with correct coordinates  via UI drag and drop.

Let consider the model widget.

The best approach is that the model widget will contain (resource model) should be an top assembly. So means when possible all components should be already added there in Creo Parametric . Then you could export it to pvz (Creo View format) and add as resource.

So when you want to display, blank or move an component you have to add an model item for this component (form the existing pvz) and do some operations with this modelitem (e.g. move it, change the color, blank it etc.). So we can define a new modelitem widget for each component where we want to have some actions with it.

In some cases it will be usefull to have more then one modelitem widget (for example we could have different display of the same assembly – e.g. simplified representation, explode state or cut. And this case we can display for the same assembly the different pvz resources which contains the correct display state. This is the approach to have for the same assembly different resources and only one is displayed.

Another possible scenario is when you have different model widget for components. I think this is not recommended to display all components of a very large assembly but in some cases this could be useful for few additional components.

OK now to the position. Let forget the shift what we observed when we set the resource property. We can later set the value for x,y,z,rx,ry,rz to the desired values. What means this values (In terms of Creo parametric)

Every part or assembly in Creo Parameric has a default coordinate system. Mostly the default CSYS is coming with the template. But if there is no such you can see it when you create a new datum feature Coordinate System Default (see picture) :

 

2019-04-08_12-33-40.gif

 

The default coordinate system always exists also, when in Creo there is no explicit feature for it. And often this lead to misunderstanding when there is another coordinate system which was used for the model design but it not coincident with the default csys.

And when you add a new widget with a resource file and set manually the coordinate of it e.g. to x=0,y=0,z=0,rx=0,ry=0,rz=0 -> here this means you will set the coordinate of the model default coordinate system. This is like assembling in Creo using a coordinate system constrain. So means the coordinate properties in Vuforia are the Top assembly csys where you add coincidently the model default coordinate system:

 

2019-04-08_10-39-33.gif

 

When the model represent an assembly – in this case the used coordinate system is the default coordinate system of the TOP assembly (assembly could consist of many subassemblies)

2019-04-08_11-11-52.gif

 

The creation of new widget for a new component is therefore not so convenient because often the default coordinate system is not appropriate for the determining of the position in the Top assembly.

 

The last point I want to mention here it the shift when we set the resource property. In this case the model “jump” to a new location. Actually we can ignore this and set again the value manually of the coordinate (so set the correct coordinate for the location of the model default coordinate system). I think this automatic shift do not have any practical value  - is not intuitive  and should be ignored.

My observations regarding this shift are following:

  • For each part or assembly (particular pvz resource file) it is the same value.
  • When you add a new widget, it will go automatically on 00000 position. When you add an second, third or …. Model widget it will read the approximate coordinate of xz location and will add the new widget on the approximate x,z mouse coordinate and Y=0
  • When you set a resource file it will shift the model for specific for this particular model coordinates

The shift of the coordinates

For the x and z coordinate it will move the model so that the x,z coordinate of the center of gravity will go to the original position (when the model was originally to x=0,y=0,z=0,rx=0,ry=0,rz=0 in this case it will move the model coordinates on such manner that now to center of gravity of the part will be on x=0 and z=0. For the y position it will move the model that now the default coordinate system the model y=0 will should be coincided with Vuforia space y=0. I do not think that this is intuitive way but seem to be the current implementation.

My all observations are form the background of Creo Parametric. I do not have idea what will be the behavior for part coming from other system (e.g. where we do not have a solid with center of gravity – may be here is some kind of surface gravity center …)

2019-04-08_11-06-04.gif

 

 

View solution in original post

5 REPLIES 5

Hi @venkatraj,

I am not sure if I understand correctly your question, but I believe there is may be not quite correct understating of the 3d functionality of the tool. I believe that you meant preview mode.

 In Vuforia studio , vuforia view  we have for the 3d models the 3d coordinate space and to pay attention of the 2d canvas display coordinates This is not our really our job. So, we do consider there only 3d model coordinates.

 Thinking in canvas coordinate we need only in the mobile 2d view where we have to design our UI - in this case it is relevant which 2d position a specific element/widget will have.

In 3d model we have a model coordinate system. In respect of this coordinate system we determine the position of all components.

 What I believe, here is the misunderstanding – is caused that you are testing only in preview mode. In preview mode the display position is not much relevant. Because the preview is only a help mode which will try to give you info about the display on the device.

The position of the model coordinate system is regarding to the target (thingmark , space target or model target but also image target)

So in you case when you create a thingmark with position , (x,y,z,rx,ry,rz = 0,0,0,0,0,0) and add a model widget also having the postion(x,y,z,rx,ry,rz = 0,0,0,0,0,0) in this case  the your model coordinate system  of the of the modelwidget  will be coincident with the thingmark.  In this case on your mobile device when you scan a project e.g. via thingmark then the model coordinate system will be coincident  with the position of the thingmark. 

The Vuforia view  will check  the thingmark “width” property  and will compare it  with the size of the scanned thingmark. They should have the same size. The ratio ( thingmark size/ printed  thingmark)  will be calculated and will be used as multiplication  factor to the model scale - means it will additionally scale you model

All this factors:  position of the scanned thingmark, the relative position between the  model widget and the thingmark widget and the scale factor will determine the end position of you model on the screen – which will display it on the 2d canvas as projection.

 

2019-04-05_19-46-46.gif

So on end device  the thingmark of the model/ view  should be coincided with the printed thingmark what you scanned in Vuforia view.

 

I think, I  misunderstood your question.

So, when I am looking second time on your question 

Sorry, ! Man Mad

Obviosly you  meant that when you create a new model widget , set it to 0,0,0  you can not understand what is the  shift of the coordinates when you set the resource

Need to check it

My first guess is that it is related to model root coordinate system and  the sift to the default coordinate system (if the model is coming from Creo Parametric)

It seems to be model specific. So my observation is that the same model will have always the same shift. Until now I did not pay attention to this behavior because I simple did manually change the coordinates to the correct value after I set the resource. 

I notice that we have similar behavior when we create a model item widget. But there it is clear it is the relative coordinate to the root coordinate system of the model assembly and to the model space.

To understand the issue I need to create a model where I know exactly how to model is created / For example if a model is created in Creo parametric it has a default coordinate system and then it could be assembled. But I will expect that the root assembly coordinate system/default will be used as reference

I did some research before and this is what I noticed. Imagine you have two parts in an assembly say a screw and nut assembled using constraints.

1. I hide the nut and convert the screw alone into pvz file. I created a model widget in studio with coordinate 0,0,0 & drop the pvz file in the resource, the screw sits at some location (not 0,0,0) in canvas. I don’t do any manual adjustments on this

2. I do the same for nut. Create a model widget with coordinates 0,0,0 and drop the nut.pvz in the resource. Again, not changing anything manually 

3. Now what I expected to happen was the nut to sit in correct place as it was in creo parametric, but  it’s not. Why. How can I make the nut to sit in correct position without adjusting manually, as it is a time consuming job. 

I know I can add the entire assembly and break that two parts into each model item. But that won’t help in my case. I hope I made the case clear. 

 

Thanks!!

 

Hi @venkatraj,

thank you for the further explanation. Yes, I could agree that this behavior is a little strange and not intuitively. I see that you are working with Creo parametric and this will make it easily to clarify the problem.

Actually, the good news is that you exactly determine the position of a component via the setting of the coordinates (manually or via script) . But it  will be very difficult to add component with correct coordinates  via UI drag and drop.

Let consider the model widget.

The best approach is that the model widget will contain (resource model) should be an top assembly. So means when possible all components should be already added there in Creo Parametric . Then you could export it to pvz (Creo View format) and add as resource.

So when you want to display, blank or move an component you have to add an model item for this component (form the existing pvz) and do some operations with this modelitem (e.g. move it, change the color, blank it etc.). So we can define a new modelitem widget for each component where we want to have some actions with it.

In some cases it will be usefull to have more then one modelitem widget (for example we could have different display of the same assembly – e.g. simplified representation, explode state or cut. And this case we can display for the same assembly the different pvz resources which contains the correct display state. This is the approach to have for the same assembly different resources and only one is displayed.

Another possible scenario is when you have different model widget for components. I think this is not recommended to display all components of a very large assembly but in some cases this could be useful for few additional components.

OK now to the position. Let forget the shift what we observed when we set the resource property. We can later set the value for x,y,z,rx,ry,rz to the desired values. What means this values (In terms of Creo parametric)

Every part or assembly in Creo Parameric has a default coordinate system. Mostly the default CSYS is coming with the template. But if there is no such you can see it when you create a new datum feature Coordinate System Default (see picture) :

 

2019-04-08_12-33-40.gif

 

The default coordinate system always exists also, when in Creo there is no explicit feature for it. And often this lead to misunderstanding when there is another coordinate system which was used for the model design but it not coincident with the default csys.

And when you add a new widget with a resource file and set manually the coordinate of it e.g. to x=0,y=0,z=0,rx=0,ry=0,rz=0 -> here this means you will set the coordinate of the model default coordinate system. This is like assembling in Creo using a coordinate system constrain. So means the coordinate properties in Vuforia are the Top assembly csys where you add coincidently the model default coordinate system:

 

2019-04-08_10-39-33.gif

 

When the model represent an assembly – in this case the used coordinate system is the default coordinate system of the TOP assembly (assembly could consist of many subassemblies)

2019-04-08_11-11-52.gif

 

The creation of new widget for a new component is therefore not so convenient because often the default coordinate system is not appropriate for the determining of the position in the Top assembly.

 

The last point I want to mention here it the shift when we set the resource property. In this case the model “jump” to a new location. Actually we can ignore this and set again the value manually of the coordinate (so set the correct coordinate for the location of the model default coordinate system). I think this automatic shift do not have any practical value  - is not intuitive  and should be ignored.

My observations regarding this shift are following:

  • For each part or assembly (particular pvz resource file) it is the same value.
  • When you add a new widget, it will go automatically on 00000 position. When you add an second, third or …. Model widget it will read the approximate coordinate of xz location and will add the new widget on the approximate x,z mouse coordinate and Y=0
  • When you set a resource file it will shift the model for specific for this particular model coordinates

The shift of the coordinates

For the x and z coordinate it will move the model so that the x,z coordinate of the center of gravity will go to the original position (when the model was originally to x=0,y=0,z=0,rx=0,ry=0,rz=0 in this case it will move the model coordinates on such manner that now to center of gravity of the part will be on x=0 and z=0. For the y position it will move the model that now the default coordinate system the model y=0 will should be coincided with Vuforia space y=0. I do not think that this is intuitive way but seem to be the current implementation.

My all observations are form the background of Creo Parametric. I do not have idea what will be the behavior for part coming from other system (e.g. where we do not have a solid with center of gravity – may be here is some kind of surface gravity center …)

2019-04-08_11-06-04.gif

 

 

Thanks. Your comments gave me some insight into the matter. So in vuforia, the positioning is based on the center of gravity with respect to the default coordinate system. If i'm importing components seperately, I need to check the COG of each component with respect to the assembly coordinate system. I'm also working on using the fbx files created from Blender. I've to see how it behaves there. If you have idea on this, please let me know.

Top Tags