docs / workbenches / Simulation Workbench

Simulation Workbench

Id: simulation · Fourteenth entry in the workbench dropdown

Simulation makes motion studies of an assembly: how the mechanism moves when some of its mates are driven. A study belongs to the assembly it animates and is saved with it.

What it offers

A study creates no features: the Add-feature palette is empty here. The workbench adds:

Studies

New study (or + Study in the pane) starts a study: 4 seconds at 30 frames a second. Click a study's name to make it the active one. Its duration and frame rate set the frames the study runs: 4 s at 30 fps is 121 frames, from 0 s to 4 s inclusive. Playback, scrubbing and every output use the same frames.

Motors

A motor is one of the assembly's distance or angle mates, driven over time. There is no expression language: the author picks mates as motors, and every other part follows through the assembly solver on each frame.

Add motor (or + Motor) drives the first distance or angle mate for the whole study: 90 °/s for an angle mate, 10 mm/s for a distance mate, and opens the motor's form. A motor's row names its mate and drive; clicking it opens the same form — the dialog every feature, constraint and PMI form in the app is made of, with its fields in the standard layout:

Return to list closes the form; Remove on the row deletes the motor.

One mate can be driven by several motors one after another, never by two at once.

Playing a study

The transport above the ruler plays the active study: Play / Pause, Stop (every part back at its document pose, the playhead at 0) and Loop. Press or drag on the ruler to scrub to a time; the playhead and a frame readout follow.

A study is baked before it plays: its frames are solved in order through the assembly solver, each from the previous one, a few at a time inside the app's own frames, so the window stays live and a progress bar shows how far the bake has come. Playback, scrubbing and every output read the same baked frames. The bake is kept until the study or the assembly changes, when it starts over; the playhead never runs ahead of it.

Parts are posed on screen only. Nothing is written to the document, undo has nothing to take back, and Stop or leaving the workbench puts every part back exactly, the camera a camera clip drove and a clash's tint included. The study belongs to its pane: outside the Simulation workbench it neither plays, bakes nor shows a frame, so an edit made elsewhere (an explode step moved in the PMI workbench) does not re-bake it or pose the model there; the bake waits for the return. A frame the mates cannot hold keeps the previous frame's poses and is marked amber on the ruler; playback keeps going.

Clips

Besides its motors, a study's timeline carries clips, each over a span of the study. + Clip offers the kinds and opens the new clip's form; a clip's row opens it again, and Remove deletes the clip. The form is the app's standard dialog: From (s) and To (s), then the kind's own fields. A clip that acts on parts has a Parts reference field, picked the way every reference in the app is: press Select, click parts in the 3D view (a click on a solid picks the component that holds it; a running pick lists what it holds, each with its ), and press Done. At rest the beside a part takes it out of the clip. A clip cannot be left with no part: dropping the last one is refused (the notice says so) and the clip keeps it; Remove is how a clip goes.

Clips are saved with the study.

Interference

Every baked frame is checked for parts that collide, while the study's Interference box (on by default) is ticked. A frame where parts interfere is marked red on the ruler and the pane says how many frames clash and, at the shown frame, which parts; those parts are tinted red while that frame is shown. Playback keeps going: there is no stop at contact.

The check is a frame-by-frame screen of the parts' display meshes, posed as the frame poses them: two parts interfere when an edge of one pierces a face of the other. Parts that merely touch (a face on a face, as mates often hold them) are not a clash; a part that sits wholly inside another, or whose faces coincide with another's, with no face crossing, is not seen. For the exact, volume-measured check of one position, use Assembly's interference check.

Export

The Export row below the clips writes the study as a video or as a player page: GIF (every frame its own palette, loops forever), MP4 (H.264, plays everywhere) or HTML (the interactive player: one self-contained page that plays the study on a timeline in any browser, offline — the same player the manufacturing instructions use, with the frames instead of steps, red marks where parts interfere). Videos are made at the chosen width and height and fps (the study's by default); the file is named in the row (a bare name lands in the app's working folder). The study is baked first if need be; a video draws every frame at that size through the viewport's own renderer with your display settings, clips and all, and the playhead goes back where it stood. Video export is native only: the web app plays studies and writes the HTML player, not video files.

Publishing a study for the instructions

Publish in the transport row bakes the study to the end and keeps its motion with the assembly: the player's frames (each moved part's pose, hidden parts, fades, camera and clashes per frame) are written into the study's entry in the document's simulation block, with the study id and a signature of the assembly as it stood. Manufacturing instructions made from the assembly then offer the study in a step's Motion row (Manufacturing Instructions); the step keeps its own copy and plays it in place of the insertion arrows. Publish is one undo step and leaves the bake alone. A motion published before the assembly changed (a part, a mate, a study edited) cannot be attached any more: the button reads Publish again, and a publish replaces the motion.

Saved with the assembly

The assembly document's simulation block: the active study and each study's name, duration, frame rate, motors (mate, span, drive) and clips, and each published study's motion.

On a PLM, a save of the assembly also publishes the active study's player, when that study has been played or scrubbed to the end in this session and the document has not changed since (its baked frames are what is published; a study no one has played goes up with nothing, an edit after the bake — a mate, a part, a study, a view — publishes nothing until the study plays again, and the next save after a play publishes it). The bake survives a switch to another workbench: leaving puts every posed part back and the study rests until you return. The PLM serves it per revision from the trusted player template at /motion/<part number>/<revision> for anyone signed in, and the part's revision table offers Open motion player; instructions revisions keep their own player and its customer links. Player data is kept only while it was made from the document the revision holds, as a thumbnail is.

Toolbar buttons

ButtonIdOfferedWhat it does
New studysimulation.new_studywhile an assembly is openStarts a motion study of the assembly in the Simulation pane
Add motorsimulation.add_motorwhile an assembly is openAdds a motor to the active study: a distance or angle mate driven at a speed or along a profile

Automation

Every action is a command: simulation_state, simulation_new_study, simulation_add_motor, simulation_add_clip, simulation_update (a study's, motor's or clip's fields, and which study is active), simulation_export (a GIF or MP4 of the study at a size and fps, to a path), simulation_publish (the study's motion into the block, for an instructions step) and simulation_remove, beside workbench_button for the two buttons; playback is simulation_play, simulation_pause, simulation_stop, simulation_seek and the read simulation_playback. The __brepSimulation state blob carries the block, the mates a motor can drive, the pane's last notice and playback (the playhead, the bake's progress as baked of total, the failed frames, the poses of the occurrences the shown frame moved, clashes: the frames where parts interfere, shownClashes: the pairs clashing at the shown frame, and the shown frame's clips as hidden, opacity, section, explode and camera); __brepSimulationHit carries the pane's rects (simulation:*). The simulation-workbench, simulation-motors, simulation-playback, simulation-interference, simulation-clips, simulation-clips-cut, simulation-export and simulation-html scripts in the MCP suite drive it.