Back

TrailRenderer

sofa::component::visual::TrailRenderer
VisualModel
Doc (from source)

Render a trail behind particles. Render a trail behind particles It can be used to draw the trajectory of a dof. This component does not support topological changes (point removal or point addition) and list reordering.

Abstract (AI generated)

The `TrailRenderer` component renders trails behind particles to visualize their trajectories over time, supporting two data types: Rigid3Types and Vec3Types.

Metadata
module
Sofa.Component.Visual
namespace
sofa::component::visual
include
sofa/component/visual/TrailRenderer.h
inherits
  • VisualModel
templates
  • sofa::defaulttype::Rigid3Types
  • sofa::defaulttype::Vec3Types
description

The TrailRenderer component in the SOFA framework is designed for visualizing trails behind particles, particularly useful for representing trajectories or movement paths over time. However, it does not involve any physical or mathematical operations that are directly related to the Finite Element Method (FEM) simulation pipeline. Instead, its functionality is purely graphical and serves as a visualization tool.

Mathematical Content

The TrailRenderer component does not contribute to governing equations such as mass matrix M, stiffness matrix K, internal forces $f_{int}$, or residual R. It also does not involve constitutive laws (strain measures, stress tensors, hyperelastic potentials) or kinematic laws.

Role in the Global FEM Pipeline

The TrailRenderer plays no role in the core aspects of the FEM pipeline such as assembly, time integration, nonlinear solve, linear solve, constraint handling, mapping, etc. Its primary function is to provide a visual representation of particle positions over a specified number of time steps.

Numerical Methods and Discretization Choices

The component does not implement any numerical methods or discretization choices relevant to FEM simulation. It solely relies on storing the positions of particles at each time step and drawing lines between these points to form trails. This is achieved through its doDrawVisual method, which renders a line strip based on stored particle positions.

Variational / Lagrangian Mechanics Framework

The component does not fit into the broader variational or Lagrangian mechanics framework as it is purely graphical and does not involve any physical or mechanical computations. Its purpose is to enhance visualization rather than contribute to numerical simulation.

In summary, TrailRenderer is a visual tool for tracking particle movements over time without involving any of the mathematical or physical components typically found in FEM simulations.

Data Fields
NameTypeDefaultHelp
d_color sofa::type::RGBAColor Color of the trail
d_thickness float Thickness of the trail
Methods
void handleEvent (core::objectmodel::Event * ) virtual
void doDrawVisual (const core::visual::VisualParams * vparams) virtual
void reset () virtual
void storeParticlePositions ()
void removeFirstElements ()
{
  "name": "TrailRenderer",
  "namespace": "sofa::component::visual",
  "module": "Sofa.Component.Visual",
  "include": "sofa/component/visual/TrailRenderer.h",
  "doc": "Render a trail behind particles.\n\nRender a trail behind particles\nIt can be used to draw the trajectory of a dof.\nThis component does not support topological changes (point removal or point addition) and\nlist reordering.",
  "inherits": [
    "VisualModel"
  ],
  "templates": [
    "sofa::defaulttype::Rigid3Types",
    "sofa::defaulttype::Vec3Types"
  ],
  "data_fields": [
    {
      "name": "d_color",
      "type": "sofa::type::RGBAColor",
      "xmlname": "color",
      "help": "Color of the trail"
    },
    {
      "name": "d_thickness",
      "type": "float",
      "xmlname": "thickness",
      "help": "Thickness of the trail"
    }
  ],
  "links": [],
  "methods": [
    {
      "name": "handleEvent",
      "return_type": "void",
      "params": [
        {
          "name": "",
          "type": "core::objectmodel::Event *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "doDrawVisual",
      "return_type": "void",
      "params": [
        {
          "name": "vparams",
          "type": "const core::visual::VisualParams *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "reset",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "storeParticlePositions",
      "return_type": "void",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "removeFirstElements",
      "return_type": "void",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    }
  ],
  "description": "The `TrailRenderer` is a visual component in the SOFA framework designed to render trails behind particles, which can be used to visualize particle trajectories or the movement path of degrees-of-freedom (DOFs). It inherits from the `VisualModel` class and supports two data types: `Rigid3Types` and `Vec3Types`. The primary purpose is to provide a visual representation of how particle positions evolve over time. However, it does not support topological changes such as adding or removing points, nor does it handle list reordering.\n\nThe component interacts with other SOFA components through its virtual methods: `handleEvent`, which processes events related to animation end and triggers the storage of particle positions; `doDrawVisual`, which is responsible for rendering the trail using a line strip based on stored particle positions; and `reset` for clearing stored data.\n\nPractical usage involves configuring the color (`d_color`) and thickness (`d_thickness`) of the trail, as well as specifying the number of time steps to use in rendering the trail (`d_nbSteps`). Note that the component does not support topological changes or list reordering.",
  "maths": "The `TrailRenderer` component in the SOFA framework is designed for visualizing trails behind particles, particularly useful for representing trajectories or movement paths over time. However, it does not involve any physical or mathematical operations that are directly related to the Finite Element Method (FEM) simulation pipeline. Instead, its functionality is purely graphical and serves as a visualization tool.\n\n### Mathematical Content\nThe `TrailRenderer` component does not contribute to governing equations such as mass matrix M, stiffness matrix K, internal forces \\(f_{int}\\), or residual R. It also does not involve constitutive laws (strain measures, stress tensors, hyperelastic potentials) or kinematic laws.\n\n### Role in the Global FEM Pipeline\nThe `TrailRenderer` plays no role in the core aspects of the FEM pipeline such as assembly, time integration, nonlinear solve, linear solve, constraint handling, mapping, etc. Its primary function is to provide a visual representation of particle positions over a specified number of time steps.\n\n### Numerical Methods and Discretization Choices\nThe component does not implement any numerical methods or discretization choices relevant to FEM simulation. It solely relies on storing the positions of particles at each time step and drawing lines between these points to form trails. This is achieved through its `doDrawVisual` method, which renders a line strip based on stored particle positions.\n\n### Variational / Lagrangian Mechanics Framework\nThe component does not fit into the broader variational or Lagrangian mechanics framework as it is purely graphical and does not involve any physical or mechanical computations. Its purpose is to enhance visualization rather than contribute to numerical simulation.\n\nIn summary, `TrailRenderer` is a visual tool for tracking particle movements over time without involving any of the mathematical or physical components typically found in FEM simulations.",
  "abstract": "The `TrailRenderer` component renders trails behind particles to visualize their trajectories over time, supporting two data types: Rigid3Types and Vec3Types.",
  "sheet": "# TrailRenderer\n\n**Overview**\n\nThe `TrailRenderer` is a visual component that renders trails behind particles to visualize their movement paths. It inherits from the `VisualModel` class and supports the `Rigid3Types` and `Vec3Types` data types.\n\n**Parameters and Data**\n\n- **color (`d_color`)**: The color of the trail, specified as an RGBAColor.\n- **thickness (`d_thickness`)**: The thickness of the trail, a floating-point value.\n\n**Practical Notes**\n\nThe `TrailRenderer` does not support topological changes such as adding or removing points and does not handle list reordering. It is purely graphical and serves to enhance visualization."
}