diff --git a/src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp b/src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp index d693595d9d..91de18d233 100644 --- a/src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp +++ b/src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp @@ -7,6 +7,7 @@ #include #include +#include "SimplnxCore/Filters/CreateGeometryFilter.hpp" #include "SimplnxCore/SimplnxCoreFilterBinding.hpp" #include "SimplnxCore/SimplnxCorePlugin.hpp" @@ -424,6 +425,8 @@ PYBIND11_MODULE(simplnx, mod) } return fmt::format("", errors, self.warnings()); }); + result.def("valid", &Result<>::valid); + result.def("invalid", &Result<>::invalid); py::enum_ numericType(mod, "NumericType"); numericType.value("int8", NumericType::int8); @@ -1167,7 +1170,8 @@ PYBIND11_MODULE(simplnx, mod) BindParameterConstructor(calculatorParameter); - choicesParameter.def(py::init()); + choicesParameter.def(py::init(), "name"_a, "human_name"_a, "help_text"_a, + "default_value"_a, "choices"_a); BindParameterConstructor(dataGroupCreationParameter); @@ -1520,4 +1524,168 @@ PYBIND11_MODULE(simplnx, mod) manualImportFinder.def("clear", &ManualImportFinder::clear); manualImportFinder.def("contains_path", &ManualImportFinder::containsPath, "path"_a); manualImportFinder.def("contains_module", &ManualImportFinder::containsModule, "mod_name"_a); + + // Geometry Helper Methods + py::module_ sub = mod.def_submodule("CreateGeometry", "Submodule that contains the CreateGeometry utility methods."); + + sub.def( + "create_image_geometry", + [](DataStructure& ds, const DataPath& geometryPath, const std::vector& dims, const std::vector& origin, const std::vector& spacing, + const std::string& cellAttrMatrixName) { + CreateGeometryFilter filter; + Arguments args; + + args.insertOrAssign(CreateGeometryFilter::k_GeometryType_Key, std::make_any(CreateGeometryFilter::k_ImageGeometry)); + args.insertOrAssign(CreateGeometryFilter::k_GeometryPath_Key, std::make_any(geometryPath)); + args.insertOrAssign(CreateGeometryFilter::k_Dimensions_Key, std::make_any(dims)); + args.insertOrAssign(CreateGeometryFilter::k_Origin_Key, std::make_any(origin)); + args.insertOrAssign(CreateGeometryFilter::k_Spacing_Key, std::make_any(spacing)); + args.insertOrAssign(CreateGeometryFilter::k_CellAttributeMatrixName_Key, std::make_any(cellAttrMatrixName)); + + IFilter::ExecuteResult executeResult = filter.execute(ds, args); + return executeResult.result; + }, + "data_structure"_a, "geometry_path"_a, "dimensions"_a, "origin"_a, "spacing"_a, "cell_attr_matrix_name"_a = "Cell Data"); + + sub.def( + "create_rect_grid_geometry", + [](DataStructure& ds, const DataPath& geometryPath, const DataPath& xBoundsPath, const DataPath& yBoundsPath, const DataPath& zBoundsPath, const std::string& cellAttrMatrixName, + ArrayHandlingType arrayHandling) { + CreateGeometryFilter filter; + Arguments args; + + args.insertOrAssign(CreateGeometryFilter::k_GeometryType_Key, std::make_any(CreateGeometryFilter::k_RectGridGeometry)); + args.insertOrAssign(CreateGeometryFilter::k_GeometryPath_Key, std::make_any(geometryPath)); + args.insertOrAssign(CreateGeometryFilter::k_XBoundsPath_Key, std::make_any(xBoundsPath)); + args.insertOrAssign(CreateGeometryFilter::k_YBoundsPath_Key, std::make_any(yBoundsPath)); + args.insertOrAssign(CreateGeometryFilter::k_ZBoundsPath_Key, std::make_any(zBoundsPath)); + args.insertOrAssign(CreateGeometryFilter::k_CellAttributeMatrixName_Key, std::make_any(cellAttrMatrixName)); + args.insertOrAssign(CreateGeometryFilter::k_ArrayHandling_Key, std::make_any(to_underlying(arrayHandling))); + + IFilter::ExecuteResult executeResult = filter.execute(ds, args); + return executeResult.result; + }, + "data_structure"_a, "geometry_path"_a, "x_bounds_path"_a, "y_bounds_path"_a, "z_bounds_path"_a, "cell_attr_matrix_name"_a = "Cell Data", "array_handling"_a = ArrayHandlingType::Copy); + + sub.def( + "create_vertex_geometry", + [](DataStructure& ds, const DataPath& geometryPath, const DataPath& verticesPath, const std::string& vertexAttrMatrixName, ArrayHandlingType arrayHandling) { + CreateGeometryFilter filter; + Arguments args; + + args.insertOrAssign(CreateGeometryFilter::k_GeometryType_Key, std::make_any(CreateGeometryFilter::k_VertexGeometry)); + args.insertOrAssign(CreateGeometryFilter::k_GeometryPath_Key, std::make_any(geometryPath)); + args.insertOrAssign(CreateGeometryFilter::k_ArrayHandling_Key, std::make_any(to_underlying(arrayHandling))); + args.insertOrAssign(CreateGeometryFilter::k_VertexListPath_Key, std::make_any(verticesPath)); + args.insertOrAssign(CreateGeometryFilter::k_VertexAttributeMatrixName_Key, std::make_any(vertexAttrMatrixName)); + + IFilter::ExecuteResult executeResult = filter.execute(ds, args); + return executeResult.result; + }, + "data_structure"_a, "geometry_path"_a, "vertices_path"_a, "vertex_attr_matrix_name"_a = "Vertex Data", "array_handling"_a = ArrayHandlingType::Copy); + + sub.def( + "create_edge_geometry", + [](DataStructure& ds, const DataPath& geometryPath, const DataPath& verticesPath, const DataPath& edgeListPath, const std::string& vertexAttrMatrixName, const std::string& edgeAttrMatrixName, + ArrayHandlingType arrayHandling) { + CreateGeometryFilter filter; + Arguments args; + + args.insertOrAssign(CreateGeometryFilter::k_GeometryType_Key, std::make_any(CreateGeometryFilter::k_EdgeGeometry)); + args.insertOrAssign(CreateGeometryFilter::k_GeometryPath_Key, std::make_any(geometryPath)); + args.insertOrAssign(CreateGeometryFilter::k_ArrayHandling_Key, std::make_any(to_underlying(arrayHandling))); + args.insertOrAssign(CreateGeometryFilter::k_VertexListPath_Key, std::make_any(verticesPath)); + args.insertOrAssign(CreateGeometryFilter::k_VertexAttributeMatrixName_Key, std::make_any(vertexAttrMatrixName)); + args.insertOrAssign(CreateGeometryFilter::k_EdgeListPath_Key, std::make_any(edgeListPath)); + args.insertOrAssign(CreateGeometryFilter::k_EdgeAttributeMatrixName_Key, std::make_any(edgeAttrMatrixName)); + + IFilter::ExecuteResult executeResult = filter.execute(ds, args); + return executeResult.result; + }, + "data_structure"_a, "geometry_path"_a, "vertices_path"_a, "edge_list_path"_a, "vertex_attr_matrix_name"_a = "Vertex Data", "edge_attr_matrix_name"_a = "Edge Data", + "array_handling"_a = ArrayHandlingType::Copy); + + sub.def( + "create_triangle_geometry", + [](DataStructure& ds, const DataPath& geometryPath, const DataPath& verticesPath, const DataPath& triangleListPath, const std::string& vertexAttrMatrixName, + const std::string& faceAttrMatrixName, ArrayHandlingType arrayHandling) { + CreateGeometryFilter filter; + Arguments args; + + args.insertOrAssign(CreateGeometryFilter::k_GeometryType_Key, std::make_any(CreateGeometryFilter::k_TriangleGeometry)); + args.insertOrAssign(CreateGeometryFilter::k_GeometryPath_Key, std::make_any(geometryPath)); + args.insertOrAssign(CreateGeometryFilter::k_ArrayHandling_Key, std::make_any(to_underlying(arrayHandling))); + args.insertOrAssign(CreateGeometryFilter::k_VertexListPath_Key, std::make_any(verticesPath)); + args.insertOrAssign(CreateGeometryFilter::k_VertexAttributeMatrixName_Key, std::make_any(vertexAttrMatrixName)); + args.insertOrAssign(CreateGeometryFilter::k_TriangleListPath_Key, std::make_any(triangleListPath)); + args.insertOrAssign(CreateGeometryFilter::k_FaceAttributeMatrixName_Key, std::make_any(faceAttrMatrixName)); + + IFilter::ExecuteResult executeResult = filter.execute(ds, args); + return executeResult.result; + }, + "data_structure"_a, "geometry_path"_a, "vertices_path"_a, "triangle_list_path"_a, "vertex_attr_matrix_name"_a = "Vertex Data", "face_attr_matrix_name"_a = "Face Data", + "array_handling"_a = ArrayHandlingType::Copy); + + sub.def( + "create_quad_geometry", + [](DataStructure& ds, const DataPath& geometryPath, const DataPath& verticesPath, const DataPath& quadListPath, const std::string& vertexAttrMatrixName, const std::string& faceAttrMatrixName, + ArrayHandlingType arrayHandling) { + CreateGeometryFilter filter; + Arguments args; + + args.insertOrAssign(CreateGeometryFilter::k_GeometryType_Key, std::make_any(CreateGeometryFilter::k_QuadGeometry)); + args.insertOrAssign(CreateGeometryFilter::k_GeometryPath_Key, std::make_any(geometryPath)); + args.insertOrAssign(CreateGeometryFilter::k_ArrayHandling_Key, std::make_any(to_underlying(arrayHandling))); + args.insertOrAssign(CreateGeometryFilter::k_VertexListPath_Key, std::make_any(verticesPath)); + args.insertOrAssign(CreateGeometryFilter::k_VertexAttributeMatrixName_Key, std::make_any(vertexAttrMatrixName)); + args.insertOrAssign(CreateGeometryFilter::k_QuadrilateralListPath_Key, std::make_any(quadListPath)); + args.insertOrAssign(CreateGeometryFilter::k_FaceAttributeMatrixName_Key, std::make_any(faceAttrMatrixName)); + + IFilter::ExecuteResult executeResult = filter.execute(ds, args); + return executeResult.result; + }, + "data_structure"_a, "geometry_path"_a, "vertices_path"_a, "quad_list_path"_a, "vertex_attr_matrix_name"_a = "Vertex Data", "face_attr_matrix_name"_a = "Quad Data", + "array_handling"_a = ArrayHandlingType::Copy); + + sub.def( + "create_tetrahedral_geometry", + [](DataStructure& ds, const DataPath& geometryPath, const DataPath& verticesPath, const DataPath& tetrahedralListPath, const std::string& vertexAttrMatrixName, + const std::string& cellAttrMatrixName, ArrayHandlingType arrayHandling) { + CreateGeometryFilter filter; + Arguments args; + + args.insertOrAssign(CreateGeometryFilter::k_GeometryType_Key, std::make_any(CreateGeometryFilter::k_TetGeometry)); + args.insertOrAssign(CreateGeometryFilter::k_GeometryPath_Key, std::make_any(geometryPath)); + args.insertOrAssign(CreateGeometryFilter::k_ArrayHandling_Key, std::make_any(to_underlying(arrayHandling))); + args.insertOrAssign(CreateGeometryFilter::k_VertexListPath_Key, std::make_any(verticesPath)); + args.insertOrAssign(CreateGeometryFilter::k_VertexAttributeMatrixName_Key, std::make_any(vertexAttrMatrixName)); + args.insertOrAssign(CreateGeometryFilter::k_TetrahedralListPath_Key, std::make_any(tetrahedralListPath)); + args.insertOrAssign(CreateGeometryFilter::k_CellAttributeMatrixName_Key, std::make_any(cellAttrMatrixName)); + + IFilter::ExecuteResult executeResult = filter.execute(ds, args); + return executeResult.result; + }, + "data_structure"_a, "geometry_path"_a, "vertices_path"_a, "tetrahedral_list_path"_a, "vertex_attr_matrix_name"_a = "Vertex Data", "cell_attr_matrix_name"_a = "Cell Data", + "array_handling"_a = ArrayHandlingType::Copy); + + sub.def( + "create_hexahedral_geometry", + [](DataStructure& ds, const DataPath& geometryPath, const DataPath& verticesPath, const DataPath& hexahedralListPath, const std::string& vertexAttrMatrixName, + const std::string& cellAttrMatrixName, ArrayHandlingType arrayHandling) { + CreateGeometryFilter filter; + Arguments args; + + args.insertOrAssign(CreateGeometryFilter::k_GeometryType_Key, std::make_any(CreateGeometryFilter::k_HexGeometry)); + args.insertOrAssign(CreateGeometryFilter::k_GeometryPath_Key, std::make_any(geometryPath)); + args.insertOrAssign(CreateGeometryFilter::k_ArrayHandling_Key, std::make_any(to_underlying(arrayHandling))); + args.insertOrAssign(CreateGeometryFilter::k_VertexListPath_Key, std::make_any(verticesPath)); + args.insertOrAssign(CreateGeometryFilter::k_VertexAttributeMatrixName_Key, std::make_any(vertexAttrMatrixName)); + args.insertOrAssign(CreateGeometryFilter::k_HexahedralListPath_Key, std::make_any(hexahedralListPath)); + args.insertOrAssign(CreateGeometryFilter::k_CellAttributeMatrixName_Key, std::make_any(cellAttrMatrixName)); + + IFilter::ExecuteResult executeResult = filter.execute(ds, args); + return executeResult.result; + }, + "data_structure"_a, "geometry_path"_a, "vertices_path"_a, "hexahedral_list_path"_a, "vertex_attr_matrix_name"_a = "Vertex Data", "cell_attr_matrix_name"_a = "Cell Data", + "array_handling"_a = ArrayHandlingType::Copy); } diff --git a/wrapping/python/docs/source/User_API.rst b/wrapping/python/docs/source/User_API.rst index 3dc77a1be5..cf5e7b9810 100644 --- a/wrapping/python/docs/source/User_API.rst +++ b/wrapping/python/docs/source/User_API.rst @@ -29,6 +29,223 @@ Error & Warning Reporting else: print("No errors running the ConvertOrientations") +Creating Geometries +------------------ + +All the `simplnx` geometries can be created in Python using the following helper methods: + ++ CreateGeometry.create_image_geometry ++ CreateGeometry.create_rect_grid_geometry ++ CreateGeometry.create_vertex_geometry ++ CreateGeometry.create_edge_geometry ++ CreateGeometry.create_triangle_geometry ++ CreateGeometry.create_quad_geometry ++ CreateGeometry.create_tetrahedral_geometry ++ CreateGeometry.create_hexahedral_geometry + +The enumeration `ArrayHandlingType` defines how existing arrays will be handled when creating a new geometry. It includes the following values: + +- **Copy**: The existing arrays will be copied into the new geometry. +- **Move**: The existing arrays will be moved into the new geometry. + +Creating An Image Geometry +########################## + +To create an image geometry, use the `CreateGeometry.create_image_geometry` method. This method requires the following parameters: + +- `data_structure`: The data structure where the geometry will be created. +- `geometry_path`: The :ref:`DataPath ` where the geometry will be stored. +- `dimensions`: A list of dimensions for the image. +- `origin`: The origin coordinates of the image. +- `spacing`: The spacing between elements in the image. +- `cell_attr_matrix_name` (optional): The name of the cell attribute matrix. Defaults to "Cell Data". + +Example usage: + +.. code:: python + + import simplnx as nx + + # Create an image geometry + result: nx.Result = nx.CreateGeometry.create_image_geometry(data_structure=data_structure, geometry_path=nx.DataPath(["Image Geometry"]), dimensions=[100, 150, 200], origin=[0, 5, -2], spacing=[0.5, 0.5, 0.5], cell_attr_matrix_name='Image Data') + if result.valid(): + image_geom = data_structure[nx.DataPath(["Image Geometry"])] + print("Image Geometry Created!") + + +Creating A Rectilinear Grid Geometry +#################################### + +To create a rectilinear grid geometry, use the `CreateGeometry.create_rect_grid_geometry` method. This method requires the following parameters: + +- **data_structure**: The data structure where the geometry will be created. +- **geometry_path**: The :ref:`DataPath ` where the geometry will be stored. +- **x_bounds_path**: The :ref:`DataPath ` to the X bounds array. +- **y_bounds_path**: The :ref:`DataPath ` to the Y bounds array. +- **z_bounds_path**: The :ref:`DataPath ` to the Z bounds array. +- **cell_attr_matrix_name** (optional): The name of the cell attribute matrix. Defaults to "Cell Data". +- **array_handling** (optional): Specifies how to handle existing arrays. Defaults to ``ArrayHandlingType.Copy``. + +Example usage: + +.. code-block:: python + + import simplnx as nx + + # Create a rect grid geometry + result = nx.CreateGeometry.create_rect_grid_geometry(data_structure=data_structure, geometry_path=nx.DataPath(["Rect Grid Geometry"]), x_bounds_path=nx.DataPath(["Foo"]), y_bounds_path=nx.DataPath(["Y Bounds"]), z_bounds_path=nx.DataPath(["Z Bounds"]), cell_attr_matrix_name='Cell Data', array_handling=nx.ArrayHandlingType.Copy) + if result.valid(): + rect_grid_geom = data_structure[nx.DataPath(["Rect Grid Geometry"])] + print("Rect Grid Geometry Created!") + +Creating A Vertex Geometry +########################## + +To create a vertex geometry, use the `CreateGeometry.create_vertex_geometry` method. This method requires the following parameters: + +- **data_structure**: The data structure where the geometry will be created. +- **geometry_path**: The :ref:`DataPath ` where the geometry will be stored. +- **vertices_path**: The :ref:`DataPath ` to the vertices array. +- **vertex_attr_matrix_name** (optional): The name of the vertex attribute matrix. Defaults to "Vertex Data". +- **array_handling** (optional): Specifies how to handle existing arrays. Defaults to ``ArrayHandlingType.Copy``. + +Example usage: + +.. code-block:: python + + import simplnx as nx + + # Create a vertex geometry + result = nx.CreateGeometry.create_vertex_geometry(data_structure=data_structure, geometry_path=nx.DataPath(["Vertex Geometry"]), vertices_path=nx.DataPath("Vertices"), vertex_attr_matrix_name='Vertex Data', array_handling=nx.ArrayHandlingType.Copy) + if result.valid(): + vertex_geom = data_structure[nx.DataPath("Vertex Geometry")] + print("Vertex Geometry Created!") + +Creating An Edge Geometry +######################### + +To create an edge geometry, use the `CreateGeometry.create_edge_geometry` method. This method requires the following parameters: + +- **data_structure**: The data structure where the geometry will be created. +- **geometry_path**: The :ref:`DataPath ` where the geometry will be stored. +- **vertices_path**: The :ref:`DataPath ` to the vertices array. +- **edge_list_path**: The :ref:`DataPath ` to the edge list array. +- **vertex_attr_matrix_name** (optional): The name of the vertex attribute matrix. Defaults to "Vertex Data". +- **edge_attr_matrix_name** (optional): The name of the edge attribute matrix. Defaults to "Edge Data". +- **array_handling** (optional): Specifies how to handle existing arrays. Defaults to ``ArrayHandlingType.Copy``. + +Example usage: + +.. code-block:: python + + import simplnx as nx + + # Create an edge geometry + result = nx.CreateGeometry.create_edge_geometry(data_structure=data_structure, geometry_path=nx.DataPath(["Edge Geometry"]), vertices_path=nx.DataPath("Vertices"), edge_list_path=nx.DataPath("Edge List"), vertex_attr_matrix_name='Vertex Data', edge_attr_matrix_name='Edge Data', array_handling=nx.ArrayHandlingType.Copy) + if result.valid(): + edge_geom = data_structure[nx.DataPath("Edge Geometry")] + print("Edge Geometry Created!") + +Creating A Triangle Geometry +############################ + +To create a triangle geometry, use the `CreateGeometry.create_triangle_geometry` method. This method requires the following parameters: + +- **data_structure**: The data structure where the geometry will be created. +- **geometry_path**: The :ref:`DataPath ` where the geometry will be stored. +- **vertices_path**: The :ref:`DataPath ` to the vertices array. +- **triangle_list_path**: The :ref:`DataPath ` to the triangle list array. +- **vertex_attr_matrix_name** (optional): The name of the vertex attribute matrix. Defaults to "Vertex Data". +- **face_attr_matrix_name** (optional): The name of the face attribute matrix. Defaults to "Face Data". +- **array_handling** (optional): Specifies how to handle existing arrays. Defaults to ``ArrayHandlingType.Copy``. + +Example usage: + +.. code-block:: python + + import simplnx as nx + + # Create a triangle geometry + result = nx.CreateGeometry.create_triangle_geometry(data_structure=data_structure, geometry_path=nx.DataPath(["Triangle Geometry"]), vertices_path=nx.DataPath("Vertices"), triangle_list_path=nx.DataPath("Triangle List"), vertex_attr_matrix_name='Vertex Data', face_attr_matrix_name='Face Data', array_handling=nx.ArrayHandlingType.Copy) + if result.valid(): + triangle_geom = data_structure[nx.DataPath("Triangle Geometry")] + print("Triangle Geometry Created!") + +Creating A Quadrilateral Geometry +################################# + +To create a quadrilateral geometry, use the `CreateGeometry.create_quad_geometry` method. This method requires the following parameters: + +- **data_structure**: The data structure where the geometry will be created. +- **geometry_path**: The :ref:`DataPath ` where the geometry will be stored. +- **vertices_path**: The :ref:`DataPath ` to the vertices array. +- **quad_list_path**: The :ref:`DataPath ` to the quadrilateral list array. +- **vertex_attr_matrix_name** (optional): The name of the vertex attribute matrix. Defaults to "Vertex Data". +- **face_attr_matrix_name** (optional): The name of the face attribute matrix. Defaults to "Quad Data". +- **array_handling** (optional): Specifies how to handle existing arrays. Defaults to ``ArrayHandlingType.Copy``. + +Example usage: + +.. code-block:: python + + import simplnx as nx + + # Create a quad geometry + result = nx.CreateGeometry.create_quad_geometry(data_structure=data_structure, geometry_path=nx.DataPath(["Quad Geometry"]), vertices_path=nx.DataPath("Vertices"), quad_list_path=nx.DataPath("Quad List"), vertex_attr_matrix_name='Vertex Data', face_attr_matrix_name='Quad Data', array_handling=nx.ArrayHandlingType.Copy) + if result.valid(): + quad_geom = data_structure[nx.DataPath("Quad Geometry")] + print("Quad Geometry Created!") + +Creating A Tetrahedral Geometry +############################### + +To create a tetrahedral geometry, use the `CreateGeometry.create_tetrahedral_geometry` method. This method requires the following parameters: + +- **data_structure**: The data structure where the geometry will be created. +- **geometry_path**: The :ref:`DataPath ` where the geometry will be stored. +- **vertices_path**: The :ref:`DataPath ` to the vertices array. +- **tetrahedral_list_path**: The :ref:`DataPath ` to the tetrahedral list array. +- **vertex_attr_matrix_name** (optional): The name of the vertex attribute matrix. Defaults to "Vertex Data". +- **cell_attr_matrix_name** (optional): The name of the cell attribute matrix. Defaults to "Cell Data". +- **array_handling** (optional): Specifies how to handle existing arrays. Defaults to ``ArrayHandlingType.Copy``. + +Example usage: + +.. code-block:: python + + import simplnx as nx + + # Create a tetrahedral geometry + result = nx.CreateGeometry.create_tetrahedral_geometry(data_structure=data_structure, geometry_path=nx.DataPath(["Tetrahedral Geometry"]), vertices_path=nx.DataPath("Vertices"), tetrahedral_list_path=nx.DataPath("Tetrahedral List"), vertex_attr_matrix_name='Vertex Data', cell_attr_matrix_name='Cell Data', array_handling=nx.ArrayHandlingType.Copy) + if result.valid(): + tetrahedral_geom = data_structure[nx.DataPath("Tetrahedral Geometry")] + print("Tetrahedral Geometry Created!") + +Creating A Hexahedral Geometry +############################## + +To create a hexahedral geometry, use the `CreateGeometry.create_hexahedral_geometry` method. This method requires the following parameters: + +- **data_structure**: The data structure where the geometry will be created. +- **geometry_path**: The :ref:`DataPath ` where the geometry will be stored. +- **vertices_path**: The :ref:`DataPath ` to the vertices array. +- **hexahedral_list_path**: The :ref:`DataPath ` to the hexahedral list array. +- **vertex_attr_matrix_name** (optional): The name of the vertex attribute matrix. Defaults to "Vertex Data". +- **cell_attr_matrix_name** (optional): The name of the cell attribute matrix. Defaults to "Cell Data". +- **array_handling** (optional): Specifies how to handle existing arrays. Defaults to ``ArrayHandlingType.Copy``. + +Example usage: + +.. code-block:: python + + import simplnx as nx + + # Create a hexahedral geometry + result = nx.CreateGeometry.create_hexahedral_geometry(data_structure=data_structure, geometry_path=nx.DataPath(["Hexahedral Geometry"]), vertices_path=nx.DataPath("Vertices"), hexahedral_list_path=nx.DataPath("Hexahedral List"), vertex_attr_matrix_name='Vertex Data', cell_attr_matrix_name='Cell Data', array_handling=nx.ArrayHandlingType.Copy) + if result.valid(): + hexahedral_geom = data_structure[nx.DataPath("Hexahedral Geometry")] + print("Hexahedral Geometry Created!") + General Parameters ------------------