Generate workpieces by sources
In this chapter we don't want the workpieces to be generated only once at the start anymore, but instead, we want them to be generated by a source upon a manual trigger from us.
Add souces for both workpieces
We create the component twice: once we define the green, short workpiece as the reference, and once the long red workpiece as the reference. When we manually trigger the input in the properties, we notice that the objects are generated at the locations where the templates are positioned.
Note
Please note that the red workpiece, originally declared as Dynamic
rigid body, is now automatically set to None
by the component, meaning it is removed from the physics simulation.
The Object3DSource creates a copy of the template and then applies the chosen rigid body behavior — in this case, it becomes a Dynamic
rigid body.
Adding a ControlPanel for manual workpiece generation
To avoid manually triggering the workpieces in the component each time, we add the ControlPanel simulation component. Here, we create two push buttons, whose outputs are connected to the trigger inputs of the Object3DSources. Now, each time we press a button in the control panel, a rising edge is generated that triggers the production of the respective Object3D.
Summary
Congratulations, you build your very first digital twin of a machine with twin! As mentioned in the very beginning, this was a very basic tutorial with many simplifications which would make no sense in real life.
Nevertheless you learned the basics like:
- Importing a CAD model
- Working with the assembly structure
- Adding simulation components
- Linking the simulation components together
- Start the simulation
- Activate physics
What next
In the next tutorial Graphical programming of a simple sorting machine, we will bring this modeled machine to life using a small, internal control sequence in twin which we will create together from scratch.