AMCAX Kernel
Geometry kernel for CAD/CAE/CAM
AMCAX Kernel 1.0.0.0
Loading...
Searching...
No Matches
Mesh Generation

Geometry Import

Support import files STEP and AMCAX::TopoShape. AMCAX::NextMesh::NMAPIModel::ImportModel provide import functionality.

//step
const std::string cadstr ="./data/1.step";
nmapi.ImportModel(cadstr);
// Toposhape
std::string cadstr2 = ".data/1.brep";
AMCAX::TopoExplorer ex(s, AMCAX::ShapeType::Face);
AMCAX::TopoFace f1 = static_cast<const AMCAX::TopoFace&>(ex.Value());
std::vector<AMCAX::NextMesh::NMShape> shapes;
shapes.push_back(f1);
nmapi.ImportModel(shapes);
Class of model in NextMesh.
Definition NMAPIModel.hpp:22
AMCAX_API void ImportModel(const std::string &filePath, const bool replace=true)
Load a cad file, only support step currently. Note: this import method does not specify any entity ta...
static AMCAX_API bool Read(TopoShape &s, std::istream &is)
Read a shape from a stream.
Class of a tool for exploring the B-Rep structure.
Definition TopoExplorer.hpp:14
Class of face.
Definition TopoFace.hpp:12
Base class of shape, containing an underlying shape with a location and an orientation.
Definition TopoShape.hpp:15

Mesh File Export

Support file formats for export include OBJ, VTK, FLUENT_MSH.AMCAX::NextMesh::NMMesh::Write provide the functionality to export files.

meshapi.Write("s.vtk", AMCAX::NextMesh::OutFileType::VTK);
meshapi.Write("s.obj", AMCAX::NextMesh::OutFileType::OBJ);
meshapi.Write("s.msh", AMCAX::NextMesh::OutFileType::FLUENT_MSH);

Mesh Generation Control

The mesh size is controlled by setting the following generation parameters: the dimension of the entities to be profiled MeshingDim (1-3); the maximum and minimum size of the mesh cells MaxSize/MinSize (absolute dimensions); the growth rate of the mesh GrowthRate (>=1.0); the sequence of TaggedEntities to be profiled SelectedEntities (null means all entities under the specified dimension); the curvature of the mesh. SelectedEntities (null for all entities in the specified dimension); CurvatureFactor (0.0-1.0); ThreadNum.

Entity dimensions to be dissected (MeshingDim)

This parameter defines the dimension of the entity to be subdivided, indicating the dimension on which the mesh division operation is performed.Valid values are 1, 2, 3. 1 represents a line subdivision, 2 represents a face subdivision, and 3 represents a volume subdivision.

Maximum and minimum mesh cell size (MaxSize/MinSize)

This parameter defines the maximum and minimum size of mesh cells. MaxSize is the maximum size of a mesh cell, and MinSize is the minimum size. These sizes control the fineness of the mesh. Both MaxSize and MinSize are absolute size values, influencing the resolution of the mesh. The maximum size controls the longest length of a mesh cell, while the minimum size limits the smallest mesh cell size.

Mesh GrowthRate

This parameter defines the rate at which mesh cell sizes increase, i.e., the proportion by which the size changes from one mesh cell to the next. It is important to note that this parameter must be greater than or equal to 1.0. For example, if the growth rate is 1.2, it means the mesh size will increase by 20%.

SelectedEntities Tag Sequence:

This parameter specifies the entities to be meshed. Entities can be certain geometries, faces, edges, or points of the model. If empty, it means meshing is applied to all entities. If a sequence of entity tags is specified, meshing will only apply to those particular entities.

CurvatureFactor

This parameter controls the mesh cell accuracy in areas with curvature. Areas with higher curvature can generate finer mesh cells. The range is from 0.0 to 1.0:0.0 means curvature is not considered, and the mesh cell size remains fixed.1.0 means the mesh is fully generated based on curvature, with smaller mesh cells in areas of higher curvature.

Parallel threads (ThreadNum)

This parameter defines the number of parallel threads used during meshing. Increasing the thread count can accelerate the meshing process, especially for large-scale models. The number of threads typically depends on the number of CPU cores in the computer. It can be set to 1 for single-threaded meshing, or set to a higher value to improve parallelism.

Mesh Generation Type

Mesh generation type include wire mesh, triangle, and tetrahedron.
To be down.

Auxiliary Tool

Auxiliary tools include contact face determination and face group definition.
To be down.