question

Yokota T avatar image
0 Likes"
Yokota T asked Yokota T commented

Export 3D shapes of conveyors and racks

Hi all,

I am trying to create a 3D animation to reproduce the FlexSim's simulation results.

So I need the 3D shapes of conveyors and racks, but their appearance is not based on CAD data.

Is there any way to export 3D shapes of them?

Thank you.

FlexSim 22.0.6
cad files
· 1
5 |100000

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

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Yokota T, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·
Phil BoBo avatar image
1 Like"
Phil BoBo answered Yokota T commented

You can use the “exportscenegraph” and “exportmedialist” application commands to export the data in a FlexSim scene to JSON that could be parsed and used by an external renderer.

Below is a screenshot showing those commands and custom JavaScript code that renders that data using WebGL:

1661882284805.png

  1. Exporting the scene graph with a description of each object and mesh with a transformation matrix describing their position.
  2. Exporting the data about those objects and meshes, such as vertex positions and texture coordinates.
  3. The source code that reads and renders that data in JavaScript instead of FlexSim is available within the FlexSim installation directory.
  4. That scene being rendered by the WebGL JavaScript instead of by FlexSim’s internal OpenGL renderer.

Similar rendering could be done using a different 3rd party renderer or custom code that can take the exported scene and media json data, parse it, and render it however desired.

Attached is an example model (example_render_model_1.fsm.jpg; rename file to remove ".jpg") with a script showing an example of using the exportscenegraph and exportmedialist application commands.

I added some comments to the script to help you get started understanding what’s in the data and how it is structured.

The model has example objects that render in different ways to show how that data is exported.

  • Source, Queue, Processor, and Sink are all normal objects with loaded shape files and simple colors.
  • Operator is a bone-animated shape with customized mesh data that removes its eyelashes.
  • There’s a green plane on the floor that’s custom drawn with FlexSim’s Mesh API.
  • The conveyor uses instanced rendering to draw and animate its rollers with FlexSim’s Mesh API.
  • The rack uses instanced rendering to draw and color its component parts with FlexSim’s Mesh API.
  • The operator and rack textures have additional texturemaps, such as bump maps.

You can reference the code in “FlexSim 2022\program\flexsimweb\fgl” for an example of using this data to render a scene with WebGL.

In the future, we may add other ways to export the 3D mesh data from a FlexSim model, but right now, this is what is currently available and what the WebGL Streaming feature of the FlexSim WebServer uses.


· 1
5 |100000

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

Yokota T avatar image Yokota T commented ·

Thank you for your detailed answer.

I understand that FlexSim scene can be output in JSON format.

In the future, it would be great to be able to output scenes in FBX format.

Thank you again!

0 Likes 0 ·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Yokota T commented

Those objects are rendered by adding together multiple shapes and textures (only textures for racks I believe). So apart from the .ac shape files of the conveyor you can find under \modules\Conveyor\shapes in the FlexSim directory, I don't think there is a way to export any shapes for them.

You are aware of FlexSim's video recorder functionality that allows you to capture videos of the model? (As a potential substitute for creating an animation from scratch)

1661422471692.png


1661422471692.png (71.9 KiB)
· 1
5 |100000

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

Yokota T avatar image Yokota T commented ·

Thank you for your response. Yes, I am aware of Video Recorder functionality. However, I need the animation as a 3D file such as FBX format for editing in external software.

0 Likes 0 ·