wrappers
Element
dataclass
A minimalist raw data container.
Source code in src/dxtr/utils/wrappers.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
extract_positions()
Extracts position vectors of the vertices from the raw data.
Returns:
| Type | Description |
|---|---|
ndarray or None
|
A Nx3 array of floats. Where N = number of vertices. |
Source code in src/dxtr/utils/wrappers.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
extract_simplices()
Extracts highest order simplices from the raw data.
Returns:
| Type | Description |
|---|---|
list of list of int or None
|
A list of lists of indices of the vertices forming the summits of all the highest order simplices in the structure. |
Source code in src/dxtr/utils/wrappers.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
set_rawdata(rawdata, first_line)
Sets the raw data for the element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rawdata
|
str
|
The raw data as a string. |
required |
first_line
|
int
|
The first line of the raw data to set. |
required |
Source code in src/dxtr/utils/wrappers.py
117 118 119 120 121 122 123 124 125 126 127 128 | |
Property
dataclass
A minimalist container to store property name, type and eventually data.
Source code in src/dxtr/utils/wrappers.py
166 167 168 169 170 171 172 173 | |
UGrid
Bases: UnstructuredGrid
The pyvista.UnstructuredGrid with a useful classmethod on top.
Notes
The only add-on compared to the mother class is the
generate_from class method that enables to directly instantiate
an UnstructuredGrid from the dxtr own data structures.
Source code in src/dxtr/utils/wrappers.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
generate_from(obj, **kwargs)
classmethod
Instantiates UnstructuredGrid from SimplicialComplex or Cochain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
SimplicialComplex or Cochain
|
The object we want to transform into a |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
scaling_factor |
float
|
A scaling factor to apply to the |
for_visualization |
bool
|
If True, scalar-valued 1- |
Returns:
| Type | Description |
|---|---|
UGrid or None
|
The desired |
Source code in src/dxtr/utils/wrappers.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |