Muscat.Bridges.vtkBridge module¶
- AddCellsFromVtkCellArrayToMesh(cells, cellTypesArray: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None, out: Mesh, originalIdsOffset=0)[source]¶
Function to migrate cells from a vtkCellArray to a Muscattured Mesh
- Parameters:
cells (vtkCellArray) – the cell to be created in the mesh
cellTypesArray (ArrayLike) – the vtk cell type to use for in the vtkCellArray. In the case is none we infer the type of cell from the number of nodes (for the polys in a vtkPolyData)
out (Mesh) – the output mesh
originalIdsOffset (offset to apply to the original ids) –
- CellDataToPoint(mesh: Mesh, cellfields: ndarray) ndarray [source]¶
Applies the CellDataToPointData from vtk. Supported only for the dimensionality of the mesh (no mix of elements of different dimensions)
- Parameters:
mesh (Mesh) – Mesh containing the cells and vertices concerned by the conversion.
cellfield (np.ndarray) – of size (number of fields, number of elements). Cell fields to convert to Point field.
- Returns:
of size (number of points, number of fields). Field converted at the vertices of the mesh.
- Return type:
np.ndarray
- GetOutputVtk(request, inInfoVec, outInfoVec, copyAttr: bool = True, outputNumber=0) vtkPolyData | vtkUnstructuredGrid [source]¶
- MeshToVtk(mesh: Mesh, vtkobject=None, TagsAsFields=False) vtkPolyData | vtkUnstructuredGrid [source]¶
- PlotMesh(mesh: Mesh | vtkPolyData | vtkUnstructuredGrid, TagsAsFields: bool = False)[source]¶
Plot the input mesh using vtk,
- Parameters:
mesh (Union[Mesh, "vtkPolyData", "vtkUnstructuredGrid"]) – mesh to be plotted
TagsAsFields (bool, optional) – if the mesh is a Muscat mesh (Mesh) then this option can be used to control if the tags are converted to field before plotting , by default False
- SetOutputMuscat(request, inInfoVec, outInfoVec, outMesh: Mesh, TagsAsFields: bool = False) None [source]¶
- VtkToPartitionedMesh(vtkObject, OP: ~typing.Callable[[~vtkmodules.vtkCommonDataModel.vtkPolyData | ~vtkmodules.vtkCommonDataModel.vtkUnstructuredGrid], ~Muscat.Containers.Mesh.Mesh] = <function VtkToMesh>)[source]¶
Experimental, Vtk To PartitionedMesh
- Parameters:
vtkObject (vtkMultiBlockDataSet) – _description_
OP (Callable[[Union[vtkPolyData, vtkUnstructuredGrid]], Mesh], default VtkToMesh() function) – call operator to convert vtk mesh to mesh
- Returns:
A partitioned mesh with every block as a Mesh
- Return type: