Back

CylinderGridTopology

The `CylinderGridTopology` is a SOFA component that defines the topology of a cylindrical grid in 3D space. It inherits from `GridTopology`, providing specific functionalities for cylinder-shaped grids. This component allows users to specify the geometry and position of the cylinder via parameters such as radius, length, center, and axis direction. The `CylinderGridTopology` interacts with other SOFA components by defining a structured grid over which mechanical simulations can be performed. ### Interactions - **GridTopology**: Inherits from this class to leverage general grid topology functionalities while extending it for cylinder-specific cases. - **Mechanical Models**: Provides the geometric basis for models such as finite elements or particles that are distributed along the cylindrical grid. This enables simulations involving soft tissue, bones, or other structures modeled as cylinders. ### Usage Guidance and Data Fields - `d_center`: Specifies the center of the cylinder (Vec3). - `d_axis`: Defines the main direction of the cylinder (Vec3). - `d_radius`: Sets the radius of the cylinder (SReal). - `d_length`: Determines the length along the cylinder's axis (SReal).

abstract
The `CylinderGridTopology` defines the topology of a cylindrical grid in 3D space, specifying its geometry via radius, length, center, and axis direction. It interacts with other SOFA components to enable mechanical simulations over structured grids.
sheet
# CylinderGridTopology ## Overview The `CylinderGridTopology` is a component that defines the topology of a cylindrical grid in 3D space. It inherits from `GridTopology`, extending its functionalities for cylinder-specific cases. This component interacts with other SOFA components by providing a structured grid over which mechanical simulations can be performed. ## Parameters and Data The significant Data fields exposed by this component are: - **d_center**: Specifies the center of the cylinder (Vec3). - **d_axis**: Defines the main direction of the cylinder (Vec3). - **d_radius**: Sets the radius of the cylinder (SReal). - **d_length**: Determines the length along the cylinder's axis (SReal).
description
The `CylinderGridTopology` is a SOFA component that defines the topology of a cylindrical grid in 3D space. It inherits from `GridTopology`, providing specific functionalities for cylinder-shaped grids. This component allows users to specify the geometry and position of the cylinder via parameters such as radius, length, center, and axis direction. The `CylinderGridTopology` interacts with other SOFA components by defining a structured grid over which mechanical simulations can be performed. ### Interactions - **GridTopology**: Inherits from this class to leverage general grid topology functionalities while extending it for cylinder-specific cases. - **Mechanical Models**: Provides the geometric basis for models such as finite elements or particles that are distributed along the cylindrical grid. This enables simulations involving soft tissue, bones, or other structures modeled as cylinders. ### Usage Guidance and Data Fields - `d_center`: Specifies the center of the cylinder (Vec3). - `d_axis`: Defines the main direction of the cylinder (Vec3). - `d_radius`: Sets the radius of the cylinder (SReal). - `d_length`: Determines the length along the cylinder's axis (SReal).
maths
<p>The <code>CylinderGridTopology</code> is a SOFA component that defines the topology of a cylindrical grid in 3D space. It inherits from <code>GridTopology</code>, extending its functionalities to handle cylinder-specific cases.</p> <h2>Geometry and Parameters</h2> <p>The cylindrical grid is defined by several key parameters:</p> <ul> <li><strong>Cylinder Center (<var>d_center</var>)</strong>: The center of the cylinder, represented as a 3D vector \(\mathbf{c} = (c_x, c_y, c_z)\).</li> <li><strong>Axis Direction (<var>d_axis</var>)</strong>: The main direction along the length of the cylinder, represented as a unit vector \(\hat{\mathbf{z}} = (a_x, a_y, a_z)\). This vector is normalized to have unit magnitude.</li> <li><strong>Radius (<var>d_radius</var>)</strong>: The radius of the cylinder, denoted as \(r\).</li> <li><strong>Length (<var>d_length</var>)</strong>: The length along the axis direction, denoted as \(l\).</li> </ul> <h2>Grid Definition</h2> <p>The cylindrical grid is discretized into a structured grid with dimensions \((nx, ny, nz)\), where:</p> <ul> <li><var>nx</var>: Number of points along the radial direction.</li> <li><var>ny</var>: Number of points around the circumference (azimuthal direction).</li> <li><var>nz</var>: Number of points along the length of the cylinder (axial direction).</li> </ul> <p>The grid is defined by mapping each point in the structured grid to a position on the cylindrical surface. The function \(\mathbf{p}(i, j, k)\) returns the 3D coordinates of the grid point at indices \((i, j, k)\).</p> <h2>Coordinate Transformation</h2> <p>To obtain the position of a grid point on the cylindrical surface:</p> <ul> <li><strong>Radial Direction (\(x'\))</strong>: The radial component is mapped from \([0, r]\) to the interval \([-r, r]\).</li> <li><strong>Azimuthal Direction (\(y'\))</strong>: The azimuthal component is scaled to lie on a circle with radius \(r\). This ensures that points are distributed evenly along the circumference of the cylinder.</li> <li><strong>Axial Direction (\(z'\))</strong>: The axial component is mapped linearly from \([0, l]\).</li> </ul> <p>The transformation involves defining orthogonal unit vectors \(\hat{\mathbf{x}}\), \(\hat{\mathbf{y}}\), and \(\hat{\mathbf{z}}\) that span the cylindrical coordinate system:</p> <ul> <li><var>axisZ (\(\hat{\mathbf{z}}\))</var>: The normalized axis direction.</li> <li><var>axisX (\(\hat{\mathbf{x}}\))</var>: A unit vector orthogonal to \(\hat{\mathbf{z}}\).</li> <li><var>axisY (\(\hat{\mathbf{y}}\))</var>: A unit vector orthogonal to both \(\hat{\mathbf{x}}\) and \(\hat{\mathbf{z}}\), computed as the cross product of these vectors.</li> </ul> <p>The 3D position of a grid point is then given by:</p> \[ \mathbf{p}(i, j, k) = \mathbf{c} + x' \hat{\mathbf{x}} + y' \hat{\mathbf{y}} + z' \hat{\mathbf{z}} \] <p>where:</p> <ul> <li><var>x'</var>: Radial coordinate scaled from \([-r, r]\).</li> <li><var>y'</var>: Azimuthal coordinate scaled to lie on the circle with radius \(r\).</li> <li><var>z'</var>: Axial coordinate scaled linearly from \([0, l]\).</li> </ul> <h2>Interactions and Usage</h2> <p>The <code>CylinderGridTopology</code> interacts with other SOFA components by providing a structured grid over which mechanical simulations can be performed. This enables the simulation of various structures modeled as cylinders, such as soft tissue or bones.</p>
{
  "name": "CylinderGridTopology",
  "main": {
    "name": "CylinderGridTopology",
    "namespace": "sofa::component::topology::container::grid",
    "module": "Sofa.Component.Topology.Container.Grid",
    "include": "sofa/component/topology/container/grid/CylinderGridTopology.h",
    "doc": "Cylinder grid in 3D.\n\nDefine a cylinder grid topology\nParameters are its @sa d_radius and @sa d_length .\nPosition and direction are set by @sa d_center and @sa d_axis\nnz discretisation is along the cylinder axis",
    "inherits": [
      "GridTopology"
    ],
    "templates": [],
    "data_fields": [
      {
        "name": "d_center",
        "type": "Vec3",
        "xmlname": "center",
        "help": "Center of the cylinder"
      },
      {
        "name": "d_axis",
        "type": "Vec3",
        "xmlname": "axis",
        "help": "Main direction of the cylinder"
      },
      {
        "name": "d_radius",
        "type": "SReal",
        "xmlname": "radius",
        "help": "Radius of the cylinder"
      },
      {
        "name": "d_length",
        "type": "SReal",
        "xmlname": "length",
        "help": "Length of the cylinder along its axis"
      }
    ],
    "links": [],
    "methods": [
      {
        "name": "getPointInGrid",
        "return_type": "Vec3",
        "params": [
          {
            "name": "i",
            "type": "int"
          },
          {
            "name": "j",
            "type": "int"
          },
          {
            "name": "k",
            "type": "int"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "setCenter",
        "return_type": "void",
        "params": [
          {
            "name": "x",
            "type": "SReal"
          },
          {
            "name": "y",
            "type": "SReal"
          },
          {
            "name": "z",
            "type": "SReal"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "setAxis",
        "return_type": "void",
        "params": [
          {
            "name": "x",
            "type": "SReal"
          },
          {
            "name": "y",
            "type": "SReal"
          },
          {
            "name": "z",
            "type": "SReal"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "setRadius",
        "return_type": "void",
        "params": [
          {
            "name": "radius",
            "type": "SReal"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "setLength",
        "return_type": "void",
        "params": [
          {
            "name": "length",
            "type": "SReal"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      }
    ]
  },
  "desc": {
    "description": "The `CylinderGridTopology` is a SOFA component that defines the topology of a cylindrical grid in 3D space. It inherits from `GridTopology`, providing specific functionalities for cylinder-shaped grids. This component allows users to specify the geometry and position of the cylinder via parameters such as radius, length, center, and axis direction. The `CylinderGridTopology` interacts with other SOFA components by defining a structured grid over which mechanical simulations can be performed.\n\n### Interactions\n- **GridTopology**: Inherits from this class to leverage general grid topology functionalities while extending it for cylinder-specific cases.\n- **Mechanical Models**: Provides the geometric basis for models such as finite elements or particles that are distributed along the cylindrical grid. This enables simulations involving soft tissue, bones, or other structures modeled as cylinders.\n\n### Usage Guidance and Data Fields\n- `d_center`: Specifies the center of the cylinder (Vec3).\n- `d_axis`: Defines the main direction of the cylinder (Vec3).\n- `d_radius`: Sets the radius of the cylinder (SReal).\n- `d_length`: Determines the length along the cylinder's axis (SReal)."
  },
  "maths": {
    "maths": "<p>The <code>CylinderGridTopology</code> is a SOFA component that defines the topology of a cylindrical grid in 3D space. It inherits from <code>GridTopology</code>, extending its functionalities to handle cylinder-specific cases.</p>\n\n<h2>Geometry and Parameters</h2>\n\n<p>The cylindrical grid is defined by several key parameters:</p>\n\n<ul>\n    <li><strong>Cylinder Center (<var>d_center</var>)</strong>: The center of the cylinder, represented as a 3D vector \\(\\mathbf{c} = (c_x, c_y, c_z)\\).</li>\n    <li><strong>Axis Direction (<var>d_axis</var>)</strong>: The main direction along the length of the cylinder, represented as a unit vector \\(\\hat{\\mathbf{z}} = (a_x, a_y, a_z)\\). This vector is normalized to have unit magnitude.</li>\n    <li><strong>Radius (<var>d_radius</var>)</strong>: The radius of the cylinder, denoted as \\(r\\).</li>\n    <li><strong>Length (<var>d_length</var>)</strong>: The length along the axis direction, denoted as \\(l\\).</li>\n</ul>\n\n<h2>Grid Definition</h2>\n\n<p>The cylindrical grid is discretized into a structured grid with dimensions \\((nx, ny, nz)\\), where:</p>\n\n<ul>\n    <li><var>nx</var>: Number of points along the radial direction.</li>\n    <li><var>ny</var>: Number of points around the circumference (azimuthal direction).</li>\n    <li><var>nz</var>: Number of points along the length of the cylinder (axial direction).</li>\n</ul>\n\n<p>The grid is defined by mapping each point in the structured grid to a position on the cylindrical surface. The function \\(\\mathbf{p}(i, j, k)\\) returns the 3D coordinates of the grid point at indices \\((i, j, k)\\).</p>\n\n<h2>Coordinate Transformation</h2>\n\n<p>To obtain the position of a grid point on the cylindrical surface:</p>\n\n<ul>\n    <li><strong>Radial Direction (\\(x'\\))</strong>: The radial component is mapped from \\([0, r]\\) to the interval \\([-r, r]\\).</li>\n    <li><strong>Azimuthal Direction (\\(y'\\))</strong>: The azimuthal component is scaled to lie on a circle with radius \\(r\\). This ensures that points are distributed evenly along the circumference of the cylinder.</li>\n    <li><strong>Axial Direction (\\(z'\\))</strong>: The axial component is mapped linearly from \\([0, l]\\).</li>\n</ul>\n\n<p>The transformation involves defining orthogonal unit vectors \\(\\hat{\\mathbf{x}}\\), \\(\\hat{\\mathbf{y}}\\), and \\(\\hat{\\mathbf{z}}\\) that span the cylindrical coordinate system:</p>\n\n<ul>\n    <li><var>axisZ (\\(\\hat{\\mathbf{z}}\\))</var>: The normalized axis direction.</li>\n    <li><var>axisX (\\(\\hat{\\mathbf{x}}\\))</var>: A unit vector orthogonal to \\(\\hat{\\mathbf{z}}\\).</li>\n    <li><var>axisY (\\(\\hat{\\mathbf{y}}\\))</var>: A unit vector orthogonal to both \\(\\hat{\\mathbf{x}}\\) and \\(\\hat{\\mathbf{z}}\\), computed as the cross product of these vectors.</li>\n</ul>\n\n<p>The 3D position of a grid point is then given by:</p>\n\n\\[ \n    \\mathbf{p}(i, j, k) = \\mathbf{c} + x' \\hat{\\mathbf{x}} + y' \\hat{\\mathbf{y}} + z' \\hat{\\mathbf{z}}\n\\]\n\n<p>where:</p>\n\n<ul>\n    <li><var>x'</var>: Radial coordinate scaled from \\([-r, r]\\).</li>\n    <li><var>y'</var>: Azimuthal coordinate scaled to lie on the circle with radius \\(r\\).</li>\n    <li><var>z'</var>: Axial coordinate scaled linearly from \\([0, l]\\).</li>\n</ul>\n\n<h2>Interactions and Usage</h2>\n\n<p>The <code>CylinderGridTopology</code> interacts with other SOFA components by providing a structured grid over which mechanical simulations can be performed. This enables the simulation of various structures modeled as cylinders, such as soft tissue or bones.</p>"
  },
  "summary": {
    "abstract": "The `CylinderGridTopology` defines the topology of a cylindrical grid in 3D space, specifying its geometry via radius, length, center, and axis direction. It interacts with other SOFA components to enable mechanical simulations over structured grids.",
    "sheet": "# CylinderGridTopology\n\n## Overview\n\nThe `CylinderGridTopology` is a component that defines the topology of a cylindrical grid in 3D space. It inherits from `GridTopology`, extending its functionalities for cylinder-specific cases. This component interacts with other SOFA components by providing a structured grid over which mechanical simulations can be performed.\n\n## Parameters and Data\n\nThe significant Data fields exposed by this component are:\n\n- **d_center**: Specifies the center of the cylinder (Vec3).\n- **d_axis**: Defines the main direction of the cylinder (Vec3).\n- **d_radius**: Sets the radius of the cylinder (SReal).\n- **d_length**: Determines the length along the cylinder's axis (SReal)."
  }
}