AMCAX Kernel 1.0.0.0
|
Class of model in NextMesh. More...
#include <nextmesh/NMAPIModel.hpp>
Public Member Functions | |
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 tags, which will be generated internally. The tag counts from 1 in each dimension. | |
AMCAX_API void | ImportModel (const std::vector< NMShape > &shapes, const bool replace=true) |
Load a cad model represented by AMCAX TopoShape. Note: this import method does not specify any entity tags, which will be generated internally. The tag counts from 1 in each dimension. | |
AMCAX_API void | ImportModel (const ShapeData &shape, const bool replace=true) |
Load a cad model with associated tags. Two principles: 1. The tags of different entities in the same dimension must be different; 2. All low dimensional entities contained within high-dimensional entities must be tagged. | |
AMCAX_API void | GenerateMesh (const std::string &configJson) |
Generates the mesh for the current model based on provided configuration parameters. | |
AMCAX_API void | DeleteMesh () |
Delete all the generated mesh. All the mesh handles are invalid after deleting mesh. | |
AMCAX_API NMMesh | GetMesh () |
Get the mesh handle. Note one model only holds a unique mesh. | |
AMCAX_API void | GetEntities (std::vector< NMEntity > &ents, const DimType dim) |
get all the entities in the specified dim | |
AMCAX_API Indext | GetEntityCount (const DimType dim=DimType::DAll) |
get the number of all entities in specified dim | |
AMCAX_API DimType | EntityGetDim (const NMEntity &ent) |
get the dimension of the given entity | |
AMCAX_API EntTag | EntityGetTag (const NMEntity &ent) |
get the tag of the given entity | |
AMCAX_API NMEntity | GetEntity (const DimType dim, const EntTag etag) |
get the entity handle by entity tag and dimension | |
AMCAX_API void | GetBBox (NMPoint3 &pmin, NMPoint3 &pmax, const NMEntity &ent=nullptr) |
get the boundingbox of the entity. when ent = nullptr, return the model bbox | |
AMCAX_API void | GetEntitiesInBBox (std::vector< NMEntity > &entities, const NMPoint3 &pmin, const NMPoint3 &pmax, const bool isStrict=false, const DimType dim=DimType::DAll) |
get the entities intersected with/enclosed by the given bbox | |
AMCAX_API void | GetParentAdjacentEntities (std::vector< NMEntity > &parents, const NMEntity &ent) |
get all the entities in dim+1 that contain the entity | |
AMCAX_API void | GetChildAdjacentEntities (std::vector< NMEntity > &children, std::vector< Orientation > &oris, const NMEntity &ent) |
get all the entities in dim-1 contained by the entity | |
AMCAX_API DimType | GetModelMaxDim () |
the maximum dimension of the model | |
AMCAX_API void | CreatePhysicalSet (const DimType dim, const std::vector< EntTag > &entTags, const std::string &pName) |
create a new physical set for the specified entities with specified dimension | |
AMCAX_API void | AddPhysicalSet (const DimType dim, const std::vector< EntTag > &entTags, const std::string &pName) |
incrementally add entities into the specified physical set | |
AMCAX_API void | RemovePhysicalSet (const DimType dim, const std::string &pName) |
remove the specified physical set | |
AMCAX_API void | GetEntitiesInPhysicalSet (std::vector< EntTag > &entTags, const DimType dim, const std::string &pName) |
get entities in the specified physical set | |
AMCAX_API void | GetPhysicalSets (std::set< std::string > &pNames, const DimType dim) |
get all the physical sets in the specified dim | |
AMCAX_API bool | IsFacePairContacted (const NMEntity &face1, const NMEntity &face2, const double tolDist, const double tolAng) |
determine whether two face entities are in contact | |
Static Public Member Functions | |
static AMCAX_API void | InitLogger (const std::string &logFileName="", const std::string &logPattern="[%Y-%m-%dT%X%z] [%l] %v", const int64_t logFileSize=20 *1024 *1024, const int maxLogFiles=100) |
set the logger. the logger is closed by default, if this function is not called | |
static AMCAX_API void | SetProgressBarCallBack (PBCallBackFunc *cb) |
set the progressbar callback function | |
Class of model in NextMesh.
AMCAX_API void AMCAX::NextMesh::NMAPIModel::AddPhysicalSet | ( | const DimType | dim, |
const std::vector< EntTag > & | entTags, | ||
const std::string & | pName ) |
incrementally add entities into the specified physical set
dim | dimension |
entTags | entity tags |
pName | physicalset name |
AMCAX_API void AMCAX::NextMesh::NMAPIModel::CreatePhysicalSet | ( | const DimType | dim, |
const std::vector< EntTag > & | entTags, | ||
const std::string & | pName ) |
create a new physical set for the specified entities with specified dimension
dim | dimension |
entTags | entity tags |
pName | physicalset name |
get the dimension of the given entity
ent | entity |
AMCAX_API EntTag AMCAX::NextMesh::NMAPIModel::EntityGetTag | ( | const NMEntity & | ent | ) |
get the tag of the given entity
ent | entity |
AMCAX_API void AMCAX::NextMesh::NMAPIModel::GenerateMesh | ( | const std::string & | configJson | ) |
Generates the mesh for the current model based on provided configuration parameters.
configJson | A JSON-formatted string containing the control parameters for mesh generation |
AMCAX_API void AMCAX::NextMesh::NMAPIModel::GetBBox | ( | NMPoint3 & | pmin, |
NMPoint3 & | pmax, | ||
const NMEntity & | ent = nullptr ) |
get the boundingbox of the entity. when ent = nullptr, return the model bbox
pmin | min point of the boundingbox |
pmax | max point of the boundingbox |
ent | entity |
AMCAX_API void AMCAX::NextMesh::NMAPIModel::GetChildAdjacentEntities | ( | std::vector< NMEntity > & | children, |
std::vector< Orientation > & | oris, | ||
const NMEntity & | ent ) |
get all the entities in dim-1 contained by the entity
children | all the entities in dim-1 contained by the entity |
oris | the orientations of all the children |
ent | current entity |
AMCAX_API void AMCAX::NextMesh::NMAPIModel::GetEntities | ( | std::vector< NMEntity > & | ents, |
const DimType | dim ) |
get all the entities in the specified dim
ents | the obtained entities |
dim | dim =0 vertex; dim=1 edge; dim=2 face; dim=3 solid; |
AMCAX_API void AMCAX::NextMesh::NMAPIModel::GetEntitiesInBBox | ( | std::vector< NMEntity > & | entities, |
const NMPoint3 & | pmin, | ||
const NMPoint3 & | pmax, | ||
const bool | isStrict = false, | ||
const DimType | dim = DimType::DAll ) |
get the entities intersected with/enclosed by the given bbox
entities | the obtained entities |
pmin | min point of the boundingbox |
pmax | max point of the boundingbox |
isStrict | if true, enclosed; otherwise, intersected. |
dim | only consider the entity in given dim, if dim = -1,take all the shapes into account. |
AMCAX_API void AMCAX::NextMesh::NMAPIModel::GetEntitiesInPhysicalSet | ( | std::vector< EntTag > & | entTags, |
const DimType | dim, | ||
const std::string & | pName ) |
get entities in the specified physical set
entTags | entity tags |
dim | dimension |
pName | physicalset name |
get the entity handle by entity tag and dimension
dim | dimension |
etag | entity tag |
get the number of all entities in specified dim
dim | dim =0 vertex; dim=1 edge; dim=2 face; dim=3 solid; dim=-1 all shapes; |
Get the mesh handle. Note one model only holds a unique mesh.
the maximum dimension of the model
AMCAX_API void AMCAX::NextMesh::NMAPIModel::GetParentAdjacentEntities | ( | std::vector< NMEntity > & | parents, |
const NMEntity & | ent ) |
get all the entities in dim+1 that contain the entity
parents | all the entities in dim+1 that contain the entity |
ent | current entity |
AMCAX_API void AMCAX::NextMesh::NMAPIModel::GetPhysicalSets | ( | std::set< std::string > & | pNames, |
const DimType | dim ) |
get all the physical sets in the specified dim
pNames | the physical set names |
dim | dimension |
AMCAX_API void AMCAX::NextMesh::NMAPIModel::ImportModel | ( | const ShapeData & | shape, |
const bool | replace = true ) |
Load a cad model with associated tags. Two principles: 1. The tags of different entities in the same dimension must be different; 2. All low dimensional entities contained within high-dimensional entities must be tagged.
shape | The CAD shape, considered from a decomposition perspective. |
replace | A flag indicating whether to replace the existing model. If set to true, the existing model is replaced; if false, the shapes are merged with the existing model. In either case, the two principles must be strictly followed. |
AMCAX_API void AMCAX::NextMesh::NMAPIModel::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 tags, which will be generated internally. The tag counts from 1 in each dimension.
filePath | The cad file path to be imported |
replace | If true, the existing model is replaced; otherwise, the shapes are added to the existing model |
AMCAX_API void AMCAX::NextMesh::NMAPIModel::ImportModel | ( | const std::vector< NMShape > & | shapes, |
const bool | replace = true ) |
Load a cad model represented by AMCAX TopoShape. Note: this import method does not specify any entity tags, which will be generated internally. The tag counts from 1 in each dimension.
shapes | The shapes generated by AMCAX-Kernel |
replace | If true, the existing model is replaced; otherwise, the shapes are added to the existing model |
|
static |
set the logger. the logger is closed by default, if this function is not called
logFileName | if set, then output log to the file |
logPattern | log pattern |
logFileSize | the maximum size of a single file |
maxLogFiles | the maximum number of files to keep |
AMCAX_API bool AMCAX::NextMesh::NMAPIModel::IsFacePairContacted | ( | const NMEntity & | face1, |
const NMEntity & | face2, | ||
const double | tolDist, | ||
const double | tolAng ) |
determine whether two face entities are in contact
face1 | face-entity-1 |
face2 | face-entity-2 |
tolDist | distance tolerance between two faces |
tolAng | angle tolerances between the normals of two faces |
AMCAX_API void AMCAX::NextMesh::NMAPIModel::RemovePhysicalSet | ( | const DimType | dim, |
const std::string & | pName ) |
remove the specified physical set
dim | dimension |
pName | physicalset name |
|
static |
set the progressbar callback function
cb | callback function |