question

Osama A6 avatar image
0 Likes"
Osama A6 asked Jason Lightfoot edited

3D sand printing machine

I'm trying to make a model that represents the 3D sand casting process. I have tried, but it was very hard for me to make the animation. The STL file for the machine and the empty bed and filled bed are attached. First, I want to make the machine unloaded as shown in figure started started.png, then the machine will process as shown in figure in_progress in_progress.png, then we have the machine finish as shown in figure finished finished.png and will remain like that until task executer pick it up unloaded.png as shown above. The STL files are here: 3dsp_machine.wrl embty.wrlfilled.wrl

FlexSim 22.0.0
processoranimationadvanced visual options
started.png (80.6 KiB)
in-progress.png (87.4 KiB)
finished.png (116.3 KiB)
unloaded.png (93.9 KiB)
3dsp-machine.wrl (132.3 KiB)
embty.wrl (2.8 KiB)
filled.wrl (2.8 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.

Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·

What FlexSim version are you using? Update: From your other posts it looks like 22.0.

0 Likes 0 ·
Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Osama A6 commented

The first step with adding custom shapes is always to add it as the visual appearance of an object and resize/rotate it to properly fit inside the bounding box using the shape factors.

1647864743299.png

In the animation window (More Visuals -> Visuals/Animations -> Edit or Right click -> Edit -> Animations) add the object that should move as part of the animation as a component object.

1647864898322.png

In this case I also set it up with different frames, so it can appear both empty and filled, depending on which frame is currently active.

1647864948073.png

Then you add a new animation in the controls at the bottom. Position the object how it should appear at the start of the animation and add a keyframe to the timeline at 0s.

1647865035146.png

Then move the object and add keyframes to other times to set the location of the object at those times. FlexSim will interpolate the position inbetween keyframes.

Repeat this process so you have one animation where the trough enters the machine and one where it exits. Finally you should also set the reset position of the object. 1647865211135.pngAfter you have defined the animations you can start them via the "object.animations[].start()" command, for example in the triggers of the object.

https://docs.flexsim.com/en/22.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Animation.html#Method-start

"setframe()" can be used to switch between the empty/filled appearance of the trough.

In the attached I added the animations to a processor so it's basic functiality can still be used. As such I move the flow item into the 3d shape in the entry trigger to hide it.

CustomAnimation_fm.fsm


1647864898322.png (53.3 KiB)
1647864948073.png (7.2 KiB)
1647865035146.png (18.0 KiB)
1647865211135.png (2.5 KiB)
1647864743299.png (114.7 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.

Osama A6 avatar image Osama A6 commented ·
That is an awsome job. Ty so much.
0 Likes 0 ·
Jason Lightfoot avatar image
2 Likes"
Jason Lightfoot answered Jason Lightfoot edited

I changed the shapes to .fbx which import the bounding boxes better.

Then it's just question of adding the animations to the animation editor and adding key frames - it's only 10 minutes work.

SandPrinter.fsm


sandprinter.fsm (214.9 KiB)
· 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.

Osama A6 avatar image Osama A6 commented ·

Thank you so much. Can you make the machine start with an empty box, then when the box does inside, it starts to be filled with sand. Then the box goes back filled until the worker carries it.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Osama A6 commented ·

Yes that's easy - you just need to remove the drawer keyframes from the Fill and Empty animations and then change the order in the process flow, as attached.

SandPrinter2.fsm

1 Like 1 ·
sandprinter2.fsm (171.4 KiB)
Osama A6 avatar image Osama A6 Jason Lightfoot ♦ commented ·
Thank you so much again
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Osama A6 commented ·

By seperating the windows and adding them as an animation component you can then see through them correctly.

SandPrinter3.fsm

Updated: Saved reset position again which then allows correct scaling of windows.

1 Like 1 ·
sandprinter3.fsm (169.3 KiB)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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