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

simpler code for plane surfaces

parent 4c019cf6
Branches
Tags
No related merge requests found
...@@ -1110,19 +1110,11 @@ bool OCC_Internals::addPlaneSurface(int &tag, const std::vector<int> &wireTags) ...@@ -1110,19 +1110,11 @@ bool OCC_Internals::addPlaneSurface(int &tag, const std::vector<int> &wireTags)
Msg::Error("Plane surface requires at least one line loop"); Msg::Error("Plane surface requires at least one line loop");
return false; return false;
} }
else if(wires.size() == 1){
BRepBuilderAPI_MakeFace f(wires[0]);
f.Build();
if(!f.IsDone()){
Msg::Error("Could not create face");
return false;
}
result = f.Face();
}
else{
try{ try{
BRepBuilderAPI_MakeFace f(wires[0]); BRepBuilderAPI_MakeFace f(wires[0]);
for(unsigned int i = 1; i < wires.size(); i++){ for(unsigned int i = 1; i < wires.size(); i++){
// holes
TopoDS_Wire w = wires[i]; TopoDS_Wire w = wires[i];
w.Orientation(TopAbs_REVERSED); w.Orientation(TopAbs_REVERSED);
f.Add(w); f.Add(w);
...@@ -1144,7 +1136,7 @@ bool OCC_Internals::addPlaneSurface(int &tag, const std::vector<int> &wireTags) ...@@ -1144,7 +1136,7 @@ bool OCC_Internals::addPlaneSurface(int &tag, const std::vector<int> &wireTags)
Msg::Error("OpenCASCADE exception %s", err.GetMessageString()); Msg::Error("OpenCASCADE exception %s", err.GetMessageString());
return false; return false;
} }
}
if(tag < 0) tag = getMaxTag(2) + 1; if(tag < 0) tag = getMaxTag(2) + 1;
bind(result, tag, true); bind(result, tag, true);
return true; return true;
...@@ -1174,9 +1166,7 @@ bool OCC_Internals::addSurfaceFilling(int &tag, int wireTag) ...@@ -1174,9 +1166,7 @@ bool OCC_Internals::addSurfaceFilling(int &tag, int wireTag)
if(_edgeTag.IsBound(edge)) if(_edgeTag.IsBound(edge))
unbind(edge, _edgeTag.Find(edge), true); unbind(edge, _edgeTag.Find(edge), true);
} }
// TODO: add optional point constraints using // TODO: add optional point constraints using f.Add(gp_Pnt(x, y, z);
// f.Add(gp_Pnt(x, y, z);
f.Build(); f.Build();
if(!f.IsDone()){ if(!f.IsDone()){
Msg::Error("Could not build surface filling"); Msg::Error("Could not build surface filling");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment