Method BRep_Tool::IsClosed() extended to analyze closure of wires in addition to shells and solids.
External and Internal edges and vertices are ignored in this check.
Analysis of compounds is disabled.
Update of flag Closed according to actual state is added in most places where new shells are constructed.
Draw-command and test case for issue CR25202
// iterate on sub-shapes
BRep_Builder aBBuilder;
TopoDS_Shape aShapeCopy = theSubshapeToParse.EmptyCopied();
+ aShapeCopy.Closed (theSubshapeToParse.Closed());
Standard_Boolean isSubOverride = Standard_False;
Standard_Integer nbDef = 0;
for (TopoDS_Iterator it (theSubshapeToParse); it.More(); it.Next())
}
}
}
+ aShell.Closed (BRep_Tool::IsClosed (aShell));
myLoopsInternal.Append(aShell);
}
}
}
}
}
+ aShell.Closed (BRep_Tool::IsClosed (aShell));
theShells.Append(aShell);
}
}
} //for (; aIt2.More(); aIt2.Next()) {
//
if (iFlag) {
+ aShD.Closed (BRep_Tool::IsClosed (aShD));
aBB.Add(theDraftSolid, aShD);
}
} //for (; aIt1.More(); aIt1.Next()) {
#include <BOPTools_AlgoTools.hxx>
#include <BOPTools_CoupleOfShape.hxx>
-//
-static
- Standard_Boolean IsClosedShell(const TopoDS_Shell& );
//
static
void MakeShell(const BOPCol_ListOfShape& ,
} // for (; aExp.More(); aExp.Next()) {
} // for (; aItS.More(); aItS.Next()) {
//
- if (IsClosedShell(aShell)) {
+ if (BRep_Tool::IsClosed(aShell)) {
+ aShell.Closed (Standard_True);
myLoops.Append(aShell);
}
else {
RefineShell(aShell);
- if (IsClosedShell(aShell)) {
+ if (BRep_Tool::IsClosed(aShell)) {
+ aShell.Closed (Standard_True);
myLoops.Append(aShell);
}
}
aBB.Remove(theShell, aFB);
}
}
-//=======================================================================
-//function : IsClosedShell
-//purpose :
-//=======================================================================
-Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell)
-{
- Standard_Integer i, aNbE;
- Standard_Boolean bRet;
- TopoDS_Iterator aIt;
- TopExp_Explorer aExp;
- BOPCol_MapOfShape aM;
- //
- bRet=Standard_False;
- //
- aIt.Initialize(theShell);
- for(i=0; aIt.More(); aIt.Next(), ++i) {
- const TopoDS_Shape& aF=aIt.Value();
- //
- aExp.Init(aF, TopAbs_EDGE);
- for (; aExp.More(); aExp.Next()) {
- const TopoDS_Edge& aE=(*(TopoDS_Edge*)(&aExp.Current()));
- if (BRep_Tool::Degenerated(aE)) {
- continue;
- }
- //
- if (aE.Orientation()==TopAbs_INTERNAL) {
- continue;
- }
- if (!aM.Add(aE)) {
- aM.Remove(aE);
- }
- }
- }
- //
- if(i) {
- aNbE=aM.Extent();
- if (!aNbE) {
- bRet=!bRet;
- }
- }
- return bRet;
-}
+
//=======================================================================
//function : MakeShells
//purpose :
//
const BOPCol_ListOfShape& aLF=aCB.Shapes();
MakeShell(aLF, aShell);
- aShell.TShape()->Closed(Standard_True);
+ aShell.Closed(Standard_True);
myShells.Append(aShell);
}
else {
const BOPCol_ListOfShape& aLS=aCB.Loops();
aIt.Initialize(aLS);
for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aShell=aIt.Value();
- aShell.TShape()->Closed(Standard_True);
+ TopoDS_Shape& aShell=aIt.ChangeValue();
+ aShell.Closed(Standard_True);
myShells.Append(aShell);
}
}
-----------------------------------------------------------
-----------------------------------------------------------
IsClosed (myclass; S : Shape from TopoDS) returns Boolean from Standard;
-
- ---Purpose: Returns <True> if S if flaged Closed, if S is a
- -- Solid,Shell or Compound returns <True> is S has no free boundaries.
-
+ ---Purpose: If S is Solid or Shell, returns True if it has no free boundaries (edges).
+ -- If S is Wire, returns True if it has no free ends (vertices).
+ -- (Internal and External sub-shepes are ignored in this check.)
+ -- For other shape types returns S.Closed().
-----------------------------------------------------------
-----------------------------------------------------------
raises
NullObject from Standard;
-
-
end Tool;
#include <BRep_PolygonOnClosedTriangulation.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Iterator.hxx>
+#include <TopoDS_Wire.hxx>
#include <TopExp_Explorer.hxx>
#include <TopExp.hxx>
#include <TopTools_MapOfShape.hxx>
#include <Poly_Polygon2D.hxx>
#include <Poly_PolygonOnTriangulation.hxx>
+#include <NCollection_Map.hxx>
+#include <NCollection_IncAllocator.hxx>
+#include <TopTools_ShapeMapHasher.hxx>
+
//modified by NIZNHY-PKV Fri Oct 17 14:13:29 2008f
static
Standard_Boolean IsPlane(const Handle(Geom_Surface)& aS);
}
//=======================================================================
//function : IsClosed
-//purpose : Returns <True> if S if flaged Closed, if S is a
-// Solid,Shell or Compound returns <True> is S has no free boundaries.
+//purpose :
//=======================================================================
-Standard_Boolean BRep_Tool::IsClosed(const TopoDS_Shape& S)
+Standard_Boolean BRep_Tool::IsClosed (const TopoDS_Shape& theShape)
{
- if (S.ShapeType() == TopAbs_SHELL || S.ShapeType() == TopAbs_SOLID ||
- S.ShapeType() == TopAbs_COMPOUND) {
- TopTools_MapOfShape M;
- TopExp_Explorer exp;
- for (exp.Init(S,TopAbs_EDGE); exp.More(); exp.Next()) {
-// for (TopExp_Explorer exp(S,TopAbs_EDGE); exp.More(); exp.Next()) {
+ if (theShape.ShapeType() == TopAbs_SHELL || theShape.ShapeType() == TopAbs_SOLID)
+ {
+ NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> aMap (101, new NCollection_IncAllocator);
+ for (TopExp_Explorer exp (theShape, TopAbs_EDGE); exp.More(); exp.Next())
+ {
const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
- if (BRep_Tool::Degenerated(E)) continue;
- if (!M.Add(E)) M.Remove(E);
+ if (BRep_Tool::Degenerated(E) || E.Orientation() == TopAbs_INTERNAL || E.Orientation() == TopAbs_EXTERNAL)
+ continue;
+ if (!aMap.Add(E))
+ aMap.Remove(E);
}
- if ( M.IsEmpty()) return 1;
+ return aMap.IsEmpty();
}
- return (S.Closed());
+ else if (theShape.ShapeType() == TopAbs_WIRE)
+ {
+ NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> aMap (101, new NCollection_IncAllocator);
+ for (TopExp_Explorer exp (theShape, TopAbs_VERTEX); exp.More(); exp.Next())
+ {
+ const TopoDS_Shape& V = exp.Current();
+ if (V.Orientation() == TopAbs_INTERNAL || V.Orientation() == TopAbs_EXTERNAL)
+ continue;
+ if (!aMap.Add(V))
+ aMap.Remove(V);
+ }
+ return aMap.IsEmpty();
+ }
+ return theShape.Closed();
}
//modified by NIZNHY-PKV Fri Oct 17 14:09:58 2008 f
//
return bRet;
}
+
}
if (VF.IsSame(CV) && SamePnt2d(VF,EF,CE,myFace))
+ {
+ NW.Closed (Standard_True);
myNewWires.Append (NW);
+ }
#ifdef DEBUG_ALGO
else {
cout <<"BRepAlgo_Loop: Open Wire"<<endl;
}
}
if (!newCur) {
- theSets.Append(CurShell);
- CurShell.Nullify();
- newCur=Standard_True;
- BRB.MakeShell(CurShell);
+ CurShell.Closed (BRep_Tool::IsClosed (CurShell));
+ theSets.Append(CurShell);
+ CurShell.Nullify();
+ newCur=Standard_True;
+ BRB.MakeShell(CurShell);
}
}
if (theFaces.IsEmpty()) break;
if(Sliding) {
TopoDS_Face F;
BB.MakeFace(F, myPln, myTol);
+ w.Closed (BRep_Tool::IsClosed (w));
BB.Add(F, w);
// BRepLib_MakeFace F(myPln->Pln(),w, Standard_True);
mySkface = F;
for(; it.More(); it.Next()) {
BB.Add(comp, it.Value());
}
+ comp.Closed (BRep_Tool::IsClosed (comp));
mySUntil = comp;
if(Sliding) {
TopoDS_Face F;
BB.MakeFace(F, myPln, myTol);
+ w.Closed (BRep_Tool::IsClosed (w));
BB.Add(F, w);
mySkface = F;
myPbase = mySkface;
break;
}
}
+ Wiwiwi.Closed (BRep_Tool::IsClosed (Wiwiwi));
BRepLib_MakeFace newbndface(myPln->Pln(), Wiwiwi, Standard_True);
TopoDS_Face NewBndFace = TopoDS::Face(newbndface.Shape());
for(; it.More(); it.Next()) {
BB.Add(comp, it.Value());
}
+ comp.Closed (BRep_Tool::IsClosed (comp));
mySUntil = comp;
BB.Add(w, e);
}
+ w.Closed (BRep_Tool::IsClosed (w));
BRepLib_MakeFace fa(myPln->Pln(), w, Standard_True);
TopoDS_Face fac = TopoDS::Face(fa.Shape());
}
}
newwire.Orientation(TopAbs_FORWARD);
+ newwire.Closed (Standard_True);
}
static void CutEdge(const TopoDS_Edge& CurrentEdge,
B.Add(W,Edge4);
B.Add(W,Edge2.Reversed());
B.Add(W,Edge3);
+ W.Closed (Standard_True);
B.Add(Face,W);
B.Add(W,Edge4);
B.Add(W,Edge2.Reversed());
B.Add(W,Edge3);
+ W.Closed (Standard_True);
B.Add(Face,W);
B.SameRange(Edge4,Standard_False);
}
+ Shell.Closed (BRep_Tool::IsClosed (Shell));
BRepLib::SameParameter(Shell);
return Shell;
}
TopoDS_Shell S;
B.MakeShell(S);
B.Add(S, StopShape);
+ S.Closed (BRep_Tool::IsClosed (S));
B.MakeSolid(Sol2);
B.Add(Sol2, S); // shell => solid (for fusion)
break;
}
// create the new surface
- TopoDS_Shell shell;
TopoDS_Face face;
TopoDS_Wire W;
TopoDS_Edge edge1, edge2, edge3, edge4, couture;
- BRep_Builder B;
- B.MakeShell(shell);
-
TopoDS_Wire newW1, newW2;
BRep_Builder BW1, BW2;
BW1.MakeWire(newW1);
W.Closed(LastShape.Closed());
TheLast = W;
}
+ result.Closed (BRep_Tool::IsClosed (result));
break;
}
if ( !mySpine.Closed() && !TheFirst.IsNull()) {
B.Add(result, TheFirst.Reversed());
}
+ result.Closed (BRep_Tool::IsClosed (result));
break;
}
for(ii = myFaces->LowerRow(); ii <= myFaces->UpperRow(); ii++) {
aBB.Add(aShell, myFaces->Value(ii, jj));
}
+ aShell.Closed (BRep_Tool::IsClosed (aShell));
if(jj == myFaces->LowerCol()) {
myShape1 = aShell;
// codage des courbes 3d et regularites.
BRepLib::BuildCurves3d(myShape,tol);
BRepLib::EncodeRegularity(myShape);
+ myShape.Closed (BRep_Tool::IsClosed (myShape));
myError = BRepLib_ShellDone;
Done();
for(; aFaceIter.More(); aFaceIter.Next()) {
B.Add(aShell, aFaceIter.Key());
}
+ aShell.Closed (BRep_Tool::IsClosed (aShell));
B.Add(myShape,aShell);
if (HasFace(BRepPrim_ZMax))
myBuilder.AddShellFace(myShell,Face(BRepPrim_ZMax));
+ myShell.Closed (BRep_Tool::IsClosed (myShell));
myBuilder.CompleteShell(myShell);
ShellBuilt = Standard_True;
}
myBuilder.AddShellFace(myShell,EndFace());
}
+ myShell.Closed (BRep_Tool::IsClosed (myShell));
myBuilder.CompleteShell(myShell);
ShellBuilt = Standard_True;
}
SetContinuity(aGenS,aDirS);
}
if (aGenSType==TopAbs_FACE){
+ newShell.Closed (BRep_Tool::IsClosed (newShell));
TopoDS_Shape temp = SplitShell(newShell);
TopAbs_Orientation Or = DirectSolid(aGenS,aDirS);
Lt.Init(temp);
}
myBuiltShapes(iGenS,iDirS) = Standard_True;
}
+ myShapes(iGenS,iDirS).Closed (BRep_Tool::IsClosed (myShapes(iGenS,iDirS)));
return myShapes(iGenS,iDirS);
}
for (it.Initialize(lleft);it.More();it.Next()) {
B.Add(Sh,TopoDS::Face(it.Value()));
}
+ Sh.Closed (BRep_Tool::IsClosed (Sh));
thePFace.Init(S,Sh,F,V,fuse,Standard_True);
ToPrism = Sh;
}
B.Add(She,F);
}
}
+ She.Closed (BRep_Tool::IsClosed (She));
thePFace.Init(S,She,TopoDS_Face(),V,fuse,Standard_False);
ToPrism = She;
}
for (it.Initialize(lleft);it.More();it.Next()) {
B.Add(Sh,TopoDS::Face(it.Value()));
}
+ Sh.Closed (BRep_Tool::IsClosed (Sh));
theRFace.Init(S,Sh,F,theAxis,fuse,Standard_True);
ToRotate = Sh;
}
B.Add(She,F);
}
}
+ She.Closed (BRep_Tool::IsClosed (She));
theRFace.Init(S,She,TopoDS_Face(),theAxis,fuse,Standard_False);
ToRotate = She;
}
B.Add (S,newsh);
}
}
+
if ( (modif < 0 && buildmode < 2) || (modif == 0 && buildmode < 1) )
return C;
- else return S;
+ else
+ {
+ S.Closed (BRep_Tool::IsClosed (S));
+ return S;
+ }
}
if (st == TopAbs_SHELL) {
}
if ( (modif < 0 && buildmode < 2) || (modif == 0 && buildmode < 1) )
return C;
- else return S;
+ else
+ {
+ S.Closed (BRep_Tool::IsClosed (S));
+ return S;
+ }
}
cout<<"BRepTools_ReShape::Apply NOT YET IMPLEMENTED"<<endl;
return shape;
}
result.Orientation(orien);
+ result.Closed (BRep_Tool::IsClosed (result));
myStatus = locStatus;
Replace ( shape, result );
+
return result;
}
BRep_Builder B;
TopoDS_Shape NS = S.EmptyCopied();
- TopoDS_Iterator itr(S);
+ NS.Closed (S.Closed());
+ TopoDS_Iterator itr(S);
while (itr.More()) {
B.Add(NS,itr.Value().Reversed());
itr.Next();
B.Add(newSh,FaceRef);
Propagate(FaceRef,newSh,mapF,mapIf);
}
+ newSh.Closed (BRep_Tool::IsClosed (newSh));
if (!Manifold) {
lshell.Append(newSh.Oriented(TopAbs_INTERNAL));
}
B.Add(result,itr.Value().Oriented(orient));
}
}
+ result.Closed (BRep_Tool::IsClosed(result));
myMap(S).Append(result);
}
else {
B.Add(TubeShell,Face1.Reversed());
B.Add(TubeShell,Face2);
+ TubeShell.Closed (BRep_Tool::IsClosed (TubeShell));
B.MakeSolid(wallSolid);
B.Add(wallSolid,TubeShell);
BB.MakeShell(TopoDS::Shell(aShell));
TopTools_ListIteratorOfListOfShape anIter(aLeftPart);
for(; anIter.More(); anIter.Next()) BB.Add(aShell, anIter.Value());
+ aShell.Closed (BRep_Tool::IsClosed (aShell));
DBRep::Set(argv[1],aShell);
return 0;
}
return 0;
}
+//=======================================================================
+//function : OCC25202
+//purpose :
+//=======================================================================
+#include <ShapeBuild_ReShape.hxx>
+static Standard_Integer OCC25202 ( Draw_Interpretor& theDI,
+ Standard_Integer theArgN,
+ const char** theArgVal)
+{
+ // 0 1 2 3 4 5 6
+ //reshape res shape numF1 face1 numF2 face2
+ if(theArgN < 7)
+ {
+ theDI << "Use: reshape res shape numF1 face1 numF2 face2\n";
+ return 1;
+ }
+
+ TopoDS_Shape aShape = DBRep::Get(theArgVal[2]);
+ const Standard_Integer aNumOfRE1 = Draw::Atoi(theArgVal[3]),
+ aNumOfRE2 = Draw::Atoi(theArgVal[5]);
+ TopoDS_Face aShapeForRepl1 = TopoDS::Face(DBRep::Get(theArgVal[4])),
+ aShapeForRepl2 = TopoDS::Face(DBRep::Get(theArgVal[6]));
+
+ if(aShape.IsNull())
+ {
+ theDI << theArgVal[2] << " is null shape\n";
+ return 1;
+ }
+
+ if(aShapeForRepl1.IsNull())
+ {
+ theDI << theArgVal[4] << " is not a replaced type\n";
+ return 1;
+ }
+
+ if(aShapeForRepl2.IsNull())
+ {
+ theDI << theArgVal[6] << " is not a replaced type\n";
+ return 1;
+ }
+
+
+ TopoDS_Shape aReplacedShape;
+ ShapeBuild_ReShape aReshape;
+
+ //////////////////// explode (begin)
+ TopTools_MapOfShape M;
+ M.Add(aShape);
+ Standard_Integer aNbShapes = 0;
+ for (TopExp_Explorer ex(aShape,TopAbs_FACE); ex.More(); ex.Next())
+ {
+ const TopoDS_Shape& Sx = ex.Current();
+ Standard_Boolean added = M.Add(Sx);
+ if (added)
+ {
+ aNbShapes++;
+ if(aNbShapes == aNumOfRE1)
+ {
+ aReplacedShape = Sx;
+
+ aReshape.Replace(aReplacedShape, aShapeForRepl1);
+ }
+
+ if(aNbShapes == aNumOfRE2)
+ {
+ aReplacedShape = Sx;
+
+ aReshape.Replace(aReplacedShape, aShapeForRepl2);
+ }
+ }
+ }
+ //////////////////// explode (end)
+
+ if(aReplacedShape.IsNull())
+ {
+ theDI << "There is not any shape for replacing.\n";
+ }
+
+ DBRep::Set (theArgVal[1],aReshape.Apply (aShape,TopAbs_WIRE,2));
+
+ return 0;
+}
+
/*****************************************************************************/
void QABugs::Commands_19(Draw_Interpretor& theCommands) {
theCommands.Add ("OCC23010", "OCC23010 STEP_file", __FILE__, OCC23010, group);
theCommands.Add ("OCC25043", "OCC25043 shape", __FILE__, OCC25043, group);
theCommands.Add ("OCC24606", "OCC24606 : Tests ::FitAll for V3d view ('vfit' is for NIS view)", __FILE__, OCC24606, group);
+ theCommands.Add ("OCC25202", "OCC25202 res shape numF1 face1 numF2 face2", __FILE__, OCC25202, group);
return;
}
TopoDS_Shell shell;
B.MakeShell(shell);
B.Add(shell, bzf1);
+ shell.Closed (BRep_Tool::IsClosed (shell));
B.MakeSolid(solid);
B.Add(solid,shell);
gp_Dir D(0, 0, 1.0f);
TopoDS_Face face = TopoDS::Face(list.FindKey(i));
builder.Add(shell, face);
}
+ shell.Closed (BRep_Tool::IsClosed (shell));
BRepPrimAPI_MakeHalfSpace half(shell, gp_Pnt(0, 0, 20));
TopoDS_Solid sol = half.Solid();
#include <TopoDS_Iterator.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
#include <ShapeExtend.hxx>
#include <ShapeBuild_Edge.hxx>
#include <TopoDS.hxx>
// if shape replaced, apply modifications to the result recursively
Standard_Boolean aConsLoc = ModeConsiderLocation();
if ( (aConsLoc && ! newsh.IsPartner (shape)) ||
- (!aConsLoc &&! newsh.IsSame ( shape )) ) {
-
+ (!aConsLoc &&! newsh.IsSame ( shape )) )
+ {
TopoDS_Shape res = Apply ( newsh, until );
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 );
return res;
sbe.CopyRanges ( TopoDS::Edge ( result ), TopoDS::Edge ( shape ));
}
result.Orientation(orient);
+ result.Closed (BRep_Tool::IsClosed (result));
myStatus = locStatus;
Replace ( shape, result );
+
return result;
}
if (SFF->FixOrientation(MapWires)) EmpFace = SFF->Face();
theBuilder.Add(theShell,EmpFace);
}
+ theShell.Closed (BRep_Tool::IsClosed (theShell));
result = theShell;
if (!theRepVertices.IsEmpty()) {
}
j++;
B.Add(nshell,F1);
+ nshell.Closed (BRep_Tool::IsClosed (nshell));
aMapFaceShells.Bind(F1,nshell);
Lface.Remove(i);
// if closed shell is obtained it adds to sequence of shells and new shell begin to construct.
- if(isMultiConnex && BRep_Tool::IsClosed(nshell)) {
+ if(isMultiConnex && nshell.Closed()) {
aSeqShells.Append(nshell);
TopoDS_Shell nshellnext;
B.MakeShell(nshellnext);
}
else B.Add ( result, sh );
}
- if ( modif ) res = result;
+ if ( modif )
+ {
+ result.Closed (BRep_Tool::IsClosed (result));
+ res = result;
+ }
}
if ( res != r ) map.Bind ( S.Located(aNullLoc), res );
aB.Add(aCopyRes,aFace);
}
if(isModified)
+ {
+ aCopyRes.Closed (BRep_Tool::IsClosed (aCopyRes));
Context()->Replace(aResult,aCopyRes);
+ }
myStatus |= aStatus;
myResult = Context()->Apply ( aResult );
return Status ( ShapeExtend_DONE );
aNewShape.Location(aL);
}
if(shtype != TopAbs_EDGE) {
-
theNewShape = aNewShape;
-
- return Standard_True;
- }
+ return Standard_True;
+ }
}
//Removing location from sub-shapes in dependance of LevelRemoving and re-building shape.
if(!isBound) {
- if(!aRebuild)
- aNewShape = theShape.EmptyCopied();
+ if(!aRebuild)
+ {
+ aNewShape = theShape.EmptyCopied();
+ // it is safe to simply copy Closed flag since this operation does not change topology
+ aNewShape.Closed (theShape.Closed());
+ }
TopLoc_Location oldLoc,nullloc;
oldLoc = theShape.Location();
if(!oldLoc.IsIdentity())
Standard_Boolean isDoneSubShape = MakeNewShape(subshape,anAncShape,anewsubshape,isRemoveLoc);
isDone = (isDone || isDoneSubShape);
aB.Add(aNewShape,anewsubshape);
-
}
if(isDone)
aNewShape.Orientation(orient);
- else aNewShape = aShape;
+ else
+ aNewShape = aShape;
myMapNewShapes.Bind(aShape,aNewShape);
if(!theRemoveLoc && !oldLoc.IsIdentity())
aNewShape.Location(oldLoc);
}
theNewShape = aNewShape;
-
-
+
return (isDone || isBound);
}
cout<<"can not make analitical union => make approximation"<<endl;
#endif
TopoDS_Edge E = GlueEdgesWithPCurves(aChain, VF, VL);
- /*
- TopoDS_Wire W;
- B.MakeWire(W);
- for(j=1; j<=aChain.Length(); j++) {
- TopoDS_Edge edge = TopoDS::Edge(aChain.Value(j));
- B.Add(W,edge);
- }
- Handle(BRepAdaptor_HCompCurve) Adapt = new BRepAdaptor_HCompCurve(W);
- Approx_Curve3d Conv(Adapt,Tol,GeomAbs_C1,9,1000);
- Handle(Geom_BSplineCurve) bc = Conv.Curve();
- TopoDS_Edge E;
- B.MakeEdge (E,bc,Precision::Confusion());
- B.Add (E,VF);
- B.Add (E,VL);
- */
aChain.SetValue(1,E);
}
else {
} while (isNewFound);
// sorting any type of edges
- //aWire = TopoDS::Wire(aContext->Apply(aWire));
+ aWire.Closed (BRep_Tool::IsClosed (aWire));
aWire = TopoDS::Wire(myContext->Apply(aWire));
- //TopoDS_Face tmpF = TopoDS::Face(aContext->Apply(faces(1).Oriented(TopAbs_FORWARD)));
TopoDS_Face tmpF = TopoDS::Face(myContext->Apply(faces(1).Oriented(TopAbs_FORWARD)));
Handle(ShapeFix_Wire) sfw = new ShapeFix_Wire(aWire,tmpF,Precision::Confusion());
sfw->FixReorder();
TopoDS_Wire aW;
B.MakeWire(aW);
B.Add(aW,E);
+ aW.Closed (Standard_True);
B.Add(aResult,aW);
}
}
B.MakeShell ( S );
for ( i=1; i <= parts.Length(); i++ )
B.Add ( S, parts(i) );
+ S.Closed (BRep_Tool::IsClosed (S));
CompRes = S;
}
else CompRes = parts(1);
V1 = V;
}
if(numE)
+ {
+ resWire.Closed (BRep_Tool::IsClosed (resWire));
Context()->Replace(E,resWire);
+ }
else
Context()->Remove(E);
}
}
if ( Status ( ShapeExtend_DONE ) ) {
//smh#8
+ newWire.Closed (BRep_Tool::IsClosed (newWire));
TopoDS_Shape tmpW = Context()->Apply ( newWire ).Oriented(myWire.Orientation());
myWire = TopoDS::Wire (tmpW );
}
B.Add ( W, E );
}
if ( W.IsNull() ) continue;
+ W.Closed (BRep_Tool::IsClosed (W));
B.Add ( C, W );
if ( myResult.IsNull() ) myResult = W;
else myResult = C;
B.Add ( S, F );
}
if ( S.IsNull() ) continue;
+ S.Closed (BRep_Tool::IsClosed (S));
B.Add ( C, S );
if ( myResult.IsNull() ) myResult = S;
else myResult = C;
TP->AddFail(EL,"At least one edge failed : wire not done");
return;
}
+ W.Closed (BRep_Tool::IsClosed (W));
aTool.Bind(EL, W);
// ----------------------------------------------
GP1 = GP2;
V1 = V2;
}
+ W.Closed (BRep_Tool::IsClosed (W));
aTool.Bind(PL, W);
myResult = W;
myError = StepToTopoDS_TranslatePolyLoopDone;
TP->AddWarning(StepFace," Face is not of FaceSurface Type; not mapped to TopoDS");
}
}
+ Sh.Closed (BRep_Tool::IsClosed (Sh));
myResult = Sh;
aTool.Bind(CFS, myResult);
myError = StepToTopoDS_TranslateShellDone;
B.Degenerated(E, Standard_True);
B.MakeWire(W);
+ W.Closed (Standard_True);
B.Add(W, E);
aTool.Bind(VL, W);
myResult = W;
TopoDS_Shell aShell;
aShellBuilder.MakeShell(aShell);
for(;aListIter.More();aListIter.Next()) aShellBuilder.Add(aShell,TopoDS::Face(aListIter.Value()));
+ aShell.Closed (BRep_Tool::IsClosed (aShell));
if (theType == TopAbs_SHELL) return aShell;
aShapes.Clear(); // don't break: we can do something more of it
aShapes.Append(aShell);
if (S.IsNull()) continue;
if (S.ShapeType() == TopAbs_FACE) {
BB.Add(she,S);
+ she.Closed (BRep_Tool::IsClosed (she));
yaface = Standard_True;
}
}
newShellBuilder.MakeShell( newShell );
newShellBuilder.Add( newShell, hsFace );
newShellBuilder.Add( newShell, infFace );
+ newShell.Closed (BRep_Tool::IsClosed (newShell));
BRep_Builder newSolidBuilder;
newSolidBuilder.MakeSolid( newSolid );
}
// Add wires
aWire.Orientation(Wori);
+ aWire.Closed (BRep_Tool::IsClosed (aWire));
BB.Add (aFace, aWire);
}
}
aShell.Orientation(S.Orientation());
+ aShell.Closed (BRep_Tool::IsClosed(aShell));
BB.Add (aSolid, aShell);
}
+ aSolid.Closed (BRep_Tool::IsClosed(aSolid));
aResult=aSolid;
//update section curves
// iterate on subshapes
BRep_Builder B;
TopoDS_Shape copy = shape.EmptyCopied();
+ copy.Closed (shape.Closed());
Standard_Boolean suboverride = Standard_False;
Standard_Integer nbDef = 0;
for ( TopoDS_Iterator it(shape); it.More(); it.Next() ) {
TopoDS_Shell S;
B.MakeShell (S);
B.Add (S,shape); // ne passe pas ! : TopoDS::Face(shape));
+ S.Closed (BRep_Tool::IsClosed (S));
return S;
}
--- /dev/null
+puts "========"
+puts "CR25202"
+puts "========"
+puts ""
+#########################################
+## Incorrect value of IsClosed flag in shapes produced by some algorithms
+#########################################
+
+pload QAcommands
+
+box b 100 100 100
+vertex v1 0 0 50
+explode b v
+edge ee1 b_2 v1
+edge ee2 v1 b_1
+explode b e
+wire ww1 ee1 ee2 b_2 b_3 b_4
+wire ww2 ee1 ee2 b_9 b_10 b_5
+mkplane ff1 ww1
+mkplane ff2 ww2
+explode b f
+#Replaced edge lies between b_1 and b_3 faces.
+
+OCC25202 result b 1 ff1 3 ff2
+
+set info [whatis result]
+if { [regexp {Closed} ${info}] } {
+ puts "OK : value of IsClosed flag is correct"
+} else {
+ puts "Error : value of IsClosed flag is not correct"
+}
+
+set 2dviewer 1
--- /dev/null
+puts "========"
+puts "CR25202"
+puts "========"
+puts ""
+#########################################
+## Incorrect value of IsClosed flag in shapes produced by some algorithms
+#########################################
+
+box b 100 100 100
+explode b sh
+trotate b_1 0 0 0 1 0 0 45
+removeloc result b_1
+
+set info [whatis result]
+if { [regexp {Closed} ${info}] } {
+ puts "OK : value of IsClosed flag is correct"
+} else {
+ puts "Error : value of IsClosed flag is not correct"
+}
+
+set 2dviewer 1
--- /dev/null
+puts "========"
+puts "CR25202"
+puts "========"
+puts ""
+#########################################
+## Incorrect value of IsClosed flag in shapes produced by some algorithms
+#########################################
+
+plane pp 0 0 0 0 0 1
+trim pp pp 0 100 0 100
+mkface ff pp
+prism result ff 0 0 20
+
+set info [whatis result]
+if { [regexp {Closed} ${info}] } {
+ puts "OK : value of IsClosed flag is correct"
+} else {
+ puts "Error : value of IsClosed flag is not correct"
+}
+
+set 2dviewer 1
--- /dev/null
+puts "========"
+puts "CR25202"
+puts "========"
+puts ""
+#########################################
+## Incorrect value of IsClosed flag in shapes produced by some algorithms
+#########################################
+
+circle cc 0 100 0 20
+mkedge ee cc
+wire ww ee
+mkplane ff ww
+revol result ff 0 0 0 1 0 0 90
+
+set info [whatis result]
+if { [regexp {Closed} ${info}] } {
+ puts "OK : value of IsClosed flag is correct"
+} else {
+ puts "Error : value of IsClosed flag is not correct"
+}
+
+set 2dviewer 1