Skip to content
Snippets Groups Projects
Commit 6f9ca772 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

niiicer

parent 08994217
No related branches found
No related tags found
No related merge requests found
...@@ -180,22 +180,26 @@ GMSH_API gmshModelOccBooleanUnion(int tag, const vector_pair &objectDimTags, ...@@ -180,22 +180,26 @@ GMSH_API gmshModelOccBooleanUnion(int tag, const vector_pair &objectDimTags,
const vector_pair &toolDimTags, const vector_pair &toolDimTags,
vector_pair &outDimTags, vector_pair &outDimTags,
std::vector<vector_pair > &outDimTagsMap, std::vector<vector_pair > &outDimTagsMap,
bool removeObject, bool removeTool); bool removeObject = true,
bool removeTool = true);
GMSH_API gmshModelOccBooleanIntersection(int tag, const vector_pair &objectDimTags, GMSH_API gmshModelOccBooleanIntersection(int tag, const vector_pair &objectDimTags,
const vector_pair &toolDimTags, const vector_pair &toolDimTags,
vector_pair &outDimTags, vector_pair &outDimTags,
std::vector<vector_pair > &outDimTagsMap, std::vector<vector_pair > &outDimTagsMap,
bool removeObject, bool removeTool); bool removeObject = true,
bool removeTool = true);
GMSH_API gmshModelOccBooleanDifference(int tag, const vector_pair &objectDimTags, GMSH_API gmshModelOccBooleanDifference(int tag, const vector_pair &objectDimTags,
const vector_pair &toolDimTags, const vector_pair &toolDimTags,
vector_pair &outDimTags, vector_pair &outDimTags,
std::vector<vector_pair > &outDimTagsMap, std::vector<vector_pair > &outDimTagsMap,
bool removeObject, bool removeTool); bool removeObject = true,
bool removeTool = true);
GMSH_API gmshModelOccBooleanFragments(int tag, const vector_pair &objectDimTags, GMSH_API gmshModelOccBooleanFragments(int tag, const vector_pair &objectDimTags,
const vector_pair &toolDimTags, const vector_pair &toolDimTags,
vector_pair &outDimTags, vector_pair &outDimTags,
std::vector<vector_pair> &outDimTagsMap, std::vector<vector_pair> &outDimTagsMap,
bool removeObject, bool removeTool); bool removeObject = true,
bool removeTool = true);
GMSH_API gmshModelOccSynchronize(); GMSH_API gmshModelOccSynchronize();
......
...@@ -17,31 +17,19 @@ int main(int argc, char **argv) ...@@ -17,31 +17,19 @@ int main(int argc, char **argv)
double R = 1.4, Rs = R*.7, Rt = R*1.25; double R = 1.4, Rs = R*.7, Rt = R*1.25;
std::vector<int> tag = {1,2,3,4,5,6,7,8}; std::vector<int> t = {1,2,3,4,5,6,7,8};
gmshModelOccAddBox(tag[0], -R,-R,-R, 2*R,2*R,2*R); gmshModelOccAddBox(t[0], -R,-R,-R, 2*R,2*R,2*R);
gmshModelOccAddSphere(tag[1], 0,0,0,Rt); gmshModelOccAddSphere(t[1], 0,0,0,Rt);
std::vector<std::pair<int, int> > obj, tool, out; std::vector<std::pair<int, int> > o;
std::vector<std::vector<std::pair<int, int> > > outMap; std::vector<std::vector<std::pair<int, int> > > om;
obj.push_back(std::pair<int, int>(3, 1)); gmshModelOccBooleanIntersection(t[2], {{3, t[0]}}, {{3, t[1]}}, o, om);
tool.push_back(std::pair<int, int>(3, 2)); gmshModelOccAddCylinder(t[3], -2*R,0,0, 4*R,0,0, Rs);
gmshModelOccBooleanIntersection(tag[2], obj, tool, out, outMap, true, true); gmshModelOccAddCylinder(t[4], 0,-2*R,0, 0,4*R,0, Rs);
gmshModelOccAddCylinder(t[5], 0,0,-2*R, 0,0,4*R, Rs);
gmshModelOccAddCylinder(tag[3], -2*R,0,0, 4*R,0,0, Rs); gmshModelOccBooleanUnion(t[6], {{3, t[3]}, {3, t[4]}}, {{3, t[5]}}, o, om);
gmshModelOccAddCylinder(tag[4], 0,-2*R,0, 0,4*R,0, Rs); gmshModelOccBooleanDifference(t[7], {{3, t[2]}}, {{3, t[6]}}, o, om);
gmshModelOccAddCylinder(tag[5], 0,0,-2*R, 0,0,4*R, Rs);
obj.clear(); tool.clear();
obj.push_back(std::pair<int, int>(3, 4));
tool.push_back(std::pair<int, int>(3, 5));
tool.push_back(std::pair<int, int>(3, 6));
gmshModelOccBooleanUnion(tag[6], obj, tool, out, outMap, true, true);
obj.clear(); tool.clear();
obj.push_back(std::pair<int, int>(3, 3));
tool.push_back(std::pair<int, int>(3, 7));
gmshModelOccBooleanDifference(tag[7], obj, tool, out, outMap, true, true);
gmshModelOccSynchronize(); gmshModelOccSynchronize();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment