Commit 772047b7 by Christophe Geuzaine

rename boolean* api to use verbs + add missing docs

parent bad753f7
Pipeline #936 passed with stage
in 41 minutes 19 seconds
......@@ -1741,13 +1741,13 @@ void gmsh::model::occ::fillet(const std::vector<int> &regionTags,
}
}
void gmsh::model::occ::booleanUnion(const vector_pair &objectDimTags,
const vector_pair &toolDimTags,
vector_pair &outDimTags,
std::vector<vector_pair > &outDimTagsMap,
const int tag,
const bool removeObject,
const bool removeTool)
void gmsh::model::occ::fuse(const vector_pair &objectDimTags,
const vector_pair &toolDimTags,
vector_pair &outDimTags,
std::vector<vector_pair > &outDimTagsMap,
const int tag,
const bool removeObject,
const bool removeTool)
{
if(!_isInitialized()){ throw -1; }
_createOcc();
......@@ -1760,13 +1760,13 @@ void gmsh::model::occ::booleanUnion(const vector_pair &objectDimTags,
}
}
void gmsh::model::occ::booleanIntersection(const vector_pair &objectDimTags,
const vector_pair &toolDimTags,
vector_pair &outDimTags,
std::vector<vector_pair> &outDimTagsMap,
const int tag,
const bool removeObject,
const bool removeTool)
void gmsh::model::occ::intersect(const vector_pair &objectDimTags,
const vector_pair &toolDimTags,
vector_pair &outDimTags,
std::vector<vector_pair> &outDimTagsMap,
const int tag,
const bool removeObject,
const bool removeTool)
{
if(!_isInitialized()){ throw -1; }
_createOcc();
......@@ -1779,13 +1779,13 @@ void gmsh::model::occ::booleanIntersection(const vector_pair &objectDimTags,
}
}
void gmsh::model::occ::booleanDifference(const vector_pair &objectDimTags,
const vector_pair &toolDimTags,
vector_pair &outDimTags,
std::vector<vector_pair> &outDimTagsMap,
const int tag,
const bool removeObject,
const bool removeTool)
void gmsh::model::occ::cut(const vector_pair &objectDimTags,
const vector_pair &toolDimTags,
vector_pair &outDimTags,
std::vector<vector_pair> &outDimTagsMap,
const int tag,
const bool removeObject,
const bool removeTool)
{
if(!_isInitialized()){ throw -1; }
_createOcc();
......@@ -1798,13 +1798,13 @@ void gmsh::model::occ::booleanDifference(const vector_pair &objectDimTags,
}
}
void gmsh::model::occ::booleanFragments(const vector_pair &objectDimTags,
const vector_pair &toolDimTags,
vector_pair &outDimTags,
std::vector<vector_pair> &outDimTagsMap,
const int tag,
const bool removeObject,
const bool removeTool)
void gmsh::model::occ::fragment(const vector_pair &objectDimTags,
const vector_pair &toolDimTags,
vector_pair &outDimTags,
std::vector<vector_pair> &outDimTagsMap,
const int tag,
const bool removeObject,
const bool removeTool)
{
if(!_isInitialized()){ throw -1; }
_createOcc();
......
......@@ -962,45 +962,45 @@ void gmshModelOccFillet(int* regionTags, size_t regionTags_n,int* edgeTags, size
} catch(int api_ierr_) {if (ierr) *ierr = api_ierr_;}
}
void gmshModelOccBooleanUnion(int * objectDimTags, size_t objectDimTags_n,int * toolDimTags, size_t toolDimTags_n,int ** outDimTags, size_t * outDimTags_n,int *** outDimTagsMap, size_t ** outDimTagsMap_n, size_t *outDimTagsMap_nn,const int tag,const int removeObject,const int removeTool,int * ierr){
void gmshModelOccFuse(int * objectDimTags, size_t objectDimTags_n,int * toolDimTags, size_t toolDimTags_n,int ** outDimTags, size_t * outDimTags_n,int *** outDimTagsMap, size_t ** outDimTagsMap_n, size_t *outDimTagsMap_nn,const int tag,const int removeObject,const int removeTool,int * ierr){
if(ierr) *ierr = 0;
try {
gmsh::vector_pair api_outDimTags_;
std::vector<gmsh::vector_pair >api_outDimTagsMap_;
gmsh::model::occ::booleanUnion(intptr2pairvector(objectDimTags,objectDimTags_n),intptr2pairvector(toolDimTags,toolDimTags_n),api_outDimTags_,api_outDimTagsMap_,tag,removeObject,removeTool);
gmsh::model::occ::fuse(intptr2pairvector(objectDimTags,objectDimTags_n),intptr2pairvector(toolDimTags,toolDimTags_n),api_outDimTags_,api_outDimTagsMap_,tag,removeObject,removeTool);
pairvector2intptr(api_outDimTags_,outDimTags,outDimTags_n);
pairvectorvector2intptrptr(api_outDimTagsMap_,outDimTagsMap,outDimTagsMap_n,outDimTagsMap_nn);
} catch(int api_ierr_) {if (ierr) *ierr = api_ierr_;}
}
void gmshModelOccBooleanIntersection(int * objectDimTags, size_t objectDimTags_n,int * toolDimTags, size_t toolDimTags_n,int ** outDimTags, size_t * outDimTags_n,int *** outDimTagsMap, size_t ** outDimTagsMap_n, size_t *outDimTagsMap_nn,const int tag,const int removeObject,const int removeTool,int * ierr){
void gmshModelOccIntersect(int * objectDimTags, size_t objectDimTags_n,int * toolDimTags, size_t toolDimTags_n,int ** outDimTags, size_t * outDimTags_n,int *** outDimTagsMap, size_t ** outDimTagsMap_n, size_t *outDimTagsMap_nn,const int tag,const int removeObject,const int removeTool,int * ierr){
if(ierr) *ierr = 0;
try {
gmsh::vector_pair api_outDimTags_;
std::vector<gmsh::vector_pair >api_outDimTagsMap_;
gmsh::model::occ::booleanIntersection(intptr2pairvector(objectDimTags,objectDimTags_n),intptr2pairvector(toolDimTags,toolDimTags_n),api_outDimTags_,api_outDimTagsMap_,tag,removeObject,removeTool);
gmsh::model::occ::intersect(intptr2pairvector(objectDimTags,objectDimTags_n),intptr2pairvector(toolDimTags,toolDimTags_n),api_outDimTags_,api_outDimTagsMap_,tag,removeObject,removeTool);
pairvector2intptr(api_outDimTags_,outDimTags,outDimTags_n);
pairvectorvector2intptrptr(api_outDimTagsMap_,outDimTagsMap,outDimTagsMap_n,outDimTagsMap_nn);
} catch(int api_ierr_) {if (ierr) *ierr = api_ierr_;}
}
void gmshModelOccBooleanDifference(int * objectDimTags, size_t objectDimTags_n,int * toolDimTags, size_t toolDimTags_n,int ** outDimTags, size_t * outDimTags_n,int *** outDimTagsMap, size_t ** outDimTagsMap_n, size_t *outDimTagsMap_nn,const int tag,const int removeObject,const int removeTool,int * ierr){
void gmshModelOccCut(int * objectDimTags, size_t objectDimTags_n,int * toolDimTags, size_t toolDimTags_n,int ** outDimTags, size_t * outDimTags_n,int *** outDimTagsMap, size_t ** outDimTagsMap_n, size_t *outDimTagsMap_nn,const int tag,const int removeObject,const int removeTool,int * ierr){
if(ierr) *ierr = 0;
try {
gmsh::vector_pair api_outDimTags_;
std::vector<gmsh::vector_pair >api_outDimTagsMap_;
gmsh::model::occ::booleanDifference(intptr2pairvector(objectDimTags,objectDimTags_n),intptr2pairvector(toolDimTags,toolDimTags_n),api_outDimTags_,api_outDimTagsMap_,tag,removeObject,removeTool);
gmsh::model::occ::cut(intptr2pairvector(objectDimTags,objectDimTags_n),intptr2pairvector(toolDimTags,toolDimTags_n),api_outDimTags_,api_outDimTagsMap_,tag,removeObject,removeTool);
pairvector2intptr(api_outDimTags_,outDimTags,outDimTags_n);
pairvectorvector2intptrptr(api_outDimTagsMap_,outDimTagsMap,outDimTagsMap_n,outDimTagsMap_nn);
} catch(int api_ierr_) {if (ierr) *ierr = api_ierr_;}
}
void gmshModelOccBooleanFragments(int * objectDimTags, size_t objectDimTags_n,int * toolDimTags, size_t toolDimTags_n,int ** outDimTags, size_t * outDimTags_n,int *** outDimTagsMap, size_t ** outDimTagsMap_n, size_t *outDimTagsMap_nn,const int tag,const int removeObject,const int removeTool,int * ierr){
void gmshModelOccFragment(int * objectDimTags, size_t objectDimTags_n,int * toolDimTags, size_t toolDimTags_n,int ** outDimTags, size_t * outDimTags_n,int *** outDimTagsMap, size_t ** outDimTagsMap_n, size_t *outDimTagsMap_nn,const int tag,const int removeObject,const int removeTool,int * ierr){
if(ierr) *ierr = 0;
try {
gmsh::vector_pair api_outDimTags_;
std::vector<gmsh::vector_pair >api_outDimTagsMap_;
gmsh::model::occ::booleanFragments(intptr2pairvector(objectDimTags,objectDimTags_n),intptr2pairvector(toolDimTags,toolDimTags_n),api_outDimTags_,api_outDimTagsMap_,tag,removeObject,removeTool);
gmsh::model::occ::fragment(intptr2pairvector(objectDimTags,objectDimTags_n),intptr2pairvector(toolDimTags,toolDimTags_n),api_outDimTags_,api_outDimTagsMap_,tag,removeObject,removeTool);
pairvector2intptr(api_outDimTags_,outDimTags,outDimTags_n);
pairvectorvector2intptrptr(api_outDimTagsMap_,outDimTagsMap,outDimTagsMap_n,outDimTagsMap_nn);
} catch(int api_ierr_) {if (ierr) *ierr = api_ierr_;}
......
......@@ -21,12 +21,12 @@ int main(int argc, char **argv)
std::vector<std::vector<std::pair<int, int> > > ovv;
gmsh::model::occ::addBox(-R,-R,-R, 2*R,2*R,2*R, 1);
gmsh::model::occ::addSphere(0,0,0,Rt, 2);
gmsh::model::occ::booleanIntersection({{3, 1}}, {{3, 2}}, ov, ovv, 3);
gmsh::model::occ::intersect({{3, 1}}, {{3, 2}}, ov, ovv, 3);
gmsh::model::occ::addCylinder(-2*R,0,0, 4*R,0,0, Rs, 4);
gmsh::model::occ::addCylinder(0,-2*R,0, 0,4*R,0, Rs, 5);
gmsh::model::occ::addCylinder(0,0,-2*R, 0,0,4*R, Rs, 6);
gmsh::model::occ::booleanUnion({{3, 4}, {3, 5}}, {{3, 6}}, ov, ovv, 7);
gmsh::model::occ::booleanDifference({{3, 3}}, {{3, 7}}, ov, ovv, 8);
gmsh::model::occ::fuse({{3, 4}, {3, 5}}, {{3, 6}}, ov, ovv, 7);
gmsh::model::occ::cut({{3, 3}}, {{3, 7}}, ov, ovv, 8);
gmsh::model::occ::synchronize();
......
......@@ -22,12 +22,12 @@ R = 1.4; Rs = R*.7; Rt = R*1.25
factory.addBox(-R,-R,-R, 2*R,2*R,2*R, 1)
factory.addSphere(0,0,0,Rt, 2)
factory.booleanIntersection([(3, 1)], [(3, 2)], 3)
factory.intersect([(3, 1)], [(3, 2)], 3)
factory.addCylinder(-2*R,0,0, 4*R,0,0, Rs, 4)
factory.addCylinder(0,-2*R,0, 0,4*R,0, Rs, 5)
factory.addCylinder(0,0,-2*R, 0,0,4*R, Rs, 6)
factory.booleanUnion([(3, 4), (3, 5)], [(3, 6)], 7)
factory.booleanDifference([(3, 3)], [(3, 7)], 8)
factory.fuse([(3, 4), (3, 5)], [(3, 6)], 7)
factory.cut([(3, 3)], [(3, 7)], 8)
factory.synchronize();
......
......@@ -16,7 +16,7 @@ int main(int argc, char **argv)
std::vector<std::vector<std::pair<int, int> > > ovv;
factory::addBox(0,0,0, 1,1,1, 1);
factory::addBox(0,0,0, 0.5,0.5,0.5, 2);
factory::booleanDifference({{3,1}}, {{3,2}}, ov, ovv, 3);
factory::cut({{3,1}}, {{3,2}}, ov, ovv, 3);
double x = 0, y = 0.75, z = 0, r = 0.09 ;
std::vector<std::pair<int, int> > holes;
for(int t = 1; t <= 5; t++){
......@@ -25,7 +25,7 @@ int main(int argc, char **argv)
factory::addSphere(x,y,z,r, 3 + t);
holes.push_back({3, 3 + t});
}
factory::booleanFragments({{3,3}}, holes, ov, ovv);
factory::fragment({{3,3}}, holes, ov, ovv);
factory::synchronize();
......
......@@ -13,7 +13,7 @@ model.add("t16")
factory.addBox(0,0,0, 1,1,1, 1)
factory.addBox(0,0,0, 0.5,0.5,0.5, 2)
factory.booleanDifference([(3,1)], [(3,2)], 3)
factory.cut([(3,1)], [(3,2)], 3)
x = 0; y = 0.75; z = 0; r = 0.09
......@@ -24,7 +24,7 @@ for t in range(1, 6):
factory.addSphere(x,y,z,r, 3 + t)
holes.append((3, 3 + t))
ov, ovv = factory.booleanFragments([(3,3)], holes)
ov, ovv = factory.fragment([(3,3)], holes)
factory.synchronize()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment