DeepSDFStruct.mesh#
Functions
|
|
|
export a mesh and adds corresponding boundary conditions |
|
|
|
|
|
export a mesh and adds corresponding boundary conditions |
|
|
|
|
|
|
|
Remove nearly collinear points from a polyline (closed loop). |
|
Convert an SDF array to a PSLG dict for triangle.triangulate. |
|
Classes
|
|
|
- DeepSDFStruct.mesh.create_3D_mesh(sdf, N_base, mesh_type, differentiate=False, device='cpu')#
- Return type:
Tuple
[Union
[torchSurfMesh
,torchVolumeMesh
],Optional
[Tensor
]]- Parameters:
mesh_type (str)
- DeepSDFStruct.mesh.export_abaqus_surf_mesh(surf_mesh, filename)#
export a mesh and adds corresponding boundary conditions
- Parameters:
surf_mesh (gustaf.faces.Faces)
filename (str)
- DeepSDFStruct.mesh.export_sdf_grid_vtk(sdf, filename, N=64, bounds=None, device='cpu')#
- Parameters:
- DeepSDFStruct.mesh.export_surface_mesh(filename, mesh, dSurf=None)#
- Parameters:
filename (str | bytes | os.PathLike[str] | os.PathLike[bytes])
mesh (gustaf.faces.Faces | DeepSDFStruct.mesh.torchSurfMesh)
- DeepSDFStruct.mesh.export_volume_mesh(volume_mesh, filename, export_abaqus=False)#
export a mesh and adds corresponding boundary conditions
- Parameters:
volume_mesh (gustaf.volumes.Volumes)
filename (str)
- DeepSDFStruct.mesh.generate_2D_surf_mesh(sdf, n_squares, n_elements=50000, bounds=None)#
- Parameters:
n_squares (int)
n_elements (int)
- DeepSDFStruct.mesh.get_verts(sdf, samples, constructor, cube_idx, N, return_faces=False, output_tetmesh=False)#
- Parameters:
samples (torch.Tensor)
constructor (DeepSDFStruct.flexicubes.flexicubes.FlexiCubes)
cube_idx (torch.Tensor)
- DeepSDFStruct.mesh.process_N_base_input(N, tiling)#
- DeepSDFStruct.mesh.prune_collinear(points, tol=1e-09)#
Remove nearly collinear points from a polyline (closed loop). :type points: :param points: Nx2 array of (x,y) vertices. :type points: ndarray :type tol: :param tol: area tolerance. Smaller = stricter (keep more points). :type tol: float
- Returns:
pruned Nx2 array of vertices.
- Return type:
ndarray
- DeepSDFStruct.mesh.sdf_to_triangle_dict(x, y, sdf, level=0.0, pad_value=1.0, collinear_tol=1e-08)#
Convert an SDF array to a PSLG dict for triangle.triangulate. Includes domain boundary and hole polygons.
- Parameters:
sdf (np.ndarray) – 2D signed distance field.
level (float) – Contour level (usually 0 for boundary).
pad_value (float) – Value outside domain to close boundaries.
- Returns:
{“vertices”: …, “segments”: …, “holes”: …}
- Return type:
dict
- DeepSDFStruct.mesh.tetrahedralize_surface(surface_mesh)#
- Return type:
tuple
[Volumes
,ndarray
]- Parameters:
surface_mesh (gustaf.faces.Faces)