Back

BarycentricMapperEdgeSetTopology

The `BarycentricMapperEdgeSetTopology` is a SOFA component that facilitates barycentric mapping computations on a BaseMeshTopology with edges, specifically designed for linear mappings in the Sofa.Component.Mapping.Linear module. It inherits from `BarycentricMapperTopologyContainer`, indicating it deals with topological data structures and provides methods to manage points within edges of the mesh topology. This component interacts with other SOFA components through its initialization method (`init`), which requires input and output coordinates, and by extending methods for adding and creating points within line segments (edges) using barycentric coordinates. The `addPointInLine` and `createPointInLine` methods are crucial for this functionality. Practical usage involves setting up the component with appropriate topology containers (`fromTopology`, `toTopology`). It supports operations such as adding a point to an edge based on barycentric coordinates, computing the center of an edge, and retrieving elements in the form of edges. However, it's noted that some methods like `computeBase` and `computeDistance` are not implemented for edges. This component is particularly useful in simulations requiring precise handling of point placements along edges using linear mappings.

abstract
Facilitates barycentric mapping computations on BaseMeshTopologies with edges, enabling precise point placement along line segments in SOFA simulations.
sheet
# BarycentricMapperEdgeSetTopology ## Overview The `BarycentricMapperEdgeSetTopology` is a component within the Sofa.Component.Mapping.Linear module that handles barycentric mapping computations on BaseMeshTopologies with edges. It inherits from `BarycentricMapperTopologyContainer`, indicating its role in managing points within line segments (edges) using barycentric coordinates. ## Parameters and Data This component does not expose any significant Data fields, as it primarily relies on inherited functionality from the parent class for its operations. ## Dependencies and Connections The `BarycentricMapperEdgeSetTopology` typically requires appropriate topology containers (`fromTopology`, `toTopology`) to be set up. It interacts with other SOFA components through methods such as `init`, which requires input and output coordinates, and extends methods for adding and creating points within line segments using barycentric coordinates. ## Practical Notes This component is particularly useful in simulations requiring precise handling of point placements along edges using linear mappings. Methods like `computeBase` and `computeDistance` are not implemented for edges, so users should be aware that these functionalities are limited.
description
The `BarycentricMapperEdgeSetTopology` is a SOFA component that facilitates barycentric mapping computations on a BaseMeshTopology with edges, specifically designed for linear mappings in the Sofa.Component.Mapping.Linear module. It inherits from `BarycentricMapperTopologyContainer`, indicating it deals with topological data structures and provides methods to manage points within edges of the mesh topology. This component interacts with other SOFA components through its initialization method (`init`), which requires input and output coordinates, and by extending methods for adding and creating points within line segments (edges) using barycentric coordinates. The `addPointInLine` and `createPointInLine` methods are crucial for this functionality. Practical usage involves setting up the component with appropriate topology containers (`fromTopology`, `toTopology`). It supports operations such as adding a point to an edge based on barycentric coordinates, computing the center of an edge, and retrieving elements in the form of edges. However, it's noted that some methods like `computeBase` and `computeDistance` are not implemented for edges. This component is particularly useful in simulations requiring precise handling of point placements along edges using linear mappings.
math_description
{
  "functions_and_methods": [
    {
      "description": "Adds a point on an edge defined by `edgeIndex` using the barycentric coordinate `baryCoords`. The barycentric coordinates are stored in a data structure and used to map points within the edge.",
      "name": "`addPointInLine(const Index edgeIndex, const SReal* baryCoords)`"
    },
    {
      "description": "Creates a point `p` on an edge defined by `edgeIndex`, where `points` are the coordinates of the vertices of the edge. It computes the barycentric coordinate for `p` and uses it to place the point along the edge.",
      "name": "`createPointInLine(const typename Out::Coord\u0026 p, Index edgeIndex, const typename In::VecCoord* points)`"
    },
    {
      "description": "Returns a vector of edges from the mesh topology, each represented as an index pair corresponding to its vertices.",
      "name": "`getElements()`"
    },
    {
      "description": "Computes and returns the barycentric coefficients for a given set of coordinates. For an edge with two nodes, this method computes the weights [1 - t, t], where `t` is the barycentric coordinate.",
      "name": "`getBarycentricCoefficients(const std::array\u003cReal, MappingData::NumberOfCoordinates\u003e\u0026 barycentricCoordinates)`"
    },
    {
      "description": "Computes the center of an edge `element`, which is the midpoint between its two vertices. The coordinates of the vertices are provided by `in`.",
      "name": "`computeCenter(Vec3\u0026 center, const typename In::VecCoord\u0026 in, const Edge\u0026 element)`"
    }
  ],
  "overview": "The `BarycentricMapperEdgeSetTopology` component facilitates barycentric mapping computations for points within the edges of a mesh topology in SOFA. It enables linear mappings by providing methods to manage these points using barycentric coordinates.",
  "unimplemented_methods": [
    {
      "description": "This method is not implemented for edges. It would be used to compute a basis transformation matrix if applicable.",
      "name": "`computeBase(Mat3x3\u0026 base, const typename In::VecCoord\u0026 in, const Edge\u0026 element)`"
    },
    {
      "description": "This method is also not implemented for edges and would typically be used to calculate some distance metric or projection.",
      "name": "`computeDistance(SReal\u0026 d, const Vec3\u0026 v)`"
    }
  ]
}
{
  "name": "BarycentricMapperEdgeSetTopology",
  "main": {
    "name": "BarycentricMapperEdgeSetTopology",
    "namespace": "sofa::component::mapping::linear",
    "module": "Sofa.Component.Mapping.Linear",
    "include": "sofa/component/mapping/linear/BarycentricMappers/BarycentricMapperEdgeSetTopology.h",
    "doc": "Class allowing barycentric mapping computation on a BaseMeshTopology with edges",
    "inherits": [
      "BarycentricMapperTopologyContainer"
    ],
    "templates": [
      "sofa::sofa::defaulttype::Vec3Types, sofa::sofa::defaulttype::Vec3Types"
    ],
    "data_fields": [],
    "links": [],
    "methods": [
      {
        "name": "init",
        "return_type": "void",
        "params": [
          {
            "name": "out",
            "type": "const typename Out::VecCoord &"
          },
          {
            "name": "in",
            "type": "const typename In::VecCoord &"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "addPointInLine",
        "return_type": "int",
        "params": [
          {
            "name": "edgeIndex",
            "type": "const int"
          },
          {
            "name": "baryCoords",
            "type": "const SReal *"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "createPointInLine",
        "return_type": "int",
        "params": [
          {
            "name": "p",
            "type": "const typename Out::Coord &"
          },
          {
            "name": "edgeIndex",
            "type": "int"
          },
          {
            "name": "points",
            "type": "const typename In::VecCoord *"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getElements",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "getBarycentricCoefficients",
        "return_type": "int",
        "params": [
          {
            "name": "barycentricCoordinates",
            "type": "const int &"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "computeBase",
        "return_type": "void",
        "params": [
          {
            "name": "base",
            "type": "Mat3x3 &"
          },
          {
            "name": "in",
            "type": "const typename In::VecCoord &"
          },
          {
            "name": "element",
            "type": "const Edge &"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "computeCenter",
        "return_type": "void",
        "params": [
          {
            "name": "center",
            "type": "Vec3 &"
          },
          {
            "name": "in",
            "type": "const typename In::VecCoord &"
          },
          {
            "name": "element",
            "type": "const Edge &"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "computeDistance",
        "return_type": "void",
        "params": [
          {
            "name": "d",
            "type": "SReal &"
          },
          {
            "name": "v",
            "type": "const Vec3 &"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "addPointInElement",
        "return_type": "void",
        "params": [
          {
            "name": "elementIndex",
            "type": "const int"
          },
          {
            "name": "baryCoords",
            "type": "const SReal *"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      }
    ]
  },
  "desc": {
    "description": "The `BarycentricMapperEdgeSetTopology` is a SOFA component that facilitates barycentric mapping computations on a BaseMeshTopology with edges, specifically designed for linear mappings in the Sofa.Component.Mapping.Linear module. It inherits from `BarycentricMapperTopologyContainer`, indicating it deals with topological data structures and provides methods to manage points within edges of the mesh topology.\n\nThis component interacts with other SOFA components through its initialization method (`init`), which requires input and output coordinates, and by extending methods for adding and creating points within line segments (edges) using barycentric coordinates. The `addPointInLine` and `createPointInLine` methods are crucial for this functionality.\n\nPractical usage involves setting up the component with appropriate topology containers (`fromTopology`, `toTopology`). It supports operations such as adding a point to an edge based on barycentric coordinates, computing the center of an edge, and retrieving elements in the form of edges. However, it's noted that some methods like `computeBase` and `computeDistance` are not implemented for edges.\n\nThis component is particularly useful in simulations requiring precise handling of point placements along edges using linear mappings."
  },
  "maths": {
    "math_description": {
      "overview": "The `BarycentricMapperEdgeSetTopology` component facilitates barycentric mapping computations for points within the edges of a mesh topology in SOFA. It enables linear mappings by providing methods to manage these points using barycentric coordinates.",
      "functions_and_methods": [
        {
          "name": "`addPointInLine(const Index edgeIndex, const SReal* baryCoords)`",
          "description": "Adds a point on an edge defined by `edgeIndex` using the barycentric coordinate `baryCoords`. The barycentric coordinates are stored in a data structure and used to map points within the edge."
        },
        {
          "name": "`createPointInLine(const typename Out::Coord& p, Index edgeIndex, const typename In::VecCoord* points)`",
          "description": "Creates a point `p` on an edge defined by `edgeIndex`, where `points` are the coordinates of the vertices of the edge. It computes the barycentric coordinate for `p` and uses it to place the point along the edge."
        },
        {
          "name": "`getElements()`",
          "description": "Returns a vector of edges from the mesh topology, each represented as an index pair corresponding to its vertices."
        },
        {
          "name": "`getBarycentricCoefficients(const std::array<Real, MappingData::NumberOfCoordinates>& barycentricCoordinates)`",
          "description": "Computes and returns the barycentric coefficients for a given set of coordinates. For an edge with two nodes, this method computes the weights [1 - t, t], where `t` is the barycentric coordinate."
        },
        {
          "name": "`computeCenter(Vec3& center, const typename In::VecCoord& in, const Edge& element)`",
          "description": "Computes the center of an edge `element`, which is the midpoint between its two vertices. The coordinates of the vertices are provided by `in`."
        }
      ],
      "unimplemented_methods": [
        {
          "name": "`computeBase(Mat3x3& base, const typename In::VecCoord& in, const Edge& element)`",
          "description": "This method is not implemented for edges. It would be used to compute a basis transformation matrix if applicable."
        },
        {
          "name": "`computeDistance(SReal& d, const Vec3& v)`",
          "description": "This method is also not implemented for edges and would typically be used to calculate some distance metric or projection."
        }
      ]
    }
  },
  "summary": {
    "abstract": "Facilitates barycentric mapping computations on BaseMeshTopologies with edges, enabling precise point placement along line segments in SOFA simulations.",
    "sheet": "# BarycentricMapperEdgeSetTopology\n\n## Overview\nThe `BarycentricMapperEdgeSetTopology` is a component within the Sofa.Component.Mapping.Linear module that handles barycentric mapping computations on BaseMeshTopologies with edges. It inherits from `BarycentricMapperTopologyContainer`, indicating its role in managing points within line segments (edges) using barycentric coordinates.\n\n## Parameters and Data\nThis component does not expose any significant Data fields, as it primarily relies on inherited functionality from the parent class for its operations.\n\n## Dependencies and Connections\nThe `BarycentricMapperEdgeSetTopology` typically requires appropriate topology containers (`fromTopology`, `toTopology`) to be set up. It interacts with other SOFA components through methods such as `init`, which requires input and output coordinates, and extends methods for adding and creating points within line segments using barycentric coordinates.\n\n## Practical Notes\nThis component is particularly useful in simulations requiring precise handling of point placements along edges using linear mappings. Methods like `computeBase` and `computeDistance` are not implemented for edges, so users should be aware that these functionalities are limited."
  }
}