#######
Explode
#######

Basic concepts
==============

Exploding a model moves the parts along a path away from a central point. This allows you to see inside a model and look at the relationship between the location of the parts.

All active explosions are managed by the :doc:`ExplodeManager </api_ref/viewing/classes/Communicator.ExplodeManager>`.


Explode manager
===============

The :doc:`ExplodeManager </api_ref/viewing/classes/Communicator.ExplodeManager>` can be used to start and stop an explode operation, configure which parts are exploded, as well as set the direction and magnitude of the explosion.

The :doc:`ExplodeManager </api_ref/viewing/classes/Communicator.ExplodeManager>` can be accessed from the top level WebViewer object.


Start
=====

The :ref:`start() <api_ref/viewing/classes/Communicator.ExplodeManager:start>` function takes two optional parameters, ``nodeIds`` and ``explosionVector``. These can be used to specify which parts are moved by the explosion, and the explosion center. There can only be one active explosion at a time. Starting a new explosion will cancel any previously active explosions.

.. image:: images/explode_start.png

*Explode example*


Stop
====

The :ref:`stop() <api_ref/viewing/classes/Communicator.ExplodeManager:stop>` function will cancel any active explode operation.


setMagnitude
============

The :ref:`setMagnitude <api_ref/viewing/classes/Communicator.ExplodeManager:setmagnitude>` function takes one parameter, a magnitude number. The default explode center is the center of the bounding box containing the nodes that will be exploded. It can be changed by passing in an explosionVector to the :ref:`start() <api_ref/viewing/classes/Communicator.ExplodeManager:start>` function. The explode magnitude changes the distance from each parts center to the explode center. A value of 1.0 indicates that the distance from the center of each part and the center of the explode will double. If the magnitude is set to 0, any active explode operation will be stopped.


Explode effects
===============

Selection is not affected by an active explosion. If there are any geometry handles in the scene, they will be removed when an explosion begins. Measurements and note pins are hidden while there is an active explosion. When the explosion is no longer active, they are shown again. While there is an active explode, it is not possible to add measurements to the model.

.. admonition:: Note

    When using the ``explodeManager`` AND setting a non-zero magnitude, simple shadows and simple reflections are hidden from the scene. This means that ``hwv.view.setSimpleShadowEnabled`` and ``hwv.view.setSimpleReflectionEnabled`` appear to be always ``false`` when ``hwv.explodeManager.setMagnitude()`` is anything other than 0.