You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: Enhance mesh functionality with polygon support and cell types
- Updated `Mesh` interface to include `cellTypes` for VTK compatibility.
- Implemented `inferCellTypes` and `getCellTypes` methods in `MeshUtils` for automatic cell type inference.
- Added triangulation support for mixed polygons in `MeshUtils`, ensuring compatibility with THREE.js.
- Enhanced tests for cell types and triangulation, covering various polygon configurations.
- Updated TypeScript documentation to reflect new features and usage examples.
* feat: Add support for mesh markers and boundary conditions
- Introduced marker support in the Mesh class to define boundary conditions, material regions, and geometric features.
- Added methods for automatic conversion between list-of-lists and flattened marker storage.
- Implemented marker reconstruction from flattened structures.
- Enhanced marker type detection based on element sizes.
- Added serialization support for markers during mesh encoding/decoding.
- Updated README.md to include examples and documentation for marker usage.
- Created new example notebook for working with mesh markers.
- Added unit tests for marker functionality, including creation, reconstruction, and serialization.
- Updated TypeScript interfaces and utility functions to support marker handling.
* feat: Introduce cell type utilities and integrate with Mesh class for improved element size handling
* Enhance mesh functionality with automatic marker size and offset calculations
- Updated `TestDictArrays` to include new array fields: `index_sizes` and `cell_types`.
- Modified `TestIndexSizes` to validate polygon count and inferred sizes for triangles.
- Enhanced `TestPydanticMesh` to support polygon structures and validate mesh properties.
- Added tests for custom mesh handling, ensuring proper serialization and optimization.
- Implemented automatic calculation of `markerSizes` and `markerOffsets` in `MeshUtils`.
- Introduced utility functions `inferSizesFromCellTypes` and `sizesToOffsets` for VTK cell type handling.
- Updated TypeScript README and tests to reflect new marker auto-calculation features.
For more detailed examples, see the Jupyter notebooks in the [examples](examples/) directory:
197
201
-[array_example.ipynb](examples/array_example.ipynb): Working with arrays, compression, and file I/O
198
202
-[mesh_example.ipynb](examples/mesh_example.ipynb): Working with Pydantic-based meshes, custom subclasses, and serialization
203
+
-[markers_example.ipynb](examples/markers_example.ipynb): Working with mesh markers, cell types, and boundary conditions for finite element analysis
199
204
200
205
## Custom Mesh Subclasses
201
206
@@ -256,7 +261,7 @@ Benefits of custom mesh subclasses:
256
261
257
262
## Enhanced Polygon Support
258
263
259
-
Meshly provides enhanced support for different polygon types and automatically infers polygon structure:
264
+
Meshly provides enhanced support for different polygon types and automatically infers polygon structure through the `index_sizes` field, with optional `cell_types` for VTK compatibility:
260
265
261
266
```python
262
267
# Triangular mesh (traditional format)
@@ -275,17 +280,227 @@ mixed_indices = [
275
280
[7, 8, 9, 10, 11] # Pentagon
276
281
]
277
282
278
-
# All formats are automatically handled
283
+
# All formats are automatically handled with automatic index_sizes inference
The [`cell_types`](python/meshly/mesh.py:129) field provides VTK-compatible cell type identifiers for each polygon, automatically inferred from `index_sizes`:
Meshly provides comprehensive support for mesh markers, which are essential for defining boundary conditions, material regions, and other geometric features in computational meshes:
0 commit comments