question

royjuventus29 avatar image
0 Likes"
royjuventus29 asked Jason Lightfoot commented

a relocation problem when replacing the 3D geometry of a resource

Hello, when I replace the 3D geometry of the resource, it often align the left-top corner of the bounding box, I want it to replace it based on its original location. Is that possible?

For example, I import a BasicTE and give the location (0,0,0), you can see its left-top corner is aligned with the (0,0,0). Then I import a self-defined conveyor, and it is still left-top corner aligned with the (0,0,0). But I do not want this, I would like to use the original location of the 3D geometry instead of always aligning the left-top corner? Is that possible?

1.jpgImage Caption2.jpg

FlexSim 24.0.0
3d geometryreplace geometry
1.jpg (12.5 KiB)
2.jpg (97.2 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot commented

When changing an individual object's shape you're only doing that - you're not aligning its location to a layout. If you want to set object locations relative to each other, load a layout file and do it programmatically.

If all you meant was that the centre of the object should stay in the same position then store that before you change the shape and set it afterwards (use getLocation and setLocation).

· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

royjuventus29 avatar image royjuventus29 commented ·

Thank you for your answer. I would like to generate a layout in flexsim from an external file. I have the file indicating the geometry and locations of each component. I use script to generate a set of BasicTE with locations, and then I replace the BasicTE geometry with my geometry. Then the problem appears. As my geometry has its own origin frame to build the model, sometimes the origin frame is the bottom center, sometimes it is the middle point of a side line. However, when I replace the 3D geometry in flexsim, it always makes a bounding box and aligns the top-left corner to the location. This way in flexsim makes my geometry cannot locate in the correct location in flexsim. I hope I describe the problem clearly. Is there a solution for this?

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ royjuventus29 commented ·
It sounds like you just need to output the position of your origin relative to the shape as a Vec3 to use in setLocation() - it can use the percentage of the size in each axis.
0 Likes 0 ·
royjuventus29 avatar image royjuventus29 Jason Lightfoot ♦♦ commented ·
Can you introduce a little bit how a 3D model is created in the software environment of flexsim? For my understanding, we do not give anything about bounding box, only the geometry mesh information, I just want to put the origin frame of the mesh on the location I set, then it should be finished. But I find that in flexsim you create a bounding box automatically, and then align the corner of the bounding box to the location I give. Am I correct?
0 Likes 0 ·
Show more comments