Extend the Offset operation (Join Type "Intersection", mode "Complete") to allow different offset values on adjacent co-planar faces.
The gap between adjacent faces is closed by creating artificial face perpendicular to the face.
Adding test cases.
}
+//=======================================================================
+//function : RemoveRoot
+//purpose :
+//=======================================================================
+void BRepAlgo_Image::RemoveRoot (const TopoDS_Shape& Root)
+{
+ Standard_Boolean isRemoved = Standard_False;
+ for (TopTools_ListOfShape::Iterator it (roots); it.More(); it.Next())
+ {
+ if (Root.IsSame (it.Value()))
+ {
+ roots.Remove (it);
+ isRemoved = Standard_True;
+ break;
+ }
+ }
+
+ if (!isRemoved)
+ return;
+
+ const TopTools_ListOfShape* pNewS = down.Seek (Root);
+ if (pNewS)
+ {
+ for (TopTools_ListOfShape::Iterator it (*pNewS); it.More(); it.Next())
+ {
+ const TopoDS_Shape *pOldS = up.Seek (it.Value());
+ if (pOldS && pOldS->IsSame (Root))
+ up.UnBind (it.Value());
+ }
+ down.UnBind (Root);
+ }
+}
+
+//=======================================================================
+//function : ReplaceRoot
+//purpose :
+//=======================================================================
+void BRepAlgo_Image::ReplaceRoot (const TopoDS_Shape& OldRoot,
+ const TopoDS_Shape& NewRoot)
+{
+ if (!HasImage (OldRoot))
+ return;
+
+ const TopTools_ListOfShape& aLImage = Image (OldRoot);
+ if (HasImage (NewRoot))
+ Add (NewRoot, aLImage);
+ else
+ Bind (NewRoot, aLImage);
+
+ SetRoot (NewRoot);
+ RemoveRoot (OldRoot);
+}
//! Remove <S> to set of images.
Standard_EXPORT void Remove (const TopoDS_Shape& S);
+ //! Removes the root <theRoot> from the list of roots and up and down maps.
+ Standard_EXPORT void RemoveRoot (const TopoDS_Shape& Root);
+
+ //! Replaces the <OldRoot> with the <NewRoot>, so all images
+ //! of the <OldRoot> become the images of the <NewRoot>.
+ //! The <OldRoot> is removed.
+ Standard_EXPORT void ReplaceRoot (const TopoDS_Shape& OldRoot, const TopoDS_Shape& NewRoot);
+
Standard_EXPORT const TopTools_ListOfShape& Roots() const;
Standard_EXPORT Standard_Boolean IsImage (const TopoDS_Shape& S) const;
#include <Adaptor3d_Surface.hxx>
+#include <BOPTools_AlgoTools.hxx>
+#include <BOPTools_AlgoTools3D.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepOffset_Interval.hxx>
#include <BRepOffset_ListIteratorOfListOfInterval.hxx>
#include <BRepOffset_Tool.hxx>
+#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepTools.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_Curve.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec.hxx>
+#include <IntTools_Context.hxx>
#include <Precision.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
//=======================================================================
BRepOffset_Analyse::BRepOffset_Analyse()
-:myDone(Standard_False)
+: myOffset (0.0), myDone (Standard_False)
{
}
-
//=======================================================================
//function : BRepOffset_Analyse
//purpose :
//=======================================================================
-
BRepOffset_Analyse::BRepOffset_Analyse(const TopoDS_Shape& S,
- const Standard_Real Angle)
-:myDone(Standard_False)
+ const Standard_Real Angle)
+: myOffset (0.0), myDone (Standard_False)
{
Perform( S, Angle);
}
//function : EdgeAnlyse
//purpose :
//=======================================================================
-
static void EdgeAnalyse(const TopoDS_Edge& E,
const TopoDS_Face& F1,
const TopoDS_Face& F2,
//function : BuildAncestors
//purpose :
//=======================================================================
-
static void BuildAncestors (const TopoDS_Shape& S,
TopTools_IndexedDataMapOfShapeListOfShape& MA)
{
TopExp::MapShapesAndUniqueAncestors(S,TopAbs_EDGE ,TopAbs_FACE,MA);
}
-//=======================================================================
-//function : IsDone
-//purpose :
-//=======================================================================
-
-Standard_Boolean BRepOffset_Analyse::IsDone() const
-{
- return myDone;
-}
-
-
//=======================================================================
//function : Perform
//purpose :
//=======================================================================
-
void BRepOffset_Analyse::Perform (const TopoDS_Shape& S,
- const Standard_Real Angle)
+ const Standard_Real Angle)
{
myShape = S;
+ myNewFaces .Clear();
+ myGenerated.Clear();
+ myReplacement.Clear();
+ myDescendants.Clear();
- angle = Angle;
- Standard_Real SinTol = Sin(Angle);
+ myAngle = Angle;
+ Standard_Real SinTol = Abs (Sin(Angle));
// Build ancestors.
- BuildAncestors (S,ancestors);
+ BuildAncestors (S,myAncestors);
+
+ TopTools_ListOfShape aLETang;
-
TopExp_Explorer Exp(S.Oriented(TopAbs_FORWARD),TopAbs_EDGE);
for ( ; Exp.More(); Exp.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(Exp.Current());
- if (!mapEdgeType.IsBound(E)) {
+ if (!myMapEdgeType.IsBound(E)) {
BRepOffset_ListOfInterval LI;
- mapEdgeType.Bind(E,LI);
+ myMapEdgeType.Bind(E,LI);
const TopTools_ListOfShape& L = Ancestors(E);
if ( L.IsEmpty())
- continue;
+ continue;
if (L.Extent() == 2) {
- const TopoDS_Face& F1 = TopoDS::Face(L.First());
- const TopoDS_Face& F2 = TopoDS::Face(L.Last ());
- EdgeAnalyse(E,F1,F2,SinTol,mapEdgeType(E));
+ const TopoDS_Face& F1 = TopoDS::Face (L.First());
+ const TopoDS_Face& F2 = TopoDS::Face (L.Last());
+ EdgeAnalyse (E, F1, F2, SinTol, myMapEdgeType (E));
+
+ // For tangent faces add artificial perpendicular face
+ // to close the gap between them (if they have different offset values)
+ if (myMapEdgeType(E).Last().Type() == ChFiDS_Tangential)
+ aLETang.Append (E);
}
else if (L.Extent() == 1) {
- Standard_Real U1,U2;
- const TopoDS_Face& F = TopoDS::Face(L.First());
- BRep_Tool::Range(E,F,U1,U2);
- BRepOffset_Interval Inter(U1,U2,ChFiDS_Other);
-
- if (! BRepTools::IsReallyClosed(E,F)) {
- Inter.Type(ChFiDS_FreeBound);
- }
- mapEdgeType(E).Append(Inter);
+ Standard_Real U1, U2;
+ const TopoDS_Face& F = TopoDS::Face (L.First());
+ BRep_Tool::Range (E, F, U1, U2);
+ BRepOffset_Interval Inter (U1, U2, ChFiDS_Other);
+
+ if (!BRepTools::IsReallyClosed (E, F)) {
+ Inter.Type (ChFiDS_FreeBound);
+ }
+ myMapEdgeType (E).Append (Inter);
}
else {
#ifdef OCCT_DEBUG
}
}
}
+
+ TreatTangentFaces (aLETang);
myDone = Standard_True;
}
//=======================================================================
-//function : Clear
+//function : Generated
//purpose :
//=======================================================================
-
-void BRepOffset_Analyse::Clear()
+void BRepOffset_Analyse::TreatTangentFaces (const TopTools_ListOfShape& theLE)
{
- myDone = Standard_False;
- myShape .Nullify();
- mapEdgeType.Clear();
- ancestors .Clear();
+ if (theLE.IsEmpty() || myFaceOffsetMap.IsEmpty())
+ {
+ // Noting to do: either there are no tangent faces in the shape or
+ // the face offset map has not been provided
+ return;
+ }
+
+ // Select the edges which connect faces with different offset values
+ TopoDS_Compound aCETangent;
+ BRep_Builder().MakeCompound (aCETangent);
+ // Bind to each tangent edge a max offset value of its faces
+ TopTools_DataMapOfShapeReal anEdgeOffsetMap;
+ // Bind vertices of the tangent edges with connected edges
+ // of the face with smaller offset value
+ TopTools_DataMapOfShapeShape aDMVEMin;
+ for (TopTools_ListOfShape::Iterator it (theLE); it.More(); it.Next())
+ {
+ const TopoDS_Shape& aE = it.Value();
+ const TopTools_ListOfShape& aLA = Ancestors (aE);
+
+ const TopoDS_Shape& aF1 = aLA.First(), aF2 = aLA.Last();
+
+ const Standard_Real *pOffsetVal1 = myFaceOffsetMap.Seek (aF1);
+ const Standard_Real *pOffsetVal2 = myFaceOffsetMap.Seek (aF2);
+ const Standard_Real anOffsetVal1 = pOffsetVal1 ? Abs (*pOffsetVal1) : myOffset;
+ const Standard_Real anOffsetVal2 = pOffsetVal2 ? Abs (*pOffsetVal2) : myOffset;
+ if (anOffsetVal1 != anOffsetVal2)
+ {
+ BRep_Builder().Add (aCETangent, aE);
+ anEdgeOffsetMap.Bind (aE, Max (anOffsetVal1, anOffsetVal2));
+
+ const TopoDS_Shape& aFMin = anOffsetVal1 < anOffsetVal2 ? aF1 : aF2;
+ for (TopoDS_Iterator itV (aE); itV.More(); itV.Next())
+ {
+ const TopoDS_Shape& aV = itV.Value();
+ if (Ancestors (aV).Extent() == 3)
+ {
+ for (TopExp_Explorer expE (aFMin, TopAbs_EDGE); expE.More(); expE.Next())
+ {
+ const TopoDS_Shape& aEMin = expE.Current();
+ if (aEMin.IsSame (aE))
+ continue;
+ for (TopoDS_Iterator itV1 (aEMin); itV1.More(); itV1.Next())
+ {
+ const TopoDS_Shape& aVx = itV1.Value();
+ if (aV.IsSame (aVx))
+ aDMVEMin.Bind (aV, aEMin);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (anEdgeOffsetMap.IsEmpty())
+ return;
+
+ // Create map of Face ancestors for the vertices on tangent edges
+ TopTools_DataMapOfShapeListOfShape aDMVFAnc;
+
+ for (TopTools_ListOfShape::Iterator itE (theLE); itE.More(); itE.Next())
+ {
+ const TopoDS_Shape& aE = itE.Value();
+ if (!anEdgeOffsetMap.IsBound (aE))
+ continue;
+
+ TopTools_MapOfShape aMFence;
+ {
+ const TopTools_ListOfShape& aLEA = Ancestors (aE);
+ for (TopTools_ListOfShape::Iterator itLEA (aLEA); itLEA.More(); itLEA.Next())
+ aMFence.Add (itLEA.Value());
+ }
+
+ for (TopoDS_Iterator itV (aE); itV.More(); itV.Next())
+ {
+ const TopoDS_Shape& aV = itV.Value();
+ TopTools_ListOfShape* pLFA = aDMVFAnc.Bound (aV, TopTools_ListOfShape());
+ const TopTools_ListOfShape& aLVA = Ancestors (aV);
+ for (TopTools_ListOfShape::Iterator itLVA (aLVA); itLVA.More(); itLVA.Next())
+ {
+ const TopoDS_Edge& aEA = TopoDS::Edge (itLVA.Value());
+ const BRepOffset_ListOfInterval* pIntervals = myMapEdgeType.Seek (aEA);
+ if (!pIntervals || pIntervals->IsEmpty())
+ continue;
+ if (pIntervals->First().Type() == ChFiDS_Tangential)
+ continue;
+
+ const TopTools_ListOfShape& aLEA = Ancestors (aEA);
+ for (TopTools_ListOfShape::Iterator itLEA (aLEA); itLEA.More(); itLEA.Next())
+ {
+ const TopoDS_Shape& aFA = itLEA.Value();
+ if (aMFence.Add (aFA))
+ pLFA->Append (aFA);
+ }
+ }
+ }
+ }
+
+ Handle(IntTools_Context) aCtx = new IntTools_Context();
+ // Tangency criteria
+ Standard_Real aSinTol = Abs (Sin (myAngle));
+
+ // Make blocks of connected edges
+ TopTools_ListOfListOfShape aLCB;
+ TopTools_IndexedDataMapOfShapeListOfShape aMVEMap;
+
+ BOPTools_AlgoTools::MakeConnexityBlocks (aCETangent, TopAbs_VERTEX, TopAbs_EDGE, aLCB, aMVEMap);
+
+ // Analyze each block to find co-planar edges
+ for (TopTools_ListOfListOfShape::Iterator itLCB (aLCB); itLCB.More(); itLCB.Next())
+ {
+ const TopTools_ListOfShape& aCB = itLCB.Value();
+
+ TopTools_MapOfShape aMFence;
+ for (TopTools_ListOfShape::Iterator itCB1 (aCB); itCB1.More(); itCB1.Next())
+ {
+ const TopoDS_Edge& aE1 = TopoDS::Edge (itCB1.Value());
+ if (!aMFence.Add (aE1))
+ continue;
+
+ TopoDS_Compound aBlock;
+ BRep_Builder().MakeCompound (aBlock);
+ BRep_Builder().Add (aBlock, aE1.Oriented (TopAbs_FORWARD));
+
+ Standard_Real anOffset = anEdgeOffsetMap.Find (aE1);
+ const TopTools_ListOfShape& aLF1 = Ancestors (aE1);
+
+ gp_Dir aDN1;
+ BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (aE1, TopoDS::Face (aLF1.First()), aDN1);
+
+ TopTools_ListOfShape::Iterator itCB2 = itCB1;
+ for (itCB2.Next(); itCB2.More(); itCB2.Next())
+ {
+ const TopoDS_Edge& aE2 = TopoDS::Edge (itCB2.Value());
+ if (aMFence.Contains (aE2))
+ continue;
+
+ const TopTools_ListOfShape& aLF2 = Ancestors (aE2);
+
+ gp_Dir aDN2;
+ BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (aE2, TopoDS::Face (aLF2.First()), aDN2);
+
+ if (aDN1.XYZ().Crossed (aDN2.XYZ()).Modulus() < aSinTol)
+ {
+ BRep_Builder().Add (aBlock, aE2.Oriented (TopAbs_FORWARD));
+ aMFence.Add (aE2);
+ anOffset = Max (anOffset, anEdgeOffsetMap.Find (aE2));
+ }
+ }
+
+ // Make the prism
+ BRepPrimAPI_MakePrism aMP (aBlock, gp_Vec (aDN1.XYZ()) * anOffset);
+ if (!aMP.IsDone())
+ continue;
+
+ TopTools_IndexedDataMapOfShapeListOfShape aPrismAncestors;
+ TopExp::MapShapesAndAncestors (aMP.Shape(), TopAbs_EDGE, TopAbs_FACE, aPrismAncestors);
+ TopExp::MapShapesAndAncestors (aMP.Shape(), TopAbs_VERTEX, TopAbs_EDGE, aPrismAncestors);
+
+ for (TopoDS_Iterator itE (aBlock); itE.More(); itE.Next())
+ {
+ const TopoDS_Edge& aE = TopoDS::Edge (itE.Value());
+ const TopTools_ListOfShape& aLG = aMP.Generated (aE);
+ TopoDS_Face aFNew = TopoDS::Face (aLG.First());
+
+ TopTools_ListOfShape& aLA = myAncestors.ChangeFromKey (aE);
+
+ TopoDS_Shape aF1 = aLA.First();
+ TopoDS_Shape aF2 = aLA.Last();
+
+ const Standard_Real *pOffsetVal1 = myFaceOffsetMap.Seek (aF1);
+ const Standard_Real *pOffsetVal2 = myFaceOffsetMap.Seek (aF2);
+ const Standard_Real anOffsetVal1 = pOffsetVal1 ? Abs (*pOffsetVal1) : myOffset;
+ const Standard_Real anOffsetVal2 = pOffsetVal2 ? Abs (*pOffsetVal2) : myOffset;
+
+ const TopoDS_Shape& aFToRemove = anOffsetVal1 > anOffsetVal2 ? aF1 : aF2;
+ const TopoDS_Shape& aFOpposite = anOffsetVal1 > anOffsetVal2 ? aF2 : aF1;
+
+ // Orient the face so its normal is directed to smaller offset face
+ {
+ // get normal of the new face
+ gp_Dir aDN;
+ BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (aE, aFNew, aDN);
+
+ // get bi-normal for the aFOpposite
+ TopoDS_Edge aEInF;
+ for (TopExp_Explorer aExpE (aFOpposite, TopAbs_EDGE); aExpE.More(); aExpE.Next())
+ {
+ if (aE.IsSame (aExpE.Current()))
+ {
+ aEInF = TopoDS::Edge (aExpE.Current());
+ break;
+ }
+ }
+
+ gp_Pnt2d aP2d;
+ gp_Pnt aPInF;
+ Standard_Real f, l;
+ const Handle(Geom_Curve)& aC3D = BRep_Tool::Curve (aEInF, f, l);
+ gp_Pnt aPOnE = aC3D->Value ((f + l) / 2.);
+ BOPTools_AlgoTools3D::PointNearEdge (aEInF, TopoDS::Face (aFOpposite), (f + l) / 2., 1.e-5, aP2d, aPInF);
+
+ gp_Vec aBN (aPOnE, aPInF);
+
+ if (aBN.Dot (aDN) < 0)
+ aFNew.Reverse();
+ }
+
+ // Remove the face with bigger offset value from edge ancestors
+ for (TopTools_ListOfShape::Iterator itA (aLA); itA.More();itA.Next())
+ {
+ if (itA.Value().IsSame (aFToRemove))
+ {
+ aLA.Remove (itA);
+ break;
+ }
+ }
+ aLA.Append (aFNew);
+
+ myMapEdgeType (aE).Clear();
+ // Analyze edge again
+ EdgeAnalyse (aE, TopoDS::Face (aFOpposite), aFNew, aSinTol, myMapEdgeType (aE));
+
+ // Analyze vertices
+ TopTools_MapOfShape aFNewEdgeMap;
+ aFNewEdgeMap.Add (aE);
+ for (TopoDS_Iterator itV (aE); itV.More(); itV.Next())
+ {
+ const TopoDS_Shape& aV = itV.Value();
+ // Add Side edge to map of Ancestors with the correct orientation
+ TopoDS_Edge aEG = TopoDS::Edge (aMP.Generated (aV).First());
+ myGenerated.Bind (aV, aEG);
+ {
+ for (TopExp_Explorer anExpEg (aFNew, TopAbs_EDGE); anExpEg.More(); anExpEg.Next())
+ {
+ if (anExpEg.Current().IsSame (aEG))
+ {
+ aEG = TopoDS::Edge (anExpEg.Current());
+ break;
+ }
+ }
+ }
+
+ if (aDMVEMin.IsBound (aV))
+ {
+ const TopTools_ListOfShape* pSA = aDMVFAnc.Seek (aV);
+ if (pSA && pSA->Extent() == 1)
+ {
+ // Adjust orientation of generated edge to its new ancestor
+ TopoDS_Edge aEMin = TopoDS::Edge (aDMVEMin.Find (aV));
+ for (TopExp_Explorer expEx (pSA->First(), TopAbs_EDGE); expEx.More(); expEx.Next())
+ {
+ if (expEx.Current().IsSame (aEMin))
+ {
+ aEMin = TopoDS::Edge (expEx.Current());
+ break;
+ }
+ }
+
+ TopAbs_Orientation anOriInEMin (TopAbs_FORWARD), anOriInEG (TopAbs_FORWARD);
+
+ for (TopoDS_Iterator itx (aEMin); itx.More(); itx.Next())
+ {
+ if (itx.Value().IsSame (aV))
+ {
+ anOriInEMin = itx.Value().Orientation();
+ break;
+ }
+ }
+
+ for (TopoDS_Iterator itx (aEG); itx.More(); itx.Next())
+ {
+ if (itx.Value().IsSame (aV))
+ {
+ anOriInEG = itx.Value().Orientation();
+ break;
+ }
+ }
+
+ if (anOriInEG == anOriInEMin)
+ aEG.Reverse();
+ }
+ }
+
+ TopTools_ListOfShape& aLVA = myAncestors.ChangeFromKey (aV);
+ if (!aLVA.Contains (aEG))
+ aLVA.Append (aEG);
+ aFNewEdgeMap.Add (aEG);
+
+ TopTools_ListOfShape& aLEGA =
+ myAncestors (myAncestors.Add (aEG, aPrismAncestors.FindFromKey (aEG)));
+ {
+ // Add ancestors from the shape
+ const TopTools_ListOfShape* pSA = aDMVFAnc.Seek (aV);
+ if (pSA && !pSA->IsEmpty())
+ {
+ TopTools_ListOfShape aLSA = *pSA;
+ aLEGA.Append (aLSA);
+ }
+ }
+
+ myMapEdgeType.Bind (aEG, BRepOffset_ListOfInterval());
+ if (aLEGA.Extent() == 2)
+ {
+ EdgeAnalyse (aEG, TopoDS::Face (aLEGA.First()), TopoDS::Face (aLEGA.Last()),
+ aSinTol, myMapEdgeType (aEG));
+ }
+ }
+
+ // Find an edge opposite to tangential one and add ancestors for it
+ TopoDS_Edge aEOpposite;
+ for (TopExp_Explorer anExpE (aFNew, TopAbs_EDGE); anExpE.More(); anExpE.Next())
+ {
+ if (!aFNewEdgeMap.Contains (anExpE.Current()))
+ {
+ aEOpposite = TopoDS::Edge (anExpE.Current());
+ break;
+ }
+ }
+
+ {
+ // Find it in aFOpposite
+ for (TopExp_Explorer anExpE (aFToRemove, TopAbs_EDGE); anExpE.More(); anExpE.Next())
+ {
+ const TopoDS_Shape& aEInFToRem = anExpE.Current();
+ if (aE.IsSame (aEInFToRem))
+ {
+ if (BOPTools_AlgoTools::IsSplitToReverse (aEOpposite, aEInFToRem, aCtx))
+ aEOpposite.Reverse();
+ break;
+ }
+ }
+ }
+
+ TopTools_ListOfShape aLFOpposite;
+ aLFOpposite.Append (aFNew);
+ aLFOpposite.Append (aFToRemove);
+ myAncestors.Add (aEOpposite, aLFOpposite);
+ myMapEdgeType.Bind (aEOpposite, BRepOffset_ListOfInterval());
+ EdgeAnalyse (aEOpposite, aFNew, TopoDS::Face (aFToRemove), aSinTol, myMapEdgeType (aEOpposite));
+
+ TopTools_DataMapOfShapeShape* pEEMap = myReplacement.ChangeSeek (aFToRemove);
+ if (!pEEMap)
+ pEEMap = myReplacement.Bound (aFToRemove, TopTools_DataMapOfShapeShape());
+ pEEMap->Bind (aE, aEOpposite);
+
+ // Add ancestors for the vertices
+ for (TopoDS_Iterator itV (aEOpposite); itV.More(); itV.Next())
+ {
+ const TopoDS_Shape& aV = itV.Value();
+ const TopTools_ListOfShape& aLVA = aPrismAncestors.FindFromKey (aV);
+ myAncestors.Add (aV, aLVA);
+ }
+
+ myNewFaces.Append (aFNew);
+ myGenerated.Bind (aE, aFNew);
+ }
+ }
+ }
}
+//=======================================================================
+//function : EdgeReplacement
+//purpose :
+//=======================================================================
+const TopoDS_Edge& BRepOffset_Analyse::EdgeReplacement (const TopoDS_Face& theF,
+ const TopoDS_Edge& theE) const
+{
+ const TopTools_DataMapOfShapeShape* pEE = myReplacement.Seek (theF);
+ if (!pEE)
+ return theE;
+ const TopoDS_Shape* pE = pEE->Seek (theE);
+ if (!pE)
+ return theE;
+ return TopoDS::Edge (*pE);
+}
+//=======================================================================
+//function : Generated
+//purpose :
+//=======================================================================
+TopoDS_Shape BRepOffset_Analyse::Generated (const TopoDS_Shape& theS) const
+{
+ static TopoDS_Shape aNullShape;
+ const TopoDS_Shape* pGenS = myGenerated.Seek (theS);
+ return pGenS ? *pGenS : aNullShape;
+}
//=======================================================================
-//function : BRepOffset_ListOfInterval&
+//function : Descendants
//purpose :
//=======================================================================
+const TopTools_ListOfShape* BRepOffset_Analyse::Descendants (const TopoDS_Shape& theS,
+ const Standard_Boolean theUpdate) const
+{
+ if (myDescendants.IsEmpty() || theUpdate)
+ {
+ myDescendants.Clear();
+ const Standard_Integer aNbA = myAncestors.Extent();
+ for (Standard_Integer i = 1; i <= aNbA; ++i)
+ {
+ const TopoDS_Shape& aSS = myAncestors.FindKey (i);
+ const TopTools_ListOfShape& aLA = myAncestors (i);
+
+ for (TopTools_ListOfShape::Iterator it (aLA); it.More(); it.Next())
+ {
+ const TopoDS_Shape& aSA = it.Value();
+
+ TopTools_ListOfShape* pLD = myDescendants.ChangeSeek (aSA);
+ if (!pLD)
+ pLD = myDescendants.Bound (aSA, TopTools_ListOfShape());
+ if (!pLD->Contains (aSS))
+ pLD->Append (aSS);
+ }
+ }
+ }
-const BRepOffset_ListOfInterval& BRepOffset_Analyse::Type(const TopoDS_Edge& E)
-const
+ return myDescendants.Seek (theS);
+}
+
+//=======================================================================
+//function : Clear
+//purpose :
+//=======================================================================
+void BRepOffset_Analyse::Clear()
{
- return mapEdgeType (E);
+ myDone = Standard_False;
+ myShape .Nullify();
+ myMapEdgeType.Clear();
+ myAncestors .Clear();
+ myFaceOffsetMap.Clear();
+ myReplacement.Clear();
+ myDescendants.Clear();
+ myNewFaces .Clear();
+ myGenerated.Clear();
}
+//=======================================================================
+//function : BRepOffset_ListOfInterval&
+//purpose :
+//=======================================================================
+const BRepOffset_ListOfInterval& BRepOffset_Analyse::Type(const TopoDS_Edge& E) const
+{
+ return myMapEdgeType (E);
+}
//=======================================================================
//function : Edges
//purpose :
//=======================================================================
-
void BRepOffset_Analyse::Edges(const TopoDS_Vertex& V,
- const ChFiDS_TypeOfConcavity T,
- TopTools_ListOfShape& LE)
-const
+ const ChFiDS_TypeOfConcavity T,
+ TopTools_ListOfShape& LE) const
{
LE.Clear();
const TopTools_ListOfShape& L = Ancestors (V);
for ( ;it.More(); it.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(it.Value());
- TopoDS_Vertex V1,V2;
- BRepOffset_Tool::EdgeVertices (E,V1,V2);
- if (V1.IsSame(V)) {
- if (mapEdgeType(E).Last().Type() == T)
- LE.Append(E);
- }
- if (V2.IsSame(V)) {
- if (mapEdgeType(E).First().Type() == T)
- LE.Append(E);
+ const BRepOffset_ListOfInterval *pIntervals = myMapEdgeType.Seek (E);
+ if (pIntervals && pIntervals->Extent() > 0)
+ {
+ TopoDS_Vertex V1,V2;
+ BRepOffset_Tool::EdgeVertices (E,V1,V2);
+ if (V1.IsSame(V)) {
+ if (pIntervals->Last().Type() == T)
+ LE.Append (E);
+ }
+ if (V2.IsSame(V)) {
+ if (pIntervals->First().Type() == T)
+ LE.Append (E);
+ }
}
}
}
//function : Edges
//purpose :
//=======================================================================
-
void BRepOffset_Analyse::Edges(const TopoDS_Face& F,
- const ChFiDS_TypeOfConcavity T,
- TopTools_ListOfShape& LE)
-const
+ const ChFiDS_TypeOfConcavity T,
+ TopTools_ListOfShape& LE) const
{
LE.Clear();
TopExp_Explorer exp(F, TopAbs_EDGE);
-
+
for ( ;exp.More(); exp.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
//function : TangentEdges
//purpose :
//=======================================================================
-
void BRepOffset_Analyse::TangentEdges(const TopoDS_Edge& Edge ,
const TopoDS_Vertex& Vertex,
TopTools_ListOfShape& Edges ) const
{
gp_Vec V,VRef;
-
Standard_Real U,URef;
BRepAdaptor_Curve C3d, C3dRef;
V = C3d.DN(U,1);
CorrectOrientationOfTangent(V, Vertex, CurE);
if (V.SquareMagnitude() < gp::Resolution()) continue;
- if (V.IsOpposite(VRef,angle)) {
+ if (V.IsOpposite(VRef,myAngle)) {
Edges.Append(CurE);
}
}
}
-
-
-//=======================================================================
-//function : HasAncestor
-//purpose :
-//=======================================================================
-
-Standard_Boolean BRepOffset_Analyse::HasAncestor (const TopoDS_Shape& S) const
-{
- return ancestors.Contains(S);
-}
-
-
-//=======================================================================
-//function : Ancestors
-//purpose :
-//=======================================================================
-
-const TopTools_ListOfShape& BRepOffset_Analyse::Ancestors
-(const TopoDS_Shape& S) const
-{
- return ancestors.FindFromKey(S);
-}
-
-
//=======================================================================
//function : Explode
//purpose :
//=======================================================================
-
-void BRepOffset_Analyse::Explode( TopTools_ListOfShape& List,
- const ChFiDS_TypeOfConcavity T ) const
+void BRepOffset_Analyse::Explode (TopTools_ListOfShape& List,
+ const ChFiDS_TypeOfConcavity T) const
{
List.Clear();
BRep_Builder B;
TopTools_MapOfShape Map;
-
+
TopExp_Explorer Fexp;
for (Fexp.Init(myShape,TopAbs_FACE); Fexp.More(); Fexp.Next()) {
if ( Map.Add(Fexp.Current())) {
//function : Explode
//purpose :
//=======================================================================
-
-void BRepOffset_Analyse::Explode( TopTools_ListOfShape& List,
- const ChFiDS_TypeOfConcavity T1,
- const ChFiDS_TypeOfConcavity T2) const
+void BRepOffset_Analyse::Explode (TopTools_ListOfShape& List,
+ const ChFiDS_TypeOfConcavity T1,
+ const ChFiDS_TypeOfConcavity T2) const
{
List.Clear();
BRep_Builder B;
}
}
-
//=======================================================================
//function : AddFaces
//purpose :
//=======================================================================
-
void BRepOffset_Analyse::AddFaces (const TopoDS_Face& Face,
- TopoDS_Compound& Co,
- TopTools_MapOfShape& Map,
- const ChFiDS_TypeOfConcavity T) const
+ TopoDS_Compound& Co,
+ TopTools_MapOfShape& Map,
+ const ChFiDS_TypeOfConcavity T) const
{
BRep_Builder B;
- TopExp_Explorer exp(Face,TopAbs_EDGE);
- for ( ; exp.More(); exp.Next()) {
- const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
+ const TopTools_ListOfShape *pLE = Descendants (Face);
+ if (!pLE)
+ return;
+ for (TopTools_ListOfShape::Iterator it (*pLE); it.More(); it.Next())
+ {
+ const TopoDS_Edge& E = TopoDS::Edge (it.Value());
const BRepOffset_ListOfInterval& LI = Type(E);
if (!LI.IsEmpty() && LI.First().Type() == T) {
// so <NewFace> is attached to G1 by <Face>
const TopTools_ListOfShape& L = Ancestors(E);
if (L.Extent() == 2) {
- TopoDS_Face F1 = TopoDS::Face(L.First());
- if ( F1.IsSame(Face))
- F1 = TopoDS::Face(L.Last ());
- if ( Map.Add(F1)) {
- B.Add(Co,F1);
- AddFaces(F1,Co,Map,T);
- }
+ TopoDS_Face F1 = TopoDS::Face (L.First());
+ if (F1.IsSame (Face))
+ F1 = TopoDS::Face (L.Last());
+ if (Map.Add (F1)) {
+ B.Add (Co, F1);
+ AddFaces (F1, Co, Map, T);
+ }
}
}
}
}
+
//=======================================================================
//function : AddFaces
//purpose :
//=======================================================================
-
void BRepOffset_Analyse::AddFaces (const TopoDS_Face& Face,
- TopoDS_Compound& Co,
- TopTools_MapOfShape& Map,
- const ChFiDS_TypeOfConcavity T1,
- const ChFiDS_TypeOfConcavity T2) const
+ TopoDS_Compound& Co,
+ TopTools_MapOfShape& Map,
+ const ChFiDS_TypeOfConcavity T1,
+ const ChFiDS_TypeOfConcavity T2) const
{
BRep_Builder B;
- TopExp_Explorer exp(Face,TopAbs_EDGE);
- for ( ; exp.More(); exp.Next()) {
- const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
+ const TopTools_ListOfShape *pLE = Descendants (Face);
+ if (!pLE)
+ return;
+ for (TopTools_ListOfShape::Iterator it (*pLE); it.More(); it.Next())
+ {
+ const TopoDS_Edge& E = TopoDS::Edge (it.Value());
const BRepOffset_ListOfInterval& LI = Type(E);
if (!LI.IsEmpty() &&
- (LI.First().Type() == T1 || LI.First().Type() == T2)) {
+ (LI.First().Type() == T1 || LI.First().Type() == T2)) {
// so <NewFace> is attached to G1 by <Face>
const TopTools_ListOfShape& L = Ancestors(E);
if (L.Extent() == 2) {
- TopoDS_Face F1 = TopoDS::Face(L.First());
- if ( F1.IsSame(Face))
- F1 = TopoDS::Face(L.Last ());
- if ( Map.Add(F1)) {
- B.Add(Co,F1);
- AddFaces(F1,Co,Map,T1,T2);
- }
+ TopoDS_Face F1 = TopoDS::Face (L.First());
+ if (F1.IsSame (Face))
+ F1 = TopoDS::Face (L.Last());
+ if (Map.Add (F1)) {
+ B.Add (Co, F1);
+ AddFaces (F1, Co, Map, T1, T2);
+ }
}
}
}
}
-
#include <Standard_Real.hxx>
#include <BRepOffset_ListOfInterval.hxx>
#include <ChFiDS_TypeOfConcavity.hxx>
+#include <TopTools_DataMapOfShapeListOfShape.hxx>
+#include <TopTools_DataMapOfShapeReal.hxx>
+#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
class TopoDS_Shape;
class TopoDS_Face;
class TopoDS_Compound;
-
-//! Analyse of a shape consit to
-//! Find the part of edges convex concave tangent.
+//! Analyses the shape to find the parts of edges
+//! connecting the convex, concave or tangent faces.
class BRepOffset_Analyse
{
public:
-
DEFINE_STANDARD_ALLOC
-
+public: //! @name Constructors
+
+ //! Empty c-tor
Standard_EXPORT BRepOffset_Analyse();
+
+ //! C-tor performing the job inside
+ Standard_EXPORT BRepOffset_Analyse (const TopoDS_Shape& theS,
+ const Standard_Real theAngle);
- Standard_EXPORT BRepOffset_Analyse(const TopoDS_Shape& S, const Standard_Real Angle);
-
- Standard_EXPORT void Perform (const TopoDS_Shape& S, const Standard_Real Angle);
-
- Standard_EXPORT Standard_Boolean IsDone() const;
-
- Standard_EXPORT void Clear();
-
- Standard_EXPORT const BRepOffset_ListOfInterval& Type (const TopoDS_Edge& E) const;
-
+public: //! @name Performing analysis
+
+ //! Performs the analysis
+ Standard_EXPORT void Perform (const TopoDS_Shape& theS,
+ const Standard_Real theAngle);
+
+public: //! @name Results
+
+ //! Returns status of the algorithm
+ Standard_Boolean IsDone() const
+ {
+ return myDone;
+ }
+
+ //! Returns the connectivity type of the edge
+ Standard_EXPORT const BRepOffset_ListOfInterval& Type (const TopoDS_Edge& theE) const;
+
//! Stores in <L> all the edges of Type <T>
//! on the vertex <V>.
- Standard_EXPORT void Edges (const TopoDS_Vertex& V,
- const ChFiDS_TypeOfConcavity T,
- TopTools_ListOfShape& L) const;
+ Standard_EXPORT void Edges (const TopoDS_Vertex& theV,
+ const ChFiDS_TypeOfConcavity theType,
+ TopTools_ListOfShape& theL) const;
//! Stores in <L> all the edges of Type <T>
//! on the face <F>.
- Standard_EXPORT void Edges (const TopoDS_Face& F,
- const ChFiDS_TypeOfConcavity T,
- TopTools_ListOfShape& L) const;
+ Standard_EXPORT void Edges (const TopoDS_Face& theF,
+ const ChFiDS_TypeOfConcavity theType,
+ TopTools_ListOfShape& theL) const;
//! set in <Edges> all the Edges of <Shape> which are
//! tangent to <Edge> at the vertex <Vertex>.
- Standard_EXPORT void TangentEdges (const TopoDS_Edge& Edge,
- const TopoDS_Vertex& Vertex,
- TopTools_ListOfShape& Edges) const;
-
- Standard_EXPORT Standard_Boolean HasAncestor (const TopoDS_Shape& S) const;
-
- Standard_EXPORT const TopTools_ListOfShape& Ancestors (const TopoDS_Shape& S) const;
+ Standard_EXPORT void TangentEdges (const TopoDS_Edge& theEdge,
+ const TopoDS_Vertex& theVertex,
+ TopTools_ListOfShape& theEdges) const;
+
+ //! Checks if the given shape has ancestors
+ Standard_Boolean HasAncestor (const TopoDS_Shape& theS) const
+ {
+ return myAncestors.Contains (theS);
+ }
+
+ //! Returns ancestors for the shape
+ const TopTools_ListOfShape& Ancestors (const TopoDS_Shape& theS) const
+ {
+ return myAncestors.FindFromKey (theS);
+ }
//! Explode in compounds of faces where
//! all the connex edges are of type <Side>
- Standard_EXPORT void Explode (TopTools_ListOfShape& L,
- const ChFiDS_TypeOfConcavity Type) const;
+ Standard_EXPORT void Explode (TopTools_ListOfShape& theL,
+ const ChFiDS_TypeOfConcavity theType) const;
//! Explode in compounds of faces where
//! all the connex edges are of type <Side1> or <Side2>
- Standard_EXPORT void Explode (TopTools_ListOfShape& L,
- const ChFiDS_TypeOfConcavity Type1,
- const ChFiDS_TypeOfConcavity Type2) const;
+ Standard_EXPORT void Explode (TopTools_ListOfShape& theL,
+ const ChFiDS_TypeOfConcavity theType1,
+ const ChFiDS_TypeOfConcavity theType2) const;
//! Add in <CO> the faces of the shell containing <Face>
//! where all the connex edges are of type <Side>.
- Standard_EXPORT void AddFaces (const TopoDS_Face& Face,
- TopoDS_Compound& Co,
- TopTools_MapOfShape& Map,
- const ChFiDS_TypeOfConcavity Type) const;
+ Standard_EXPORT void AddFaces (const TopoDS_Face& theFace,
+ TopoDS_Compound& theCo,
+ TopTools_MapOfShape& theMap,
+ const ChFiDS_TypeOfConcavity theType) const;
//! Add in <CO> the faces of the shell containing <Face>
//! where all the connex edges are of type <Side1> or <Side2>.
- Standard_EXPORT void AddFaces (const TopoDS_Face& Face,
- TopoDS_Compound& Co,
- TopTools_MapOfShape& Map,
- const ChFiDS_TypeOfConcavity Type1,
- const ChFiDS_TypeOfConcavity Type2) const;
-
-
-
-
-protected:
-
-
+ Standard_EXPORT void AddFaces (const TopoDS_Face& theFace,
+ TopoDS_Compound& theCo,
+ TopTools_MapOfShape& theMap,
+ const ChFiDS_TypeOfConcavity theType1,
+ const ChFiDS_TypeOfConcavity theType2) const;
+
+ void SetOffsetValue (const Standard_Real theOffset)
+ {
+ myOffset = theOffset;
+ }
+
+ //! Sets the face-offset data map to analyze tangential cases
+ void SetFaceOffsetMap (const TopTools_DataMapOfShapeReal& theMap)
+ {
+ myFaceOffsetMap = theMap;
+ }
+
+ //! Returns the new faces constructed between tangent faces
+ //! having different offset values on the shape
+ const TopTools_ListOfShape& NewFaces() const { return myNewFaces; }
+
+ //! Returns the new face constructed for the edge connecting
+ //! the two tangent faces having different offset values
+ Standard_EXPORT TopoDS_Shape Generated (const TopoDS_Shape& theS) const;
+
+ //! Checks if the edge has generated a new face.
+ Standard_Boolean HasGenerated (const TopoDS_Shape& theS) const
+ {
+ return myGenerated.Seek (theS) != NULL;
+ }
+
+ //! Returns the replacement of the edge in the face.
+ //! If no replacement exists, returns the edge
+ Standard_EXPORT const TopoDS_Edge& EdgeReplacement (const TopoDS_Face& theFace,
+ const TopoDS_Edge& theEdge) const;
+
+ //! Returns the shape descendants.
+ Standard_EXPORT const TopTools_ListOfShape* Descendants (const TopoDS_Shape& theS,
+ const Standard_Boolean theUpdate = Standard_False) const;
+
+public: //! @name Clearing the content
+
+ //! Clears the content of the algorithm
+ Standard_EXPORT void Clear();
+private: //! @name Treatment of tangential cases
+ //! Treatment of the tangential cases.
+ //! @param theEdges List of edges connecting tangent faces
+ Standard_EXPORT void TreatTangentFaces (const TopTools_ListOfShape& theEdges);
-private:
+private: //! @name Fields
+ // Inputs
+ TopoDS_Shape myShape; //!< Input shape to analyze
+ Standard_Real myAngle; //!< Criteria angle to check tangency
+ Standard_Real myOffset; //!< Offset value
+ TopTools_DataMapOfShapeReal myFaceOffsetMap; //!< Map to store offset values for the faces.
+ //! Should be set by the calling algorithm.
- Standard_Boolean myDone;
- TopoDS_Shape myShape;
- BRepOffset_DataMapOfShapeListOfInterval mapEdgeType;
- TopTools_IndexedDataMapOfShapeListOfShape ancestors;
- Standard_Real angle;
+ // Results
+ Standard_Boolean myDone; //!< Status of the algorithm
+ BRepOffset_DataMapOfShapeListOfInterval myMapEdgeType; //!< Map containing the list of intervals on the edge
+ TopTools_IndexedDataMapOfShapeListOfShape myAncestors; //!< Ancestors map
+ NCollection_DataMap<TopoDS_Shape,
+ TopTools_DataMapOfShapeShape,
+ TopTools_ShapeMapHasher> myReplacement; //!< Replacement of an edge in the face
+ mutable TopTools_DataMapOfShapeListOfShape myDescendants; //!< Map of shapes descendants built on the base of
+ //!< Ancestors map. Filled on the first query.
+ TopTools_ListOfShape myNewFaces; //!< New faces generated to close the gaps between adjacent
+ //! tangential faces having different offset values
+ TopTools_DataMapOfShapeShape myGenerated; //!< Binding between edge and face generated from the edge
};
-
-
-
-
-
-
#endif // _BRepOffset_Analyse_HeaderFile
#include <BRepAlgo_AsDes.hxx>
#include <BRepLib.hxx>
#include <BRepLib_MakeVertex.hxx>
+#include <BRepOffset_Analyse.hxx>
#include <BRepOffset_Inter2d.hxx>
#include <BRepOffset_Offset.hxx>
#include <BRepOffset_Tool.hxx>
const Handle(BRepAlgo_AsDes)& AsDes2d,
const Standard_Real Offset,
const Standard_Real Tol,
+ const BRepOffset_Analyse& Analyse,
TopTools_IndexedMapOfShape& FacesWithVerts,
TopTools_IndexedDataMapOfShapeListOfShape& theDMVV)
{
TopoDS_Vertex Vref = CommonVertex(CurE, NextE);
gp_Pnt Pref = BRep_Tool::Pnt(Vref);
+ CurE = Analyse.EdgeReplacement (FI, CurE);
+ NextE = Analyse.EdgeReplacement (FI, NextE);
+
TopoDS_Shape aLocalShape = OFI.Generated(CurE);
TopoDS_Edge CEO = TopoDS::Edge(aLocalShape);
aLocalShape = OFI.Generated(NextE);
}
}
else {
- if (MES.IsBound(CEO)) {
- TopoDS_Vertex V = CommonVertex(CEO,NEO);
- UpdateVertex (V,CEO,TopoDS::Edge(MES(CEO)),Tol);
- AsDes2d->Add (MES(CEO),V);
- }
- else if (MES.IsBound(NEO)) {
- TopoDS_Vertex V = CommonVertex(CEO,NEO);
- UpdateVertex (V,NEO,TopoDS::Edge(MES(NEO)),Tol);
- AsDes2d->Add (MES(NEO),V);
+ TopoDS_Vertex V = CommonVertex(CEO,NEO);
+ if (!V.IsNull())
+ {
+ if (MES.IsBound(CEO)) {
+ UpdateVertex (V,CEO,TopoDS::Edge(MES(CEO)),Tol);
+ AsDes2d->Add (MES(CEO),V);
+ }
+ if (MES.IsBound(NEO)) {
+ UpdateVertex (V,NEO,TopoDS::Edge(MES(NEO)),Tol);
+ AsDes2d->Add (MES(NEO),V);
+ }
}
}
- CurE = NextE;
+ CurE = wexp.Current();
ToReverse1 = ToReverse2;
}
}
const Handle(BRepAlgo_AsDes)& AsDes,
const Handle(BRepAlgo_AsDes)& AsDes2d,
const Standard_Real Tol,
+ const BRepOffset_Analyse& Analyse,
TopTools_IndexedDataMapOfShapeListOfShape& theDMVV)
{
TopoDS_Face FIO = TopoDS::Face(OFI.Face());
CurE = NextE;
continue;
}
- //
+
+ CurE = Analyse.EdgeReplacement (FI, CurE);
+ NextE = Analyse.EdgeReplacement (FI, NextE);
+
TopoDS_Shape aLocalShape = OFI.Generated(CurE);
TopoDS_Edge CEO = TopoDS::Edge(aLocalShape);
aLocalShape = OFI.Generated(NextE);
NE2 = MES(CEO);
}
else {
- CurE = NextE;
+ CurE = wexp.Current();
continue;
}
//
}
}
}
- CurE = NextE;
+ CurE = wexp.Current();
}
}
}
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
class BRepAlgo_AsDes;
class TopoDS_Face;
+class BRepOffset_Analyse;
class BRepOffset_Offset;
const Handle(BRepAlgo_AsDes)& AsDes2d,
const Standard_Real Offset,
const Standard_Real Tol,
+ const BRepOffset_Analyse& Analyse,
TopTools_IndexedMapOfShape& FacesWithVerts,
TopTools_IndexedDataMapOfShapeListOfShape& theDMVV);
const Handle(BRepAlgo_AsDes)& AsDes,
const Handle(BRepAlgo_AsDes)& AsDes2d,
const Standard_Real Tol,
+ const BRepOffset_Analyse& Analyse,
TopTools_IndexedDataMapOfShapeListOfShape& theDMVV);
//! Fuses the chains of vertices in the theDMVV
TopTools_ListOfShape& Failed,
const Standard_Boolean bIsPlanar)
{
- //TopExp_Explorer Exp(SI,TopAbs_EDGE);
TopTools_IndexedMapOfShape VEmap;
- TopTools_IndexedDataMapOfShapeListOfShape aMVF;
TopoDS_Face F1,F2,OF1,OF2,NF1,NF2;
TopAbs_State CurSide = mySide;
BRep_Builder B;
Standard_Boolean bEdge;
- Standard_Integer i, aNb;
+ Standard_Integer i, aNb = 0;
TopTools_ListIteratorOfListOfShape it, it1, itF1, itF2;
//
- TopExp::MapShapes(SI, TopAbs_EDGE , VEmap);
- // map the shape for vertices
- if (bIsPlanar) {
+ TopExp::MapShapes (SI, TopAbs_EDGE, VEmap);
+ // Take the vertices for treatment
+ if (bIsPlanar)
+ {
+ aNb = VEmap.Extent();
+ for (i = 1; i <= aNb; ++i)
+ {
+ const TopoDS_Edge& aE = TopoDS::Edge (VEmap (i));
+ TopoDS_Shape aFGen = Analyse.Generated (aE);
+ if (!aFGen.IsNull())
+ TopExp::MapShapes (aFGen, TopAbs_EDGE, VEmap);
+ }
+
+ // Add vertices for treatment
TopExp::MapShapes(SI, TopAbs_VERTEX, VEmap);
- //
- // make vertex-faces connexity map with unique ancestors
- TopExp::MapShapesAndUniqueAncestors(SI, TopAbs_VERTEX, TopAbs_FACE, aMVF);
+
+ for (TopTools_ListOfShape::Iterator itNF (Analyse.NewFaces()); itNF.More(); itNF.Next())
+ TopExp::MapShapes (itNF.Value(), TopAbs_VERTEX, VEmap);
}
//
TopTools_DataMapOfShapeListOfShape aDMVLF1, aDMVLF2, aDMIntFF;
TopTools_IndexedDataMapOfShapeListOfShape aDMIntE;
//
- if (bIsPlanar) {
- aNb = VEmap.Extent();
- for (i = 1; i <= aNb; ++i) {
+ if (bIsPlanar)
+ {
+ // Find internal edges in the faces to skip them while preparing faces
+ // for intersection through vertices
+ NCollection_DataMap<TopoDS_Shape, TopTools_MapOfShape, TopTools_ShapeMapHasher> aDMFEI;
+ {
+ for (TopExp_Explorer expF (SI, TopAbs_FACE); expF.More(); expF.Next())
+ {
+ const TopoDS_Shape& aFx = expF.Current();
+
+ TopTools_MapOfShape aMEI;
+ for (TopExp_Explorer expE (aFx, TopAbs_EDGE); expE.More(); expE.Next())
+ {
+ const TopoDS_Shape& aEx = expE.Current();
+ if (aEx.Orientation() != TopAbs_FORWARD &&
+ aEx.Orientation() != TopAbs_REVERSED)
+ aMEI.Add (aEx);
+ }
+ if (!aMEI.IsEmpty())
+ aDMFEI.Bind (aFx, aMEI);
+ }
+ }
+
+ // Analyze faces connected through vertices
+ for (i = aNb + 1, aNb = VEmap.Extent(); i <= aNb; ++i)
+ {
const TopoDS_Shape& aS = VEmap(i);
- if (aS.ShapeType() != TopAbs_VERTEX) {
+ if (aS.ShapeType() != TopAbs_VERTEX)
continue;
+
+ // Find faces connected to the vertex
+ TopTools_ListOfShape aLF;
+ {
+ const TopTools_ListOfShape& aLE = Analyse.Ancestors (aS);
+ for (TopTools_ListOfShape::Iterator itLE (aLE); itLE.More(); itLE.Next())
+ {
+ const TopTools_ListOfShape& aLEA = Analyse.Ancestors (itLE.Value());
+ for (TopTools_ListOfShape::Iterator itLEA (aLEA); itLEA.More(); itLEA.Next())
+ {
+ if (!aLF.Contains (itLEA.Value()))
+ aLF.Append (itLEA.Value());
+ }
+ }
}
- //
- // faces connected by the vertex
- const TopTools_ListOfShape& aLF = aMVF.FindFromKey(aS);
- if (aLF.Extent() < 2) {
+
+ if (aLF.Extent() < 2)
continue;
- }
+
// build lists of faces connected to the same vertex by looking for
// the pairs in which the vertex is alone (not connected to shared edges)
TopTools_ListOfShape aLF1, aLF2;
- //
+
it.Initialize(aLF);
- for (; it.More(); it.Next()) {
+ for (; it.More(); it.Next())
+ {
const TopoDS_Shape& aFV1 = it.Value();
- //
+
// get edges of first face connected to current vertex
TopTools_MapOfShape aME;
- TopExp_Explorer aExp(aFV1, TopAbs_EDGE);
- for (; aExp.More(); aExp.Next()) {
- const TopoDS_Shape& aE = aExp.Current();
- if (aE.Orientation() != TopAbs_FORWARD &&
- aE.Orientation() != TopAbs_REVERSED)
- // Face is connected to the vertex through internal edge
+ const TopTools_MapOfShape *pF1Internal = aDMFEI.Seek (aFV1);
+ const TopTools_ListOfShape* pLE1 = Analyse.Descendants (aFV1);
+ if (!pLE1)
+ continue;
+ TopTools_ListOfShape::Iterator itLE1 (*pLE1);
+ for (; itLE1.More(); itLE1.Next())
+ {
+ const TopoDS_Shape& aE = itLE1.Value();
+ if (pF1Internal && pF1Internal->Contains (aE))
break;
- TopoDS_Iterator aItV(aE);
- for (; aItV.More(); aItV.Next()) {
- if (aS.IsSame(aItV.Value())) {
+ for (TopoDS_Iterator aItV(aE); aItV.More(); aItV.Next())
+ {
+ if (aS.IsSame (aItV.Value()))
+ {
aME.Add(aE);
break;
}
}
}
- if (aExp.More())
+ if (itLE1.More())
continue;
// get to the next face in the list
it1 = it;
for (it1.Next(); it1.More(); it1.Next()) {
- const TopoDS_Shape& aFV2 = it1.Value();
- //
- aExp.Init(aFV2, TopAbs_EDGE);
- for (; aExp.More(); aExp.Next()) {
- const TopoDS_Shape& aEV2 = aExp.Current();
- if (aME.Contains(aEV2) &&
- (Analyse.Ancestors(aEV2).Extent() == 2 || // Multi-connexity is not supported in Analyzer
- (aEV2.Orientation() != TopAbs_FORWARD && // Avoid intersection of faces connected by internal edge
- aEV2.Orientation() != TopAbs_REVERSED))) {
+ const TopoDS_Face& aFV2 = TopoDS::Face (it1.Value());
+
+ const TopTools_MapOfShape *pF2Internal = aDMFEI.Seek (aFV2);
+
+ const TopTools_ListOfShape* pLE2 = Analyse.Descendants (aFV2);
+ if (!pLE2)
+ continue;
+ TopTools_ListOfShape::Iterator itLE2 (*pLE2);
+ for (; itLE2.More(); itLE2.Next())
+ {
+ const TopoDS_Shape& aEV2 = itLE2.Value();
+ if (!aME.Contains (aEV2))
+ continue;
+
+ if (pF2Internal && pF2Internal->Contains (aEV2))
+ // Avoid intersection of faces connected by internal edge
+ break;
+
+ if (Analyse.HasAncestor (aEV2) &&
+ Analyse.Ancestors (aEV2).Extent() == 2)
+ // Faces will be intersected through the edge
break;
- }
}
- //
- if (!aExp.More()) {
- // faces share only vertex - make pair for intersection
+
+ if (!itLE2.More())
+ {
aLF1.Append(aFV1);
aLF2.Append(aFV2);
}
// static methods
//=======================================================================
static
- void GetEnlargedFaces(const TopoDS_Shape& theShape,
+ void GetEnlargedFaces(const TopTools_ListOfShape& theFaces,
const BRepOffset_DataMapOfShapeOffset& theMapSF,
const TopTools_DataMapOfShapeShape& theMES,
TopTools_DataMapOfShapeShape& theFacesOrigins,
static
void TrimEdges(const TopoDS_Shape& theShape,
const Standard_Real theOffset,
+ const BRepOffset_Analyse& Analyse,
BRepOffset_DataMapOfShapeOffset& theMapSF,
TopTools_DataMapOfShapeShape& theMES,
TopTools_DataMapOfShapeShape& theBuild,
myFaceOffset .Clear();
myAsDes ->Clear();
myDone = Standard_False;
+ myGenerated.Clear();
+ myResMap.Clear();
}
//=======================================================================
// There are possible second variant: analytical continuation of arcsin.
Standard_Real TolAngleCoeff = Min(myTol / (Abs(myOffset * 0.5) + Precision::Confusion()), 1.0);
Standard_Real TolAngle = 4*ASin(TolAngleCoeff);
+ if ((myJoin == GeomAbs_Intersection) && myInter && myIsPlanar)
+ {
+ myAnalyse.SetOffsetValue (myOffset);
+ myAnalyse.SetFaceOffsetMap (myFaceOffset);
+ }
myAnalyse.Perform(myShape,TolAngle);
//---------------------------------------------------
// Construction of Offset from preanalysis.
// Coding of regularities.
//----------------------------------
EncodeRegularity();
+ //----------------------------------
+ // Replace roots in history maps
+ //----------------------------------
+ ReplaceRoots();
//----------------------
// Creation of solids.
//----------------------
TopTools_ListIteratorOfListOfShape itl(Let);
for (; itl.More(); itl.Next()) {
const TopoDS_Edge& Cur = TopoDS::Edge(itl.Value());
- if ( !ShapeTgt.IsBound(Cur)) {
+ if ( !ShapeTgt.IsBound(Cur) && !myAnalyse.HasGenerated (Cur)) {
TopoDS_Shape aLocalShape = OF.Generated(Cur);
const TopoDS_Edge& OTE = TopoDS::Edge(aLocalShape);
ShapeTgt.Bind(Cur,OF.Generated(Cur));
}
theMapSF.Bind(aF,OF);
}
+ //
+ const TopTools_ListOfShape& aNewFaces = myAnalyse.NewFaces();
+ for (TopTools_ListOfShape::Iterator it (aNewFaces); it.More(); it.Next())
+ {
+ const TopoDS_Face& aF = TopoDS::Face (it.Value());
+ BRepOffset_Offset OF(aF, 0.0, ShapeTgt, OffsetOutside, myJoin);
+ theMapSF.Bind (aF, OF);
+ }
}
//=======================================================================
// Intersection with caps.
Inter3.ContextIntByInt(myFaces,ExtentContext,MapSF,myAnalyse,MES,Build,Failed,myIsPlanar);
+ TopTools_ListOfShape aLFaces;
+ for (Exp.Init(myShape,TopAbs_FACE) ; Exp.More(); Exp.Next())
+ aLFaces.Append (Exp.Current());
+
+ for (TopTools_ListOfShape::Iterator it (myAnalyse.NewFaces()); it.More(); it.Next())
+ aLFaces.Append (it.Value());
//---------------------------------------------------------------------------------
// Extension of neighbor edges of new edges and intersection between neighbors.
//--------------------------------------------------------------------------------
Handle(BRepAlgo_AsDes) AsDes2d = new BRepAlgo_AsDes();
- IntersectEdges(myShape, MapSF, MES, Build, AsDes, AsDes2d);
+ IntersectEdges(aLFaces, MapSF, MES, Build, AsDes, AsDes2d);
//-----------------------------------------------------------
// Great restriction of new edges and update of AsDes.
//------------------------------------------ ----------------
//Map of edges obtained after FACE-FACE (offsetted) intersection.
//Key1 is edge trimmed by intersection points with other edges;
//Item is not-trimmed edge.
- TrimEdges(myShape, myOffset, MapSF, MES, Build, AsDes, AsDes2d, NewEdges, aETrimEInf, anEdgesOrigins);
+ TrimEdges(myShape, myOffset, myAnalyse, MapSF, MES, Build, AsDes, AsDes2d, NewEdges, aETrimEInf, anEdgesOrigins);
//
//---------------------------------
// Intersection 2D on //
TopTools_DataMapOfShapeShape aFacesOrigins; // offset face - initial face
TopTools_ListOfShape LFE;
BRepAlgo_Image IMOE;
- GetEnlargedFaces(myShape, MapSF, MES, aFacesOrigins, IMOE, LFE);
+ GetEnlargedFaces(aLFaces, MapSF, MES, aFacesOrigins, IMOE, LFE);
//
TopTools_ListIteratorOfListOfShape itLFE(LFE);
for (; itLFE.More(); itLFE.Next())
TopTools_MapOfShape aMFDone;
//
if ((myJoin == GeomAbs_Intersection) && myInter && myIsPlanar) {
- BuildSplitsOfExtendedFaces(LFE, AsDes, anEdgesOrigins, aFacesOrigins, aETrimEInf, IMOE);
+ BuildSplitsOfExtendedFaces(LFE, myAnalyse, AsDes, anEdgesOrigins, aFacesOrigins, aETrimEInf, IMOE);
//
TopTools_ListIteratorOfListOfShape aItLF(LFE);
for (; aItLF.More(); aItLF.Next()) {
//---------------------------
// MAJ SD. for faces //
//---------------------------
- for (Exp.Init(myShape,TopAbs_FACE) ; Exp.More(); Exp.Next()) {
- const TopoDS_Shape& FI = Exp.Current();
+ for (TopTools_ListOfShape::Iterator it (aLFaces); it.More(); it.Next())
+ {
+ const TopoDS_Shape& FI = it.Value();
myInitOffsetFace.SetRoot(FI);
TopoDS_Face OF = MapSF(FI).Face();
if (MES.IsBound(OF)) {
// Add methods for supporting history.
TopTools_MapOfShape aMapEdges;
- for (Exp.Init(myShape,TopAbs_FACE) ; Exp.More(); Exp.Next()) {
- const TopoDS_Shape& aFaceRef = Exp.Current();
-
+ for (TopTools_ListOfShape::Iterator it (aLFaces); it.More(); it.Next())
+ {
+ const TopoDS_Shape& aFaceRef = it.Value();
Exp2.Init(aFaceRef.Oriented(TopAbs_FORWARD), TopAbs_EDGE);
for (; Exp2.More(); Exp2.Next()) {
DEBVerticesControl (COES,myAsDes);
if ( ChronBuild) Clock.Show();
#endif
+
+}
+
+//=======================================================================
+//function : ReplaceRoots
+//purpose :
+//=======================================================================
+void BRepOffset_MakeOffset::ReplaceRoots()
+{
+ // Replace the artificial faces and edges in InitOffset maps with the original ones.
+ TopTools_MapOfShape View;
+ for (TopExp_Explorer anExpF (myShape, TopAbs_EDGE); anExpF.More(); anExpF.Next())
+ {
+ const TopoDS_Shape& aF = anExpF.Current();
+ for (TopExp_Explorer anExpE (aF, TopAbs_EDGE); anExpE.More(); anExpE.Next())
+ {
+ const TopoDS_Shape& aE = anExpE.Current();
+ if (!View.Add (aE))
+ continue;
+
+ TopoDS_Shape aFGen = myAnalyse.Generated (aE);
+ if (aFGen.IsNull())
+ continue;
+
+ myInitOffsetFace.ReplaceRoot (aFGen, aE);
+
+ for (TopoDS_Iterator itV (aE); itV.More(); itV.Next())
+ {
+ const TopoDS_Shape& aV = itV.Value();
+ if (!View.Add (aV))
+ continue;
+
+ TopoDS_Shape aEGen = myAnalyse.Generated (aV);
+ if (aEGen.IsNull())
+ continue;
+
+ myInitOffsetEdge.ReplaceRoot (aEGen, aV);
+ }
+ }
+ }
}
//=======================================================================
//function : IntersectEdges
//purpose :
//=======================================================================
-void BRepOffset_MakeOffset::IntersectEdges(const TopoDS_Shape& theShape,
+void BRepOffset_MakeOffset::IntersectEdges(const TopTools_ListOfShape& theFaces,
BRepOffset_DataMapOfShapeOffset& theMapSF,
TopTools_DataMapOfShapeShape& theMES,
TopTools_DataMapOfShapeShape& theBuild,
{
Standard_Real aTolF;
TopTools_IndexedDataMapOfShapeListOfShape aDMVV;
- TopExp_Explorer aExp(theShape, TopAbs_FACE);
// intersect edges created from edges
TopTools_IndexedMapOfShape aMFV;
- for (; aExp.More(); aExp.Next()) {
- const TopoDS_Face& aF = TopoDS::Face(aExp.Current());
- aTolF = BRep_Tool::Tolerance(aF);
+ for (TopTools_ListOfShape::Iterator it (theFaces); it.More(); it.Next())
+ {
+ const TopoDS_Face& aF = TopoDS::Face (it.Value());
+ aTolF = BRep_Tool::Tolerance (aF);
BRepOffset_Inter2d::ConnexIntByInt
- (aF, theMapSF(aF), theMES, theBuild, theAsDes2d, myOffset, aTolF, aMFV, aDMVV);
+ (aF, theMapSF (aF), theMES, theBuild, theAsDes2d, myOffset, aTolF, myAnalyse, aMFV, aDMVV);
}
// intersect edges created from vertices
Standard_Integer i, aNbF = aMFV.Extent();
const TopoDS_Face& aF = TopoDS::Face(aMFV(i));
aTolF = BRep_Tool::Tolerance(aF);
BRepOffset_Inter2d::ConnexIntByIntInVert
- (aF, theMapSF(aF), theMES, theBuild, theAsDes, theAsDes2d, aTolF, aDMVV);
+ (aF, theMapSF(aF), theMES, theBuild, theAsDes, theAsDes2d, aTolF, myAnalyse, aDMVV);
}
//
// fuse vertices on edges
//=======================================================================
void TrimEdges(const TopoDS_Shape& theShape,
const Standard_Real theOffset,
+ const BRepOffset_Analyse& Analyse,
BRepOffset_DataMapOfShapeOffset& theMapSF,
TopTools_DataMapOfShapeShape& theMES,
TopTools_DataMapOfShapeShape& theBuild,
TopoDS_Shape NE;
TopoDS_Edge TNE;
TopoDS_Face NF;
- //
- for (Exp.Init(theShape,TopAbs_FACE) ; Exp.More(); Exp.Next()) {
- const TopoDS_Face& FI = TopoDS::Face(Exp.Current());
+
+ TopTools_ListOfShape aLFaces;
+ for (Exp.Init (theShape, TopAbs_FACE); Exp.More(); Exp.Next())
+ aLFaces.Append (Exp.Current());
+
+ TopTools_MapOfShape aMFGenerated;
+ TopTools_IndexedDataMapOfShapeListOfShape aDMEF;
+ for (TopTools_ListOfShape::Iterator it (Analyse.NewFaces()); it.More(); it.Next())
+ {
+ const TopoDS_Shape& aFG = it.Value();
+ aLFaces.Append (aFG);
+ aMFGenerated.Add (aFG);
+ TopExp::MapShapesAndUniqueAncestors (aFG, TopAbs_EDGE, TopAbs_FACE, aDMEF);
+ }
+
+ for (TopTools_ListOfShape::Iterator it (aLFaces); it.More(); it.Next())
+ {
+ const TopoDS_Face& FI = TopoDS::Face (it.Value());
NF = theMapSF(FI).Face();
if (theMES.IsBound(NF)) {
NF = TopoDS::Face(theMES(NF));
if (aS.ShapeType() != TopAbs_EDGE) {
continue;
}
- //
+ if (aMFGenerated.Contains (FI) && aDMEF.FindFromKey (aS).Extent() == 1)
+ continue;
+
NE = theMapSF(FI).Generated(aS);
//// modified by jgv, 19.12.03 for OCC4455 ////
NE.Orientation(aS.Orientation());
//function : GetEnlargedFaces
//purpose :
//=======================================================================
-void GetEnlargedFaces(const TopoDS_Shape& theShape,
+void GetEnlargedFaces(const TopTools_ListOfShape& theFaces,
const BRepOffset_DataMapOfShapeOffset& theMapSF,
const TopTools_DataMapOfShapeShape& theMES,
TopTools_DataMapOfShapeShape& theFacesOrigins,
BRepAlgo_Image& theImage,
TopTools_ListOfShape& theLSF)
{
- TopExp_Explorer aExp(theShape, TopAbs_FACE);
- for (; aExp.More(); aExp.Next()) {
- const TopoDS_Shape& FI = aExp.Current();
+ for (TopTools_ListOfShape::Iterator it (theFaces); it.More(); it.Next())
+ {
+ const TopoDS_Shape& FI = it.Value();
const TopoDS_Shape& OFI = theMapSF(FI).Face();
if (theMES.IsBound(OFI)) {
const TopoDS_Face& aLocalFace = TopoDS::Face(theMES(OFI));
theLSF.Append(aLocalFace);
theImage.SetRoot(aLocalFace);
- //
theFacesOrigins.Bind(aLocalFace, FI);
}
}
return GetSubShapes(aResult3, TopAbs_SHELL, theShells);
}
+//=======================================================================
+//function : Generated
+//purpose :
+//=======================================================================
+const TopTools_ListOfShape& BRepOffset_MakeOffset::Generated (const TopoDS_Shape& theS)
+{
+ myGenerated.Clear();
+ const TopAbs_ShapeEnum aType = theS.ShapeType();
+ switch (aType)
+ {
+ case TopAbs_VERTEX:
+ {
+ if (myAnalyse.HasAncestor (theS))
+ {
+ TopTools_MapOfShape aMFence;
+ const TopTools_ListOfShape& aLA = myAnalyse.Ancestors (theS);
+ TopTools_ListOfShape::Iterator itLA (aLA);
+ for (; myGenerated.IsEmpty() && itLA.More(); itLA.Next())
+ {
+ const TopoDS_Shape& aE = itLA.Value();
+ if (!myInitOffsetEdge.HasImage (aE))
+ continue;
+ TopTools_ListOfShape aLEIm;
+ myInitOffsetEdge.LastImage (aE, aLEIm);
+ TopTools_ListOfShape::Iterator itLEIm (aLEIm);
+ for (; myGenerated.IsEmpty() && itLEIm.More(); itLEIm.Next())
+ {
+ TopoDS_Iterator itV (itLEIm.Value());
+ for (; itV.More(); itV.Next())
+ {
+ if (!aMFence.Add (itV.Value()))
+ {
+ myGenerated.Append (itV.Value());
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ Standard_FALLTHROUGH
+ case TopAbs_EDGE:
+ {
+ if (myInitOffsetEdge.HasImage (theS))
+ {
+ myInitOffsetEdge.LastImage (theS, myGenerated);
+ }
+ }
+ Standard_FALLTHROUGH
+ case TopAbs_FACE:
+ {
+ if (myInitOffsetFace.HasImage (theS))
+ {
+ myInitOffsetFace.LastImage (theS, myGenerated);
+ }
+ break;
+ }
+ case TopAbs_SOLID:
+ {
+ if (theS.IsSame (myShape))
+ myGenerated.Append (myOffsetShape);
+ break;
+ }
+ default:
+ break;
+ }
+
+ if (myResMap.IsEmpty())
+ TopExp::MapShapes (myOffsetShape, myResMap);
+
+ for (TopTools_ListOfShape::Iterator it (myGenerated); it.More();)
+ {
+ if (myResMap.Contains (it.Value()))
+ it.Next();
+ else
+ myGenerated.Remove (it);
+ }
+
+ return myGenerated;
+}
+
+//=======================================================================
+//function : Modified
+//purpose :
+//=======================================================================
+const TopTools_ListOfShape& BRepOffset_MakeOffset::Modified (const TopoDS_Shape&)
+{
+ myGenerated.Clear();
+ return myGenerated;
+}
+
+//=======================================================================
+//function : IsDeleted
+//purpose :
+//=======================================================================
+Standard_Boolean BRepOffset_MakeOffset::IsDeleted (const TopoDS_Shape& theS)
+{
+ if (myResMap.IsEmpty())
+ TopExp::MapShapes (myOffsetShape, myResMap);
+
+ if (myResMap.Contains (theS))
+ return Standard_False;
+
+ return Generated (theS).IsEmpty()
+ && Modified (theS).IsEmpty();
+}
+
//=======================================================================
//function : GetSubShapes
//purpose :
Standard_EXPORT const TopoDS_Shape& Shape() const;
+ const TopoDS_Shape& InitShape() const
+ {
+ return myShape;
+ }
+
//! returns information about offset state.
Standard_EXPORT BRepOffset_Error Error() const;
//! Return bad shape, which obtained in CheckInputData.
Standard_EXPORT const TopoDS_Shape& GetBadShape() const;
+public: //! @name History methods
+
+ //! Returns the list of shapes generated from the shape <S>.
+ Standard_EXPORT const TopTools_ListOfShape& Generated (const TopoDS_Shape& theS);
+
+ //! Returns the list of shapes modified from the shape <S>.
+ Standard_EXPORT const TopTools_ListOfShape& Modified (const TopoDS_Shape& theS);
+
+ //! Returns true if the shape S has been deleted.
+ Standard_EXPORT Standard_Boolean IsDeleted (const TopoDS_Shape& S);
+
protected:
Standard_EXPORT void EncodeRegularity();
+ //! Replace roots in history maps
+ Standard_EXPORT void ReplaceRoots();
+
Standard_EXPORT void MakeSolid();
Standard_EXPORT void ToContext (BRepOffset_DataMapOfShapeOffset& MapSF);
Standard_EXPORT void RemoveInternalEdges();
//! Intersects edges
- Standard_EXPORT void IntersectEdges (const TopoDS_Shape& theShape,
+ Standard_EXPORT void IntersectEdges (const TopTools_ListOfShape& theFaces,
BRepOffset_DataMapOfShapeOffset& theMapSF,
TopTools_DataMapOfShapeShape& theMES,
TopTools_DataMapOfShapeShape& theBuild,
//! for BRepOffset_MakeLoops::Build method.
//! Currently the Complete intersection mode is limited to work only on planar cases.
Standard_EXPORT void BuildSplitsOfExtendedFaces(const TopTools_ListOfShape& theLF,
+ const BRepOffset_Analyse& theAnalyse,
Handle(BRepAlgo_AsDes)& theAsDes,
TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
TopTools_DataMapOfShapeShape& theFacesOrigins,
Standard_Boolean myIsPerformSewing; // Handle bad walls in thicksolid mode.
Standard_Boolean myIsPlanar;
TopoDS_Shape myBadShape;
-
+ TopTools_ListOfShape myGenerated;
+ TopTools_MapOfShape myResMap;
};
#endif // _BRepOffset_MakeOffset_HeaderFile
void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF,
const TopTools_MapOfShape& theModifiedEdges,
const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+ const BRepOffset_Analyse* theAnalyse,
Handle(BRepAlgo_AsDes)& theAsDes,
TopTools_DataMapOfShapeShape& theFacesOrigins,
TopTools_DataMapOfShapeListOfShape& theOEImages,
const TopTools_ListOfShape& theLFImages,
const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
const TopTools_DataMapOfShapeShape& theFacesOrigins,
+ const BRepOffset_Analyse* theAnalyse,
const TopTools_DataMapOfShapeListOfShape& theOEImages,
const TopTools_DataMapOfShapeListOfShape& theOEOrigins,
TopTools_IndexedMapOfShape& theInvEdges,
static
Standard_Boolean FindShape(const TopoDS_Shape& theSWhat,
const TopoDS_Shape& theSWhere,
+ const BRepOffset_Analyse* theAnalyse,
TopoDS_Shape& theRes);
static
// these invalidities will be rebuilt.
//=======================================================================
void BRepOffset_MakeOffset::BuildSplitsOfExtendedFaces(const TopTools_ListOfShape& theLF,
+ const BRepOffset_Analyse& theAnalyse,
Handle(BRepAlgo_AsDes)& theAsDes,
TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
TopTools_DataMapOfShapeShape& theFacesOrigins,
// solid build from the new splits
TopoDS_Shape aSolids;
// now we can split the faces
- BuildSplitsOfFaces(theLF, aNewEdges, theEdgesOrigins, theAsDes, theFacesOrigins,
+ BuildSplitsOfFaces(theLF, aNewEdges, theEdgesOrigins, &theAnalyse, theAsDes, theFacesOrigins,
anOEImages, anOEOrigins, aLastInvEdges, anEdgesToAvoid, anInvEdges, aValidEdges,
anInvertedEdges, anAlreadyInvFaces, anInvFaces, anArtInvFaces, aFImages,
aDMFNewHoles, aSolids, aSSInterfs);
//
TopoDS_Shape aSolids;
//
- BuildSplitsOfFaces(aLF, theModifiedEdges, theEdgesOrigins, theAsDes, theFacesOrigins,
+ BuildSplitsOfFaces(aLF, theModifiedEdges, theEdgesOrigins, NULL, theAsDes, theFacesOrigins,
theOEImages, theOEOrigins, theLastInvEdges, theEdgesToAvoid, anInvEdges, theValidEdges,
anInvertedEdges, theAlreadyInvFaces, anInvFaces, anArtInvFaces, theFImages,
theDMFNewHoles, aSolids, aSSInterfs);
void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF,
const TopTools_MapOfShape& theModifiedEdges,
const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
+ const BRepOffset_Analyse* theAnalyse,
Handle(BRepAlgo_AsDes)& theAsDes,
TopTools_DataMapOfShapeShape& theFacesOrigins,
TopTools_DataMapOfShapeListOfShape& theOEImages,
}
//
// find invalid edges
- FindInvalidEdges(aF, aLFImages, theEdgesOrigins, theFacesOrigins, theOEImages,
+ FindInvalidEdges(aF, aLFImages, theEdgesOrigins, theFacesOrigins, theAnalyse, theOEImages,
theOEOrigins, theInvEdges, theValidEdges, aDMFLVE, aDMFLNE, aDMFLIE,
aDMFLVIE, aDMEOrLEIm, theInvertedEdges, aMEdgeInvalidByVertex);
//
const TopTools_ListOfShape& theLFImages,
const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
const TopTools_DataMapOfShapeShape& theFacesOrigins,
+ const BRepOffset_Analyse* theAnalyse,
const TopTools_DataMapOfShapeListOfShape& theOEImages,
const TopTools_DataMapOfShapeListOfShape& theOEOrigins,
TopTools_IndexedMapOfShape& theInvEdges,
}
}
//
- TopTools_MapOfShape aME, aMV;
+ TopTools_MapOfShape aME, aMV, aMF;
Standard_Boolean bInvalid = Standard_False, bChecked = Standard_False;
- Standard_Integer aNbP = NbPoints(aEIm);
+ Standard_Integer aNbP = NbPoints(aEIm), aNbInv = 0;
Standard_Boolean bUseVertex = !aNbVOr ? Standard_False :
(aNbVOr == 1 &&
aDMEF.FindFromKey(aEIm).Extent() == 1 &&
}
}
else {
- FindShape(aSOr, aFOr, aEOrF);
+ FindShape(aSOr, aFOr, theAnalyse, aEOrF);
//
TopTools_ListOfShape *pLEIm = theDMEOrLEIm.ChangeSeek(aSOr);
if (!pLEIm) {
const TopoDS_Shape& aV = aExpE.Current();
aMV.Add(aV);
}
+ if (theAnalyse)
+ {
+ for (TopTools_ListOfShape::Iterator itFA (theAnalyse->Ancestors (aEOrF));
+ itFA.More(); itFA.Next())
+ aMF.Add (itFA.Value());
+ }
}
//
if (aCos < Precision::Confusion()) {
bInvalid = Standard_True;
+ aNbInv++;
if (bVertex) {
theEdgesInvalidByVertex.Add(aEIm);
}
continue;
}
//
+ Standard_Boolean bLocalOnly = Standard_False;
Standard_Integer aNbE = aME.Extent(), aNbV = aMV.Extent();
- if ((aNbE > 1) && (aNbV == 2*aNbE)) {
- continue;
+ if (aNbE > 1 && aNbV == 2*aNbE)
+ {
+ Standard_Boolean bSkip = Standard_True;
+
+ // Allow the edge to be analyzed if it is:
+ // * originated from more than two faces
+ // * unanimously considered valid or invalid
+ // * not a boundary edge in the splits
+ if (aMF.Extent () > 2 && (aNbInv == 0 || aNbInv == aNbE))
+ {
+ if (theLFImages.Extent() > 2)
+ {
+ TopoDS_Iterator itV (aEIm);
+ for (; itV.More(); itV.Next())
+ {
+ TopTools_ListOfShape::Iterator itE (aDMVE.FindFromKey (itV.Value()));
+ for (; itE.More(); itE.Next())
+ if (aDMEF.FindFromKey (itE.Value()).Extent() < 2)
+ break;
+ if (itE.More())
+ break;
+ }
+ bSkip = itV.More();
+ }
+ }
+ if (bSkip)
+ continue;
+ else
+ bLocalOnly = Standard_True;
}
//
if (bInvalid) {
- theInvEdges.Add(aEIm);
+ if (!bLocalOnly)
+ theInvEdges.Add(aEIm);
aLIE.Append(aEIm);
aMEInv.Add(aEIm);
continue;
}
//
// check if the edge has been inverted
- Standard_Boolean bInverted = !aNbE ? Standard_False :
+ Standard_Boolean bInverted = !aNbE || bLocalOnly ? Standard_False :
CheckInverted(aEIm, aFOr, theOEImages, theOEOrigins,
theEdgesOrigins, aDMVE, aMEdges, theMEInverted);
//
if (!bInverted || !aNbVOr) {
- theValidEdges.Add(aEIm);
+ if (!bLocalOnly)
+ theValidEdges.Add(aEIm);
aLVE.Append(aEIm);
aMEVal.Add(aEIm);
}
//
bValid = theValidEdges.Contains(aEIm);
bInvalid = theInvEdges.Contains(aEIm);
+ bNeutral = aMEN.Contains(aEIm);
//
- if (!bValid && !bInvalid) {
+ if (!bValid && !bInvalid && !bNeutral) {
// edge has not been checked for some reason
continue;
}
++aNbChecked;
//
bInvalidLoc = aMIE.Contains(aEIm);
- bHasReallyInvalid = bInvalidLoc && !bValid && !theEdgesInvalidByVertex.Contains(aEIm);
+ bHasReallyInvalid = bInvalid && bInvalidLoc && !bValid && !theEdgesInvalidByVertex.Contains(aEIm);
if (bHasReallyInvalid) {
break;
}
//
- bNeutral = aMEN.Contains(aEIm);
bValidLoc = aMVE.Contains(aEIm);
//
bInverted = theMEInverted.Contains(aEIm);
- if (!bInvalid && bTreatInvertedAsInvalid) {
+ if (!bInvalid && !bInvalidLoc && bTreatInvertedAsInvalid) {
bInvalid = bInverted;
}
//
}
//
bAllValid &= bValidLoc;
- bAllInvalid &= bInvalid;
+ bAllInvalid &= (bInvalid || bInvalidLoc);
bAllInvNeutral &= (bAllInvalid && bNeutral);
bIsInvalidByInverted &= (bInvalidLoc || bInverted);
}
const TopoDS_Shape& aEO = aItLOE.Value();
if (aEO.ShapeType() == TopAbs_EDGE && aMFence.Add(aEO)) {
TopoDS_Shape aEOin;
- if (FindShape(aEO, theFOr, aEOin)) {
+ if (FindShape(aEO, theFOr, NULL, aEOin)) {
AppendToList(aLOE, aEO);
}
}
const TopoDS_Shape& aFSol = pLSols->First();
//
TopoDS_Shape aFx;
- if (!FindShape(aFInvIm, aFSol, aFx)) {
+ if (!FindShape(aFInvIm, aFSol, NULL, aFx)) {
continue;
}
//
//=======================================================================
Standard_Boolean FindShape(const TopoDS_Shape& theSWhat,
const TopoDS_Shape& theSWhere,
+ const BRepOffset_Analyse* theAnalyse,
TopoDS_Shape& theRes)
{
Standard_Boolean bFound = Standard_False;
break;
}
}
+
+ if (!bFound && theAnalyse)
+ {
+ const TopTools_ListOfShape *pLD = theAnalyse->Descendants (theSWhere);
+ if (pLD)
+ {
+ for (TopTools_ListOfShape::Iterator it (*pLD); it.More(); it.Next())
+ {
+ const TopoDS_Shape& aS = it.Value();
+ if (aS.IsSame (theSWhat))
+ {
+ theRes = aS;
+ bFound = Standard_True;
+ break;
+ }
+ }
+ }
+ }
+
return bFound;
}
{
TopoDS_Shape aShape;
- switch ( myShape.ShapeType()) {
-
- case TopAbs_FACE:
+ switch ( myShape.ShapeType())
+ {
+ case TopAbs_FACE:
{
- TopExp_Explorer exp (myShape.Oriented(TopAbs_FORWARD), TopAbs_EDGE);
- TopExp_Explorer expo(myFace .Oriented(TopAbs_FORWARD), TopAbs_EDGE);
- for ( ; exp.More() && expo.More(); exp.Next(), expo.Next()) {
- if ( Shape.IsSame(exp.Current())) {
- if ( myShape.Orientation() == TopAbs_REVERSED)
- aShape = expo.Current().Reversed();
- else
- aShape = expo.Current();
- }
+ TopExp_Explorer exp (myShape.Oriented(TopAbs_FORWARD), TopAbs_EDGE);
+ TopExp_Explorer expo (myFace .Oriented(TopAbs_FORWARD), TopAbs_EDGE);
+ for (; exp.More() && expo.More(); exp.Next(), expo.Next())
+ {
+ if (Shape.IsSame (exp.Current()))
+ {
+ if (myShape.Orientation() == TopAbs_REVERSED)
+ aShape = expo.Current().Reversed();
+ else
+ aShape = expo.Current();
+ break;
+ }
}
}
break;
- case TopAbs_EDGE:
+ case TopAbs_EDGE:
// have generate a pipe.
{
TopoDS_Vertex V1, V2;
TopExp::Vertices(TopoDS::Edge(myShape), V1, V2);
-
- TopExp_Explorer expf(myFace .Oriented(TopAbs_FORWARD), TopAbs_WIRE);
- TopExp_Explorer expo(expf.Current().Oriented(TopAbs_FORWARD),
- TopAbs_EDGE);
+
+ TopExp_Explorer expf(myFace.Oriented(TopAbs_FORWARD), TopAbs_WIRE);
+ TopExp_Explorer expo(expf.Current().Oriented(TopAbs_FORWARD), TopAbs_EDGE);
expo.Next();
expo.Next();
if ( V2.IsSame(Shape)) {
- if ( expf.Current().Orientation() == TopAbs_REVERSED)
- aShape = expo.Current().Reversed();
- else
- aShape = expo.Current();
+ if (expf.Current().Orientation() == TopAbs_REVERSED)
+ aShape = expo.Current().Reversed();
+ else
+ aShape = expo.Current();
}
else {
- expo.Next();
- if ( expf.Current().Orientation() == TopAbs_REVERSED)
- aShape = expo.Current().Reversed();
- else
- aShape = expo.Current();
+ expo.Next();
+ if (expf.Current().Orientation() == TopAbs_REVERSED)
+ aShape = expo.Current().Reversed();
+ else
+ aShape = expo.Current();
}
- if ( myFace.Orientation() == TopAbs_REVERSED)
- aShape.Reverse();
+ if (myFace.Orientation() == TopAbs_REVERSED)
+ aShape.Reverse();
}
break;
default:
C.D0(U2,P);
B.Add(P);
}
- B.Get(UMin,VMin,UMax,VMax);
+
+ if (!B.IsVoid())
+ B.Get(UMin,VMin,UMax,VMax);
+ else
+ BRep_Tool::Surface(F)->Bounds (UMin, UMax, VMin, VMax);
}
//=======================================================================
const TopTools_ListOfShape& BRepOffsetAPI_MakeOffsetShape::Generated (const TopoDS_Shape& S)
{
myGenerated.Clear();
-
- if (myLastUsedAlgo == OffsetAlgo_JOIN && !myOffsetShape.ClosingFaces().Contains(S))
+ if (myLastUsedAlgo == OffsetAlgo_JOIN)
{
- myOffsetShape.OffsetFacesFromShapes ().LastImage (S, myGenerated);
-
- if (!myOffsetShape.ClosingFaces().IsEmpty())
- {
- // Reverse generated shapes in case of small solids.
- // Useful only for faces without influence on others.
- TopTools_ListIteratorOfListOfShape it(myGenerated);
- for (; it.More(); it.Next())
- it.Value().Reverse();
- }
+ myGenerated = myOffsetShape.Generated (S);
}
else if (myLastUsedAlgo == OffsetAlgo_SIMPLE)
{
TopoDS_Shape aGenShape = mySimpleOffsetShape.Generated(S);
- if (!aGenShape.IsNull())
+ if (!aGenShape.IsNull() && !aGenShape.IsSame (S))
myGenerated.Append(aGenShape);
}
}
//=======================================================================
-//function : GeneratedEdge
+//function : Modified
//purpose :
//=======================================================================
-const TopTools_ListOfShape& BRepOffsetAPI_MakeOffsetShape::GeneratedEdge (const TopoDS_Shape& S)
+const TopTools_ListOfShape& BRepOffsetAPI_MakeOffsetShape::Modified (const TopoDS_Shape& S)
{
myGenerated.Clear();
-
if (myLastUsedAlgo == OffsetAlgo_JOIN)
{
- myOffsetShape.OffsetEdgesFromShapes().LastImage (S, myGenerated);
-
- if (!myGenerated.IsEmpty())
- {
- if (S.IsSame(myGenerated.First()))
- myGenerated.RemoveFirst();
- }
+ myGenerated = myOffsetShape.Modified (S);
}
else if (myLastUsedAlgo == OffsetAlgo_SIMPLE)
{
- TopoDS_Shape aGenShape = mySimpleOffsetShape.Generated(S);
- if (!aGenShape.IsNull())
+ TopoDS_Shape aGenShape = mySimpleOffsetShape.Modified(S);
+ if (!aGenShape.IsNull() && !aGenShape.IsSame (S))
myGenerated.Append(aGenShape);
}
return myGenerated;
}
+//=======================================================================
+//function : IsDeleted
+//purpose :
+//=======================================================================
+Standard_Boolean BRepOffsetAPI_MakeOffsetShape::IsDeleted (const TopoDS_Shape& S)
+{
+ if (myLastUsedAlgo == OffsetAlgo_JOIN)
+ {
+ return myOffsetShape.IsDeleted(S);
+ }
+ return Standard_False;
+}
+
//=======================================================================
//function : GetJoinType
//purpose : Query offset join type.
//! Does nothing.
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
- //! Returns the list of shapes generated from the shape <S>.
+ //! Returns the list of shapes generated from the shape <S>.
Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
-
- //! Returns the list of edges generated from the shape <S>.
- Standard_EXPORT const TopTools_ListOfShape& GeneratedEdge (const TopoDS_Shape& S);
-
+
+ //! Returns the list of shapes Modified from the shape <S>.
+ Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& S) Standard_OVERRIDE;
+
+ //! Returns true if the shape has been removed from the result.
+ Standard_EXPORT virtual Standard_Boolean IsDeleted (const TopoDS_Shape& S) Standard_OVERRIDE;
+
//! Returns offset join type.
Standard_EXPORT GeomAbs_JoinType GetJoinType() const;
reportOffsetState(theCommands, aRetCode);
}
+ // Store the history of Boolean operation into the session
+ if (BRepTest_Objects::IsHistoryNeeded())
+ {
+ TopTools_ListOfShape aLA;
+ aLA.Append (TheOffset.InitShape());
+ BRepTest_Objects::SetHistory<BRepOffset_MakeOffset>(aLA, TheOffset);
+ }
+
return 0;
}
if (F1.IsSame(F2))
EE.Reverse();
Handle (Geom2d_Curve) C2 = BRep_Tool::CurveOnSurface(EE,F2,f,l);
+ if (C1.IsNull() || C2.IsNull())
+ return ChFiDS_Other;
BRepAdaptor_Curve C(E);
f = C.FirstParameter();
-puts "TODO OCC27912 ALL: An exception was caught"
-puts "TODO OCC27912 ALL: \\*\\* Exception \\*\\*.*"
-puts "TODO OCC27912 ALL: TEST INCOMPLETE"
+puts "TODO OCC27912 ALL: Error : The area of result shape is"
puts "========"
puts "OCC27912"
offsetload s 10
offsetperform result
+
+checkprops result -s 0
\ No newline at end of file
cpulimit 900
if { [array get Draw_Groups "TOPOLOGY Feature commands"] == "" } {
pload TOPTEST
+ setfillhistory 0
}
if { [array get Draw_Groups "Shape Healing"] == "" } {
pload XSDRAW
016 with_intersect_20
017 with_intersect_80
018 shape_type_i_c
-019 simple
-020 bugs
\ No newline at end of file
+019 shape_type_i_c_multi
+020 simple
+021 bugs
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 1 2 3} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+polyline p 0 0 0 10 0 0 10 0 5 5 0 5 0 0 5 0 0 0
+mkplane f p
+prism s f 0 10 0
+
+perform_offset_multi_with_ref r0_01 s 0 {3 4} {1 2} {470 650 8 8} 0
+perform_offset_multi_with_ref r0_02 s 0 {3 4} {2 1} {470 650 8 8} 0
+perform_offset_multi_with_ref r0_03 s 0 {3 4} {2 2} {480 700 7 7} 0
+
+perform_offset_multi_with_ref r1_01 s 1 {3 4} {2 3} {708 1224 8 8} 0
+perform_offset_multi_with_ref r1_02 s 1 {3 4} {3 2} {708 1224 8 8} 0
+
+perform_offset_multi_with_ref r2_01 s 2 {3 4} {4 4} {1008 2156 7 7} 0
+perform_offset_multi_with_ref r2_02 s 2 {} {} {896 1764 7 7} 0
+perform_offset_multi_with_ref r2_03 s 2 {3 4} {0 1} {826 1470 8 8} 0
+perform_offset_multi_with_ref r2_04 s 2 {3 4} {1 1} {840 1568 7 7} 0
+
+perform_offset_multi_with_ref r3_01 s 3 {4} {5} {1312 3072 8 8} 0
+
+
+# display all created shapes
+foreach val {0 1 2 3} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r3_01 result
+copy r3_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 1 3} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+polyline p 0 0 0 5 0 0 5 0 5 5 0 10 0 0 10 0 0 5 0 0 0
+mkplane f p
+prism s f 0 10 0
+
+# right side: faces 2 and 3
+# left side: faces 5 and 6
+
+perform_offset_multi_with_ref r0_01 s 0 {2 3 5 6} {1 2 3 4} {620 1000 10 10} 0
+perform_offset_multi_with_ref r0_02 s 0 {3 5} {2 3} {550 750 10 10} 0
+perform_offset_multi_with_ref r0_03 s 0 {3 6} {2 3} {550 750 10 10} 0
+perform_offset_multi_with_ref r0_04 s 0 {2 6} {2 3} {550 750 10 10} 0
+perform_offset_multi_with_ref r0_05 s 0 {2 5} {2 3} {550 750 10 10} 0
+perform_offset_multi_with_ref r0_06 s 0 {2 3 5 6} {2 2 3 3} {600 1000 8 8} 0
+perform_offset_multi_with_ref r0_07 s 0 {2 3 5 6} {3 3 2 2} {600 1000 6 6} 1
+
+perform_offset_multi_with_ref r1_01 s 1 {2 3 5 6} {0 1 2 3} {696 1152 10 10} 0
+perform_offset_multi_with_ref r1_02 s 1 {2 3 5 6} {0 2 0 2} {672 1008 10 10} 0
+perform_offset_multi_with_ref r1_03 s 1 {2 3 5 6} {2 0 2 0} {672 1008 10 10} 0
+perform_offset_multi_with_ref r1_04 s 1 {3 5} {2 2} {696 1152 10 10} 0
+perform_offset_multi_with_ref r1_05 s 1 {} {} {624 1008 8 8} 0
+perform_offset_multi_with_ref r1_06 s 1 {2 3 5 6} {3 3 2 2} {768 1440 6 6} 1
+
+perform_offset_multi_with_ref r3_01 s 3 {2 6} {0 0} {1120 2048 10 10} 0
+perform_offset_multi_with_ref r3_02 s 3 {3 5} {1 1} {1152 2304 10 10} 0
+perform_offset_multi_with_ref r3_03 s 3 {2 5} {2 2} {1184 2560 10 10} 0
+perform_offset_multi_with_ref r3_04 s 3 {3 6} {0 0} {1120 2048 10 10} 0
+
+
+# display all created shapes
+foreach val {0 1 3} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+polyline p 0 0 0 10 0 0 10 0 2 8 0 2 6 0 2 6 0 5 6 0 8 4 0 8 4 0 5 4 0 2 2 0 2 0 0 2 0 0 0
+mkplane f p
+prism s f 0 10 0
+
+# right top side: faces 3 and 4
+# right side: faces 5 and 6
+# left side: faces 8 and 9
+# left top side: faces 10 and 11
+
+# unset draw variables for all offset values
+foreach val {0 1 2 3 4} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+perform_offset_multi_with_ref r0_01 s 0 {3 4 5 6 8 9 10 11} {1 2 1 2 2 1 2 1} {516 580 18 18} 0
+perform_offset_multi_with_ref r0_02 s 0 {3 6 8 11} {4 3 3 4} {688 640 22 18} 1
+perform_offset_multi_with_ref r0_03 s 0 {3 6 8 11} {4 5 5 4} {748 740 22 18} 1
+perform_offset_multi_with_ref r0_04 s 0 {3 6 8 11} {10 5 6 8} {918 890 30 26} 1
+perform_offset_multi_with_ref r0_05 s 0 {3 6 8 11} {2 4 4 2} {728 640 18 18} 1
+
+perform_offset_multi_with_ref r1_01 s 1 {} {} {672 864 14 14} 0
+perform_offset_multi_with_ref r1_02 s 1 {3 6 8 11} {2 2 2 2} {796 1032 18 18} 1
+perform_offset_multi_with_ref r1_03 s 1 {3 6 8 11} {3 2 2 3} {856 1104 22 18} 1
+perform_offset_multi_with_ref r1_04 s 1 {3 6 8 11} {4 3 3 4} {880 1248 22 18} 1
+perform_offset_multi_with_ref r1_05 s 1 {3 6 8 11} {4 5 5 4} {904 1392 18 14} 1
+perform_offset_multi_with_ref r1_06 s 1 {3 6 8 11} {4 6 6 4} {968 1488 22 18} 1
+perform_offset_multi_with_ref r1_07 s 1 {3 6 8 11} {6 6 6 6} {968 1488 22 18} 1
+perform_offset_multi_with_ref r1_08 s 1 {3 6 8 11} {8 6 6 10} {1088 1632 30 26} 1
+
+perform_offset_multi_with_ref r2_01 s 2 {} {} {968 1680 12 12} 0
+perform_offset_multi_with_ref r2_02 s 2 {6 8} {4 4} {1120 1960 14 14} 1
+perform_offset_multi_with_ref r2_03 s 2 {3 11} {4 4} {1000 1904 10 10} 0
+perform_offset_multi_with_ref r2_04 s 2 {3 6 8 11} {4 7 7 4} {1140 2492 10 10} 1
+
+perform_offset_multi_with_ref r3_01 s 3 {} {} {1312 2816 10 10} 0
+
+perform_offset_multi_with_ref r4_01 s 4 {} {} {1704 4320 10 10} 0
+
+foreach val {0 1 2 3 4} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+polyline p 0 0 0 10 0 0 10 0 2 8 0 2 6 0 2 6 0 5 6 0 8 4 0 8 4 0 5 4 0 2 2 0 2 0 0 2 0 0 0
+mkplane f p
+prism s f 0 10 0
+
+# right top side: faces 3 and 4
+# right side: faces 5 and 6
+# left side: faces 8 and 9
+# left top side: faces 10 and 11
+
+perform_offset_multi_with_ref r0_01 s 0 {3 6 8 11} {3 2 2 3} {672 560 22 18} 1
+perform_offset_multi_with_ref r0_02 s 0 {3 6 8 11} {3 3 3 3} {684 620 22 18} 1
+perform_offset_multi_with_ref r0_03 s 0 {3 6 8 11} {4 2 2 4} {680 600 22 18} 1
+perform_offset_multi_with_ref r0_04 s 0 {3 6 8 11} {3 4 4 3} {696 680 18 14} 1
+perform_offset_multi_with_ref r0_05 s 0 {3 6 8 11} {3 5 5 3} {748 740 22 18} 1
+
+perform_offset_multi_with_ref r1_01 s 1 {3 6 8 11} {3 2 2 3} {856 1104 22 18} 1
+perform_offset_multi_with_ref r1_02 s 1 {3 6 8 11} {4 2 2 4} {868 1176 22 18} 1
+perform_offset_multi_with_ref r1_03 s 1 {3 6 8 11} {3 3 3 3} {872 1200 22 18} 1
+perform_offset_multi_with_ref r1_04 s 1 {3 6 8 11} {3 4 4 3} {888 1296 22 18} 1
+perform_offset_multi_with_ref r1_05 s 1 {3 6 8 11} {3 5 5 3} {904 1392 18 14} 1
+perform_offset_multi_with_ref r1_06 s 1 {3 6 8 11} {7 2 2 7} {904 1392 18 14} 1
+
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r1_02 result
+copy r1_02_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 1 2 3} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+polyline p 0 0 0 10 0 0 10 0 1 8 0 1 8 0 4 8 0 7 7 0 7 7 0 4 7 0 1 3 0 1 3 0 4 3 0 7 2 0 7 2 0 4 2 0 1 0 0 1 0 0 0
+mkplane f p
+prism s f 0 10 0
+
+perform_offset_multi_with_ref r0_01 s 0 {4 5 7 8 10 11 13 14} {0 1 0 1 0 1 0 1} {568 340 22 22} 1
+perform_offset_multi_with_ref r0_02 s 0 {4 5 7 8 10 11 13 14} {1 0 1 0 1 0 1 0} {568 340 22 22} 1
+perform_offset_multi_with_ref r0_03 s 0 {8 10} {1 1} {516 280 18 18} 1
+perform_offset_multi_with_ref r0_04 s 0 {8 10} {2 2} {468 340 14 14} 1
+perform_offset_multi_with_ref r0_05 s 0 {8 10} {3 3} {468 340 14 14} 1
+perform_offset_multi_with_ref r0_06 s 0 {8 11} {1 1} {536 280 18 18} 1
+perform_offset_multi_with_ref r0_07 s 0 {8 11} {2 2} {568 340 20 18} 1
+perform_offset_multi_with_ref r0_08 s 0 {8 11} {3 3} {560 400 20 18} 1
+perform_offset_multi_with_ref r0_09 s 0 {7 10} {1 1} {536 280 18 18} 1
+perform_offset_multi_with_ref r0_10 s 0 {7 10} {2 2} {568 340 20 18} 1
+perform_offset_multi_with_ref r0_11 s 0 {7 10} {3 3} {560 400 20 18} 1
+perform_offset_multi_with_ref r0_12 s 0 {7 11} {2 2} {548 340 16 14} 1
+perform_offset_multi_with_ref r0_13 s 0 {7 11} {3 3} {548 340 16 14} 1
+
+perform_offset_multi_with_ref r1_01 s 1 {4 5 7 8 10 11 13 14} {0 1 0 1 0 1 0 1} {816 720 22 22} 1
+perform_offset_multi_with_ref r1_02 s 1 {4 5 7 8 10 11 13 14} {1 0 1 0 1 0 1 0} {816 720 22 22} 1
+perform_offset_multi_with_ref r1_03 s 1 {8 10} {1.5 1.5} {796 888 18 18} 1
+perform_offset_multi_with_ref r1_04 s 1 {8 10} {2 2} {752 912 14 14} 1
+perform_offset_multi_with_ref r1_05 s 1 {8 10} {3 3} {752 912 14 14} 1
+perform_offset_multi_with_ref r1_06 s 1 {8 11} {1.5 1.5} {810 900 18 18} 1
+perform_offset_multi_with_ref r1_07 s 1 {8 11} {2 2} {828 936 20 18} 1
+perform_offset_multi_with_ref r1_08 s 1 {8 11 7 10} {3 3 0 0} {828 936 20 18} 1
+perform_offset_multi_with_ref r1_09 s 1 {7 10} {1.5 1.5} {810 900 18 18} 1
+perform_offset_multi_with_ref r1_10 s 1 {7 10} {2 2} {828 936 20 18} 1
+perform_offset_multi_with_ref r1_11 s 1 {7 10 8 11} {3 3 0 0} {828 936 20 18} 1
+perform_offset_multi_with_ref r1_12 s 1 {7 11} {2 2} {760 960 16 14} 1
+perform_offset_multi_with_ref r1_13 s 1 {7 11} {3 3} {760 960 16 14} 1
+
+perform_offset_multi_with_ref r2_01 s 2 {4 5 7 8 10 11 13 14} {0 1 1 0 0 1 1 0} {1184 1428 22 22} 1
+perform_offset_multi_with_ref r2_02 s 2 {4 5 7 8 10 11 13 14} {1 0 0 1 1 0 0 1} {1040 1204 22 22} 1
+perform_offset_multi_with_ref r2_03 s 2 {4 5 7 8 10 11 13 14} {1 0 2 1 1 2 0 1} {996 1484 20 18} 1
+
+perform_offset_multi_with_ref r3_01 s 3 {4 5 7 8 10 11 13 14} {0 1 1 0 0 1 1 0} {1416 2368 14 14} 1
+perform_offset_multi_with_ref r3_02 s 3 {4 5 7 8 10 11 13 14} {1 0 0 1 1 0 0 1} {1368 1984 14 14} 1
+perform_offset_multi_with_ref r3_03 s 3 {4 5 7 8 10 11 13 14} {1 0 2 1 1 2 0 1} {1224 2368 10 10} 1
+
+# display all created shapes
+foreach val {0 1 2 3} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r1_01 result
+copy r1_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+polyline p 0 0 0 10 0 0 10 0 1 8 0 1 8 0 4 8 0 7 7 0 7 7 0 5 7 0 1 3 0 1 3 0 3 3 0 7 2 0 7 2 0 4 2 0 1 0 0 1 0 0 0
+mkplane f p
+prism s f 0 10 0
+
+perform_offset_multi_with_ref r0_01 s 0 {4 5 7 8 10 11 13 14} {0 1 0 1 0 1 0 1} {568 360 22 22} 1
+perform_offset_multi_with_ref r0_02 s 0 {7 10} {2 2} {560 300 18 18} 1
+perform_offset_multi_with_ref r0_03 s 0 {7 10} {4 2} {568 340 18 16} 1
+perform_offset_multi_with_ref r0_04 s 0 {7 10} {4 4} {536 380 16 14} 1
+perform_offset_multi_with_ref r0_05 s 0 {7 10} {5 3} {572 360 18 16} 1
+perform_offset_multi_with_ref r0_06 s 0 {7 11} {2 2} {568 340 18 16} 1
+perform_offset_multi_with_ref r0_07 s 0 {7 11} {3 2} {568 340 18 16} 1
+perform_offset_multi_with_ref r0_08 s 0 {7 11} {3 3} {572 360 18 16} 1
+perform_offset_multi_with_ref r0_09 s 0 {7 11} {0 4} {536 380 16 14} 1
+
+perform_offset_multi_with_ref r1_01 s 1 {4 5 7 8 10 11 13 14} {0 1.5 0 1.5 0 1.5 0 1.5} {858 828 22 22} 1
+perform_offset_multi_with_ref r1_02 s 1 {7 10} {2 2} {824 912 18 18} 1
+perform_offset_multi_with_ref r1_03 s 1 {7 10} {4 4} {760 960 16 14} 1
+perform_offset_multi_with_ref r1_04 s 1 {7 11} {0 4} {740 984 16 14} 1
+
+# display all created shapes
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {1} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+polyline p 0 0 0 10 0 0 10 0 1 8 0 1 8 0 4 8 0 7 7 0 7 7 0 5 7 0 1 3 0 1 3 0 3 3 0 7 2 0 7 2 0 4 2 0 1 0 0 1 0 0 0
+mkplane f p
+prism s f 0 10 0
+
+perform_offset_multi_with_ref r1_01 s 1 {7 10} {4 2} {782 948 18 16} 1
+perform_offset_multi_with_ref r1_02 s 1 {7 10} {5 3} {760 960 16 14} 1
+perform_offset_multi_with_ref r1_03 s 1 {7 11} {2 2} {784 960 18 16} 1
+perform_offset_multi_with_ref r1_04 s 1 {7 11} {3 2} {784 960 18 16} 1
+perform_offset_multi_with_ref r1_05 s 1 {7 11} {3 3} {740 984 16 14} 1
+
+# display all created shapes
+foreach val {1} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r1_03 result
+copy r1_03_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 1 2 3} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+polyline p 0 0 0 11 0 0 11 0 1 9 0 1 9 0 4 9 0 7 8 0 7 8 0 4 8 0 1 6 0 1 5 0 1 3 0 1 3 0 4 3 0 7 2 0 7 2 0 4 2 0 1 0 0 1 0 0 0
+mkplane f p
+prism s f 0 10 0
+
+perform_offset_multi_with_ref r0_01 s 0 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2 1 1 2 1 1 2 2 1} {686 630 26 26} 1
+perform_offset_multi_with_ref r0_02 s 0 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2 1 1 3 1 1 2 2 1} {708 640 30 26} 1
+perform_offset_multi_with_ref r0_03 s 0 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2 1 1 4 1 1 2 2 1} {690 650 30 26} 1
+perform_offset_multi_with_ref r0_04 s 0 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2 1 1 8 1 1 2 2 1} {698 690 30 26} 1
+perform_offset_multi_with_ref r0_05 s 0 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2.1 1 1 4 1 1 2.1 2 1} {690.8 654 30 26} 1
+perform_offset_multi_with_ref r0_06 s 0 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2.5 1 1 4 1 1 2.5 2 1} {654 670 26 22} 1
+perform_offset_multi_with_ref r0_07 s 0 {4 5 7 8 9 10 11 12 13 15 16} {1 2 3 1 1 4 1 1 3 2 1} {654 670 26 22} 1
+perform_offset_multi_with_ref r0_08 s 0 {8 10 12} {2 1 2} {532 360 18 18} 1
+perform_offset_multi_with_ref r0_09 s 0 {8 10 12} {2.2 1 2.2} {533.6 368 18 18} 1
+perform_offset_multi_with_ref r0_10 s 0 {8 10 12} {2.5 1 2.5} {496 380 14 14} 1
+perform_offset_multi_with_ref r0_11 s 0 {8 10 12} {3 3 3} {496 380 14 14} 1
+perform_offset_multi_with_ref r0_12 s 0 {7 10 13} {2 3 2} {696 380 26 22} 1
+perform_offset_multi_with_ref r0_13 s 0 {7 10 13} {2 5 2} {660 400 26 22} 1
+perform_offset_multi_with_ref r0_14 s 0 {7 10 13} {2.5 3 2.5} {642 410 22 18} 1
+perform_offset_multi_with_ref r0_15 s 0 {7 10 13} {2.5 5 2.5} {642 410 22 18} 1
+perform_offset_multi_with_ref r0_16 s 0 {7 10 13} {3 5 3} {642 410 22 18} 1
+
+perform_offset_multi_with_ref r1_01 s 1 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2 1 1 2 1 1 2 2 1} {976 1104 26 26} 1
+perform_offset_multi_with_ref r1_02 s 1 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2 1 1 3 1 1 2 2 1} {1002 1116 30 26} 1
+perform_offset_multi_with_ref r1_05 s 1 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2.1 1 1 4 1 1 2.1 2 1} {981.2 1135.2 30 26} 1
+perform_offset_multi_with_ref r1_06 s 1 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2.5 1 1 4 1 1 2.5 2 1} {914 1164 26 22} 1
+perform_offset_multi_with_ref r1_07 s 1 {4 5 7 8 9 10 11 12 13 15 16} {1 2 3 1 1 4 1 1 3 2 1} {914 1164 26 22} 1
+perform_offset_multi_with_ref r1_08 s 1 {8 10 12} {2 2 2} {808 960 18 18} 1
+perform_offset_multi_with_ref r1_09 s 1 {8 10 12} {2.2 1 2.2} {831.6 957.6 18 18} 1
+perform_offset_multi_with_ref r1_10 s 1 {8 10 12} {2.5 1 2.5} {786 972 14 14} 1
+perform_offset_multi_with_ref r1_11 s 1 {8 10 12} {3 3 3} {786 972 14 14} 1
+perform_offset_multi_with_ref r1_12 s 1 {7 10 13} {2 3 2} {938 1020 26 22} 1
+perform_offset_multi_with_ref r1_15 s 1 {7 10 13} {2.5 5 2.5} {850 1068 22 18} 1
+perform_offset_multi_with_ref r1_16 s 1 {7 10 13} {3 5 3} {850 1068 22 18} 1
+
+perform_offset_multi_with_ref r2_01 s 2 {} {} {1166 1890 14 14} 1
+perform_offset_multi_with_ref r3_01 s 3 {5 15} {6 6} {1490 3728 10 10} 1
+
+# display all created shapes
+set i 1
+foreach val {0 1 2 3} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ incr i
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {1} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+polyline p 0 0 0 11 0 0 11 0 1 9 0 1 9 0 4 9 0 7 8 0 7 8 0 4 8 0 1 6 0 1 5 0 1 3 0 1 3 0 4 3 0 7 2 0 7 2 0 4 2 0 1 0 0 1 0 0 0
+mkplane f p
+prism s f 0 10 0
+
+perform_offset_multi_with_ref r1_01 s 1 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2 1 1 4 1 1 2 2 1} {980 1128 30 26} 1
+perform_offset_multi_with_ref r1_02 s 1 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2 1 1 8 1 1 2 2 1} {940 1176 30 26} 1
+
+perform_offset_multi_with_ref r1_03 s 1 {7 10 13} {2 5 2} {894 1044 26 22} 1
+perform_offset_multi_with_ref r1_04 s 1 {7 10 13} {2.5 3 2.5} {850 1068 22 18} 1
+
+# display all created shapes
+foreach val {1} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r1_03 result
+copy r1_03_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_box_iso_face_top.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {7} {2} {416 508 12 11} 1
+perform_offset_multi_with_ref r0_02 s 0 {6 7} {1 2} {448 604 12 11} 1
+perform_offset_multi_with_ref r0_03 s 0 {6 7} {2 1} {488 696 12 11} 1
+perform_offset_multi_with_ref r0_04 s 0 {6} {2} {496 692 12 11} 1
+
+perform_offset_multi_with_ref r1_01 s 1 {7} {2} {632 1012 12 11} 1
+perform_offset_multi_with_ref r1_02 s 1 {6 7} {2 3} {680 1156 12 11} 1
+perform_offset_multi_with_ref r1_03 s 1 {6 7} {3 2} {728 1292 12 11} 1
+perform_offset_multi_with_ref r1_04 s 1 {6} {3} {736 1288 12 11} 1
+
+# display all created shapes
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_box_top_split1.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {6 7 8 9 10} {1 1 1 1 1} {440 600 6 6} 1
+perform_offset_multi_with_ref r0_02 s 0 {6} {1} {420 524 11 11} 1
+perform_offset_multi_with_ref r0_03 s 0 {6 9} {1 2} {460 572 16 16} 1
+perform_offset_multi_with_ref r0_04 s 0 {6 8} {1 1} {432 548 12 12} 1
+perform_offset_multi_with_ref r0_05 s 0 {6 8} {1 2} {452 572 14 14} 1
+perform_offset_multi_with_ref r0_06 s 0 {6 7 8} {1 2 2} {484 620 17 17} 1
+perform_offset_multi_with_ref r0_07 s 0 {6 8 9} {1 2 3} {496 644 17 17} 1
+perform_offset_multi_with_ref r0_08 s 0 {6 8 9 7} {1 2 3 4} {544 740 18 18} 1
+perform_offset_multi_with_ref r0_09 s 0 {6 8 9 7} {1 2 3 2} {512 692 18 18} 1
+perform_offset_multi_with_ref r0_10 s 0 {6 8 9 7 10 } {1 2 3 2 5} {520 712 18 18} 1
+perform_offset_multi_with_ref r0_11 s 0 {6 8 9 7 10 } {1 2 3 4 5} {544 760 18 18} 1
+perform_offset_multi_with_ref r0_12 s 0 {10} {2} {416 508 12 11} 1
+
+
+perform_offset_multi_with_ref r1_01 s 1 {6 7 8 9 10} {2 2 2 2 2} {672 1152 6 6} 1
+perform_offset_multi_with_ref r1_02 s 1 {6} {2} {648 1043 11 11} 1
+perform_offset_multi_with_ref r1_03 s 1 {6 9} {2 3} {696 1113 16 16} 1
+perform_offset_multi_with_ref r1_04 s 1 {6 8} {2 2} {662 1078 12 12} 1
+perform_offset_multi_with_ref r1_05 s 1 {6 8} {2 3} {686 1113 14 14} 1
+perform_offset_multi_with_ref r1_06 s 1 {6 7 8} {2 3 3} {724 1183 17 17} 1
+perform_offset_multi_with_ref r1_07 s 1 {6 8 9} {2 3 4} {738 1218 17 17} 1
+perform_offset_multi_with_ref r1_08 s 1 {6 8 9 7} {2 3 4 5} {794 1358 18 18} 1
+perform_offset_multi_with_ref r1_09 s 1 {6 8 9 7} {2 3 4 3} {756 1288 18 18} 1
+perform_offset_multi_with_ref r1_10 s 1 {6 8 9 7 10 } {2 3 4 3 5} {756 1304 18 18} 1
+perform_offset_multi_with_ref r1_11 s 1 {6 8 9 7 10 } {2 3 4 5 6} {794 1378 18 18} 1
+perform_offset_multi_with_ref r1_11 s 1 {6 8 9 7 10 } {2 3 4 5 2.5} {784 1364 20 20} 1
+perform_offset_multi_with_ref r1_12 s 1 {10} {2} {632 1012 12 11} 1
+
+# display all created shapes
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_11 result
+copy r0_11_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_box_top_split2.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {6 7 8 9 10} {1 1 1 1 1} {440 600 6 6} 1
+perform_offset_multi_with_ref r0_02 s 0 {6} {1} {420 524 9 9} 1
+perform_offset_multi_with_ref r0_03 s 0 {6 9} {1 2} {460 572 12 12} 1
+perform_offset_multi_with_ref r0_04 s 0 {6 8} {1 1} {432 548 10 10} 1
+perform_offset_multi_with_ref r0_05 s 0 {6 8} {1 2} {452 572 12 12} 1
+perform_offset_multi_with_ref r0_06 s 0 {6 7 8} {1 2 2} {484 620 14 14} 1
+perform_offset_multi_with_ref r0_07 s 0 {6 8 9} {1 2 3} {496 644 15 15} 1
+perform_offset_multi_with_ref r0_08 s 0 {6 8 9 7} {1 2 3 4} {544 740 17 17} 1
+perform_offset_multi_with_ref r0_09 s 0 {6 8 9 7} {1 2 3 2} {512 692 16 16} 1
+perform_offset_multi_with_ref r0_10 s 0 {6 8 9 7 10 } {1 2 3 2 5} {520 712 16 16} 1
+perform_offset_multi_with_ref r0_11 s 0 {6 8 9 7 10 } {1 2 3 4 5} {544 760 15 15} 1
+perform_offset_multi_with_ref r0_12 s 0 {10} {2} {416 508 12 11} 1
+
+
+perform_offset_multi_with_ref r1_01 s 1 {6 7 8 9 10} {2 2 2 2 2} {672 1152 6 6} 1
+perform_offset_multi_with_ref r1_02 s 1 {6} {2} {648 1043 9 9} 1
+perform_offset_multi_with_ref r1_03 s 1 {6 9} {2 3} {696 1113 12 12} 1
+perform_offset_multi_with_ref r1_04 s 1 {6 8} {2 2} {662 1078 10 10} 1
+perform_offset_multi_with_ref r1_05 s 1 {6 8} {2 3} {686 1113 12 12} 1
+perform_offset_multi_with_ref r1_06 s 1 {6 7 8} {2 3 3} {724 1183 14 14} 1
+perform_offset_multi_with_ref r1_07 s 1 {6 8 9} {2 3 4} {738 1218 15 15} 1
+perform_offset_multi_with_ref r1_08 s 1 {6 8 9 7} {2 3 4 5} {794 1358 17 17} 1
+perform_offset_multi_with_ref r1_09 s 1 {6 8 9 7} {2 3 4 3} {756 1288 16 16} 1
+perform_offset_multi_with_ref r1_10 s 1 {6 8 9 7 10 } {2 3 4 3 5} {756 1304 16 16} 1
+perform_offset_multi_with_ref r1_11 s 1 {6 8 9 7 10 } {2 3 4 5 6} {794 1378 15 15} 1
+perform_offset_multi_with_ref r1_12 s 1 {6 8 9 7 10 } {2 3 4 5 2.5} {784 1364 16 16} 1
+perform_offset_multi_with_ref r1_13 s 1 {10} {2} {632 1012 12 11} 1
+
+# display all created shapes
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_11 result
+copy r0_11_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_box_top_split3.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {6 7 8 9 10 11 12 13 14} {1 1 1 1 1 1 1 1 1} {440 600 6 6} 1
+perform_offset_multi_with_ref r0_02 s 0 {7 8 11 12} {1 1 1 1} {448 532 26 26} 1
+perform_offset_multi_with_ref r0_03 s 0 {6 9 10 13 14} {1 1 1 1 1} {472 568 26 26} 1
+perform_offset_multi_with_ref r0_04 s 0 {14} {1} {408 504 12 11} 1
+perform_offset_multi_with_ref r0_05 s 0 {6 7 8 9 10 11 12 13} {1 1 1 1 1 1 1 1} {448 596 12 11} 1
+
+perform_offset_multi_with_ref r1_01 s 1 {6 7 8 9 10 11 12 13 14} {2 2 2 2 2 2 2 2 2} {672 1152 6 6} 1
+perform_offset_multi_with_ref r1_02 s 1 {7 8 11 12} {2 2 2 2} {680 1048 26 26} 1
+perform_offset_multi_with_ref r1_03 s 1 {6 9 10 13 14} {2 2 2 2 2} {712 1112 26 26} 1
+perform_offset_multi_with_ref r1_04 s 1 {14} {2} {632 1012 12 11} 1
+perform_offset_multi_with_ref r1_05 s 1 {14} {0} {632 1004 12 11} 1
+
+
+# display all created shapes
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_02 result
+copy r0_02_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_box_top_split4.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {2 5 6 8} {1 2 3 4} {530 750 12 12} 1
+perform_offset_multi_with_ref r0_02 s 0 {5 6} {1 1} {440 550 13 13} 1
+perform_offset_multi_with_ref r0_03 s 0 {5 6} {1 2} {460 575 13 13} 1
+
+perform_offset_multi_with_ref r1_01 s 1 {2 5 6 8} {2 3 4 5} {780 1368 12 12} 1
+perform_offset_multi_with_ref r1_02 s 1 {5 6} {2 2} {672 1080 13 13} 1
+perform_offset_multi_with_ref r1_03 s 1 {5 6} {2 3} {696 1116 13 13} 1
+
+# display all created shapes
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
\ No newline at end of file
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_plate_split.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {10} {3} {428 204 18 18} 1
+perform_offset_multi_with_ref r0_02 s 0 {10} {4} {432 212 18 18} 1
+perform_offset_multi_with_ref r0_03 s 0 {10} {5} {432 212 18 18} 1
+perform_offset_multi_with_ref r0_04 s 0 {6 14} {1 1} {464 220 18 18} 1
+perform_offset_multi_with_ref r0_05 s 0 {6 10 14} {1 2 1} {464 236 26 26} 1
+perform_offset_multi_with_ref r0_06 s 0 {6 10 14} {1 3 1} {464 240 26 26} 1
+perform_offset_multi_with_ref r0_07 s 0 {6 10 14} {1 4 1} {464 244 26 26} 1
+
+perform_offset_multi_with_ref r0_08 s 0 {9 11} {3 3} {440 228 22 22} 1
+perform_offset_multi_with_ref r0_09 s 0 {9 11} {4 4} {448 244 24 23} 1
+perform_offset_multi_with_ref r0_10 s 0 {6 9 11 14} {1 2 2 1} {464 252 34 34} 1
+perform_offset_multi_with_ref r0_11 s 0 {6 9 11 14} {1 3 3 1} {464 260 34 34} 1
+perform_offset_multi_with_ref r0_12 s 0 {6 9 11 14} {1 4 4 1} {464 268 36 35} 1
+
+perform_offset_multi_with_ref r0_13 s 0 {8 10 12} {3 3 3} {452 252 22 22} 1
+perform_offset_multi_with_ref r0_14 s 0 {8 10 12} {4 4 4} {464 276 22 20} 1
+perform_offset_multi_with_ref r0_15 s 0 {6 8 10 12 14 } {1 3 3 3 1} {464 280 30 30} 1
+perform_offset_multi_with_ref r0_16 s 0 {6 8 10 12 14 } {1 4 3 4 1} {464 288 28 27} 1
+perform_offset_multi_with_ref r0_17 s 0 {6 8 10 12 14 } {1 3 4 3 1} {464 284 30 30} 1
+perform_offset_multi_with_ref r0_18 s 0 {6 8 10 12 14 } {1 4 4 4 1} {464 292 30 28} 1
+
+perform_offset_multi_with_ref r0_19 s 0 {7 10 13} {1 2 1} {424 228 22 22} 1
+perform_offset_multi_with_ref r0_20 s 0 {7 10 13} {1 3 1} {424 228 22 22} 1; # Questionable result: shouldn't s_10 material cover s_7 and s_13?
+perform_offset_multi_with_ref r0_21 s 0 {7 9 11 13} {1 2 2 1} {424 236 28 27} 1
+perform_offset_multi_with_ref r0_22 s 0 {7 8 10 12 13} {1 2 2 2 1} {424 244 26 24} 1
+
+perform_offset_multi_with_ref r0_23 s 0 {8 9 10 11 12} {1 2 3 4 4} {392 292 18 18} 1
+
+
+perform_offset_multi_with_ref r1_01 s 1 {10} {3} {672 728 18 18} 1
+perform_offset_multi_with_ref r1_02 s 1 {10} {5} {672 736 18 18} 1
+perform_offset_multi_with_ref r1_03 s 1 {10} {6} {672 736 18 18} 1
+
+perform_offset_multi_with_ref r1_04 s 1 {6 14} {1.5 1.5} {702 756 18 18} 1
+perform_offset_multi_with_ref r1_05 s 1 {6 10 14} {1.5 2 1.5} {698 760 26 26} 1
+perform_offset_multi_with_ref r1_06 s 1 {6 10 14} {1.5 3 1.5} {696 762 26 26} 1
+perform_offset_multi_with_ref r1_07 s 1 {6 10 14} {1.5 5 1.5} {692 766 26 26} 1
+
+perform_offset_multi_with_ref r1_08 s 1 {9 11} {3 3} {672 736 22 22} 1
+perform_offset_multi_with_ref r1_09 s 1 {9 11} {5 5} {672 752 24 23} 1
+perform_offset_multi_with_ref r1_10 s 1 {6 9 11 14} {1.5 2 2 1.5} {694 764 34 34} 1
+perform_offset_multi_with_ref r1_11 s 1 {6 9 11 14} {1.5 4 4 1.5} {686 772 34 34} 1
+perform_offset_multi_with_ref r1_12 s 1 {6 9 11 14} {1.5 5 5 1.5} {682 776 36 35} 1
+
+perform_offset_multi_with_ref r1_13 s 1 {8 10 12} {3 3 3} {664 752 22 22} 1
+perform_offset_multi_with_ref r1_14 s 1 {8 10 12} {5 5 5} {656 784 22 20} 1
+perform_offset_multi_with_ref r1_15 s 1 {6 8 10 12 14 } {1.5 3 3 3 1.5} {672 780 30 30} 1
+perform_offset_multi_with_ref r1_16 s 1 {6 8 10 12 14 } {1.5 5 4 5 1.5} {654 794 28 27} 1
+perform_offset_multi_with_ref r1_17 s 1 {6 8 10 12 14 } {1.5 4 5 4 1.5} {660 790 30 30} 1
+perform_offset_multi_with_ref r1_18 s 1 {6 8 10 12 14 } {1.5 5 5 5 1.5} {652 796 30 28} 1
+
+perform_offset_multi_with_ref r1_19 s 1 {6 10 14} {0 2 0} {660 652 22 22} 1
+perform_offset_multi_with_ref r1_20 s 1 {6 10 14} {0 3 0} {660 652 22 22} 1
+perform_offset_multi_with_ref r1_21 s 1 {6 9 11 14} {0 2 2 0} {660 656 28 27} 1
+perform_offset_multi_with_ref r1_22 s 1 {7 8 10 12 13} {1.5 2 2 2 1.5} {664 740 26 24} 1
+
+perform_offset_multi_with_ref r1_23 s 1 {8 9 10 11 12} {1 2 3 4 5} {640 768 20 20} 1
+
+# display all created shapes
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "TODO OCC31200 All: Error: operation with offset value"
+puts "TODO OCC31200 All: Error: The area of result shape is"
+puts "TODO OCC31200 All: Error: The volume of result shape is"
+puts "TODO OCC31200 All: Error: number of "
+
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_plate_split.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {6 10 14} {1 5 1} {464 244 26 26} 1; # BAD (null shape)
+perform_offset_multi_with_ref r0_02 s 0 {9 11} {5 5} {448 244 24 23} 1; # BAD (filled part)
+perform_offset_multi_with_ref r0_03 s 0 {6 9 11 14} {1 5 5 1} {464 268 36 35} 1; # BAD (mostly removed)
+perform_offset_multi_with_ref r0_04 s 0 {8 10 12} {5 5 5} {464 276 22 20} 1; # BAD (out of borders)
+perform_offset_multi_with_ref r0_05 s 0 {6 8 10 12 14 } {1 5 5 5 1} {464 292 30 28} 1
+perform_offset_multi_with_ref r0_06 s 0 {7 9 11 13} {1 3 3 1} {424 236 28 27} 1
+perform_offset_multi_with_ref r0_07 s 0 {7 8 10 12 13} {1 3 3 3 1} {424 244 26 24} 1
+perform_offset_multi_with_ref r0_08 s 0 {8 9 10 11 12} {1 2 3 4 5} {392 292 18 18} 1
+
+perform_offset_multi_with_ref r1_01 s 1 {6 10 14} {1.5 6 1.5} {692 766 26 26} 1
+perform_offset_multi_with_ref r1_02 s 1 {9 11} {6 6} {672 752 24 23} 1
+perform_offset_multi_with_ref r1_03 s 1 {6 9 11 14} {1.5 6 6 1.5} {682 776 36 35} 1
+perform_offset_multi_with_ref r1_04 s 1 {8 10 12} {6 6 6} {656 784 22 20} 1
+perform_offset_multi_with_ref r1_05 s 1 {6 9 11 14} {0 3 3 0} {660 656 28 27} 1
+perform_offset_multi_with_ref r1_06 s 1 {8 9 10 11 12} {2 3 4 5 6} {622 786 18 18} 1
+
+
+# display all created shapes
+foreach val {0 1} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_02 result
+copy r0_02_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_U_shape_split1.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {6} {3} {708 340 14 14} 1
+perform_offset_multi_with_ref r0_02 s 0 {6 10} {3 3} {798 418 16 16} 1
+perform_offset_multi_with_ref r0_03 s 0 {9 6 11 8 1 3 30 32 27 25 22 24 19 17 14 16} {2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2} {1132 860 58 58} 1
+
+# display all created shapes
+foreach val {0} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_U_shape_split2.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {8 11} {3 3} {816 499 16 16} 1
+perform_offset_multi_with_ref r0_02 s 0 {7 11} {3 3} {804 448 17 17} 1
+perform_offset_multi_with_ref r0_03 s 0 {2 6 10 14 18 22 26 30} {2 2 2 2 2 2 2 2} {932 544 30 28} 1
+perform_offset_multi_with_ref r0_04 s 0 {2 6 10 18 22 26} {3 3 3 2 2 2} {968 584 26 26} 1
+
+# display all created shapes
+foreach val {0} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_U_shape_split3.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {2 6} {3 3} {810 478 18 18} 1
+perform_offset_multi_with_ref r0_02 s 0 {6 7 17} {3 3 3} {816 508 18 18} 1
+perform_offset_multi_with_ref r0_03 s 0 {6 7 17} {3 3 2} {812 485 20 20} 1
+perform_offset_multi_with_ref r0_04 s 0 {20 21 22 29 31} {2 2 2 2 2} {712 474 20 20} 1
+
+
+# display all created shapes
+foreach val {0} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+restore [locate_data_file bug31148_plate_offset_parallel.brep] s
+
+perform_offset_multi_with_ref result s 0 {22 24} {3 3} {472 260 34 34} 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+restore [locate_data_file bug31148_box_iso_face_top.brep] s
+
+perform_offset_multi_with_ref r1 s 0 {7} {2} {416 508 12 11} 1
+perform_offset_multi_with_ref res1 r1_unif 1 {} {} {656 1040 12 11} 1
+
+perform_offset_multi_with_ref r2 s 0 {6} {2} {496 692 12 11} 1
+perform_offset_multi_with_ref result r2_unif 0.5 {} {} {602 966 12 11} 1
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+setfillhistory 1
+
+restore [locate_data_file bug31148_box_iso_face_top.brep] s
+explode s f
+offsetparameter 1.e-7 c i r
+offsetload s 0
+offsetonface s_6 1
+offsetonface s_7 2
+offsetperform result
+
+savehistory h
+
+generated gf6 h s_6
+checkprops gf6 -equal s_6
+
+generated gf7 h s_7
+checkprops gf7 -equal s_7
+
+foreach e [explode s_7 e] {
+ generated ge_$e h $e
+ checknbshapes ge_$e -face 1 -m "History information"
+}
+
+foreach v [explode s_7 v] {
+ generated gv_$v h $v
+ checknbshapes gv_$v -edge 1 -m "History information"
+}
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+setfillhistory 1
+
+polyline p 0 0 0 10 0 0 10 0 1 8 0 1 8 0 4 8 0 7 7 0 7 7 0 4 7 0 1 3 0 1 3 0 4 3 0 7 2 0 7 2 0 4 2 0 1 0 0 1 0 0 0
+mkplane f p
+prism s f 0 10 0
+
+explode s f
+offsetparameter 1.e-7 c i r
+offsetload s 0
+offsetonface s_7 3
+offsetonface s_11 3
+offsetperform result
+
+savehistory h
+
+if {[regexp "Not deleted" [isdeleted h s_7]]} {
+ puts "Error: History information is wrong"
+}
+
+if {[regexp "Not deleted" [isdeleted h s_11]]} {
+ puts "Error: History information is wrong"
+}
+
+explode s_7 e
+generated ge1 h s_7_2
+checknbshapes ge1 -face 2 -m "History information"
+
+explode s_11 e
+generated ge2 h s_11_1
+checknbshapes ge2 -face 2 -m "History information"
+
+compound ge1 ge2 ge
+checknbshapes ge -face 3 -m "History information"
\ No newline at end of file
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 10} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_case_0.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {20 23 26 29 19 22 25 28} {5 5 5 5 5 5 5 5} {1.77792e+06 3.198e+07 38 38} 1
+perform_offset_multi_with_ref r0_02 s 0 {20 23 26 29 19 22 25 28} {43 43 43 43 43 43 43 43} {1.84032e+06 4.708e+07 32 26} 1
+perform_offset_multi_with_ref r0_03 s 0 {20 23 26 29 19 22 25 28} {50 50 50 50 50 50 50 50} {1.85712e+06 4.778e+07 32 26} 1
+perform_offset_multi_with_ref r0_04 s 0 {16 13 10 7 17 14 11 8} {5 5 5 5 5 5 5 5} {1.74272e+06 3.318e+07 38 38} 1
+perform_offset_multi_with_ref r0_05 s 0 {16 13 10 7 17 14 11 8} {43 43 43 43 43 43 43 43} {1.35936e+06 5.734e+07 26 26} 1
+
+perform_offset_multi_with_ref r10_01 s 10 {20 23 26 29 19 22 25 28} {5 5 5 5 5 5 5 5} {1.89232e+06 4.58432e+07 38 38} 1
+perform_offset_multi_with_ref r10_02 s 10 {20 23 26 29 19 22 25 28} {25 25 25 25 25 25 25 25} {2.05232e+06 5.49952e+07 38 38} 1
+perform_offset_multi_with_ref r10_03 s 10 {20 23 26 29 19 22 25 28} {43 43 43 43 43 43 43 43} {1.88804e+06 6.31176e+07 32 26} 1
+perform_offset_multi_with_ref r10_04 s 10 {20 23 26 29 19 22 25 28} {50 50 50 50 50 50 50 50} {1.90568e+06 6.39184e+07 32 26} 1
+perform_offset_multi_with_ref r10_05 s 10 {16 13 10 7 17 14 11 8} {5 5 5 5 5 5 5 5} {1.93072e+06 4.50112e+07 38 38} 1
+perform_offset_multi_with_ref r10_06 s 10 {16 13 10 7 17 14 11 8} {25 25 25 25 25 25 25 25} {1.93712e+06 5.74912e+07 38 38} 1
+perform_offset_multi_with_ref r10_07 s 10 {16 13 10 7 17 14 11 8} {43 43 43 43 43 43 43 43} {1.51172e+06 6.85672e+07 26 26} 1
+
+# display all created shapes
+foreach val {0 10} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 20} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_case_01.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {5 7 9 15 16 19 22 31} {5 10 15 20 25 30 35 40} {367820 6.96255e+06 42 42} 1
+perform_offset_multi_with_ref r0_02 s 0 {27 28 29 30 31 32 33 34 35} {5 10 15 20 25 30 35 40 45} {325505 6.3725e+06 30 30} 1
+perform_offset_multi_with_ref r0_03 s 0 {27 28 29 30 31 32 33 34 35 26 36} {5 10 15 20 25 30 35 40 45 50 50} {314340 7.034e+06 10 10} 1
+
+perform_offset_multi_with_ref r20_01 s 20 {5 7 9 15 16 19 22 31} {5 10 15 20 25 30 35 40} {494610 1.39435e+07 42 42} 1
+perform_offset_multi_with_ref r20_02 s 20 {27 28 29 30 31 32 33 34 35} {5 10 15 20 25 30 35 40 45} {476125 1.39614e+07 30 30} 1
+perform_offset_multi_with_ref r20_03 s 20 {27 28 29 30 31 32 33 34 35 26 36} {5 10 15 20 25 30 35 40 45 50 50} {453540 1.46808e+07 10 10} 1
+
+# display all created shapes
+foreach val {0 20} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 10} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_case_02.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {2 50} {40 40} {1.18693e+06 1.99372e+07 56 54} 1
+perform_offset_multi_with_ref r0_02 s 0 {18 20 26 32 24 29 36} {10 10 10 10 10 10 10} {1.2113e+06 2.08809e+07 60 60} 1
+perform_offset_multi_with_ref r0_03 s 0 {36 39 15 21 27 33 45 17 24 29 41 47} {20 20 20 20 20 20 20 20 20 20 20 20} {1.1742e+06 2.35232e+07 60 50} 1
+perform_offset_multi_with_ref r0_04 s 0 {18 23 30 35 42 48} {10 10 10 10 10 10} {1.19178e+06 2.06028e+07 58 58} 1
+
+perform_offset_multi_with_ref r10_01 s 10 {2 50} {40 40} {1.40737e+06 3.28873e+07 56 54} 1
+perform_offset_multi_with_ref r10_02 s 10 {18 20 26 32 24 29 36} {20 20 20 20 20 20 20} {1.4087e+06 3.3851e+07 60 56} 1
+perform_offset_multi_with_ref r10_03 s 10 {36 39 15 21 27 33 45 17 24 29 41 47} {20 20 20 20 20 20 20 20 20 20 20 20} {1.26845e+06 3.49235e+07 60 50} 1
+perform_offset_multi_with_ref r10_04 s 10 {18 23 30 35 42 48} {20 20 20 20 20 20} {1.41101e+06 3.34373e+07 58 58} 1
+
+# display all created shapes
+foreach val {0 10} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_case_02.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {12} {10} {1.18636e+06 1.99964e+07 48 48} 1
+perform_offset_multi_with_ref r0_02 s 0 {52} {10} {1.18579e+06 1.9974e+07 48 48} 1
+perform_offset_multi_with_ref r0_03 s 0 {12 52} {10 10} {1.18716e+06 2.00392e+07 49 49} 1
+perform_offset_multi_with_ref r0_04 s 0 {66 72} {10 10} {1.18396e+06 1.99776e+07 49 49} 1
+
+perform_offset_multi_with_ref r0_05 s 0 {67 69 71} {10 10 10} {1.18733e+06 2.00265e+07 50 50} 1
+perform_offset_multi_with_ref r0_06 s 0 {2 8 50 10 58} {10 10 10 10 10} {1.18501e+06 1.99966e+07 60 58} 1
+
+# display all created shapes
+foreach val {0} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_06 result
+copy r0_06_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 10} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_case_03.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {39 41} {10 10} {4.21228e+06 2.66736e+08 54 54} 1
+perform_offset_multi_with_ref r0_02 s 0 {39 41 64 62 23 58 56 52 50 68 70 11 17 29} {10 10 15 15 15 15 15 15 15 15 15 15 15 15} {4.26538e+06 2.67336e+08 86 86} 1
+
+perform_offset_multi_with_ref r10_01 s 10 {11 17 63 69} {15 15 15 15} {4.38533e+06 3.08911e+08 66 66} 1
+
+# display all created shapes
+foreach val {0 10} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_02 result
+copy r0_02_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {1} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_case_04.brep] s
+
+perform_offset_multi_with_ref r0_01 s 1 {332 309} {5 5} {1.07351e+07 5.85648e+08 72 62} 1
+
+perform_offset_multi_with_ref r0_01 s 1 {197} {5} {1.07345e+07 5.8564e+08 70 60} 1
+perform_offset_multi_with_ref r0_01 s 1 {147 149 171} {5 5 5} {1.07353e+07 5.85674e+08 78 68} 1
+
+# display all created shapes
+foreach val {1} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+restore [locate_data_file bug31148_case_04.brep] s
+
+explode s f
+offsetparameter 1e-7 c i
+offsetload s 5
+
+offsetonface s_168 15
+offsetonface s_99 15
+offsetonface s_145 15
+offsetonface s_122 15
+offsetonface s_169 15
+offsetonface s_100 15
+offsetonface s_146 15
+offsetonface s_123 15
+offsetonface s_170 15
+offsetonface s_101 15
+offsetonface s_147 15
+offsetonface s_124 15
+offsetonface s_171 15
+offsetonface s_102 15
+offsetonface s_148 15
+offsetonface s_125 15
+offsetonface s_172 15
+offsetonface s_103 15
+offsetonface s_149 15
+offsetonface s_126 15
+offsetonface s_173 15
+offsetonface s_104 15
+offsetonface s_150 15
+offsetonface s_127 15
+offsetonface s_174 15
+offsetonface s_105 15
+offsetonface s_151 15
+offsetonface s_128 15
+offsetonface s_175 15
+offsetonface s_106 15
+offsetonface s_152 15
+offsetonface s_129 15
+offsetonface s_176 15
+offsetonface s_107 15
+offsetonface s_153 15
+offsetonface s_130 20
+offsetonface s_177 20
+offsetonface s_108 20
+offsetonface s_154 20
+offsetonface s_131 20
+offsetonface s_178 20
+offsetonface s_109 20
+offsetonface s_155 20
+offsetonface s_132 20
+offsetonface s_179 20
+offsetonface s_110 20
+offsetonface s_156 20
+offsetonface s_133 20
+offsetonface s_180 20
+offsetonface s_111 20
+offsetonface s_157 20
+offsetonface s_134 20
+offsetonface s_181 20
+offsetonface s_112 20
+offsetonface s_158 20
+offsetonface s_135 20
+offsetonface s_182 20
+offsetonface s_113 20
+offsetonface s_159 20
+offsetonface s_136 20
+offsetonface s_183 20
+offsetonface s_114 20
+offsetonface s_160 20
+offsetonface s_137 20
+offsetonface s_184 20
+offsetonface s_115 20
+offsetonface s_161 20
+offsetonface s_138 10
+offsetonface s_185 10
+offsetonface s_116 10
+offsetonface s_162 10
+offsetonface s_139 10
+offsetonface s_186 10
+offsetonface s_117 10
+offsetonface s_163 10
+offsetonface s_140 10
+offsetonface s_187 10
+offsetonface s_118 10
+offsetonface s_164 10
+offsetonface s_141 10
+offsetonface s_188 10
+offsetonface s_119 10
+offsetonface s_165 10
+offsetonface s_142 10
+offsetonface s_189 10
+offsetonface s_120 10
+offsetonface s_166 10
+offsetonface s_143 10
+offsetonface s_190 10
+offsetonface s_121 10
+offsetonface s_167 10
+offsetonface s_144 10
+offsetonface s_928 10
+
+offsetperform result
+
+unifysamedom result_unif result
+
+checkprops result -s 1.04375e+07 -v 6.31578e+08
+checknbshapes result_unif -wire 98 -face 68 -shell 1 -solid 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+restore [locate_data_file bug31148_case_04.brep] s
+
+explode s f
+offsetparameter 1e-7 c i
+offsetload s 0
+
+offsetonface s_168 15
+offsetonface s_99 15
+offsetonface s_145 15
+offsetonface s_122 15
+offsetonface s_169 15
+offsetonface s_100 15
+offsetonface s_146 15
+offsetonface s_123 15
+offsetonface s_170 15
+offsetonface s_101 15
+offsetonface s_147 15
+offsetonface s_124 15
+offsetonface s_171 15
+offsetonface s_102 15
+offsetonface s_148 15
+offsetonface s_125 15
+offsetonface s_172 15
+offsetonface s_103 15
+offsetonface s_149 15
+offsetonface s_126 15
+offsetonface s_173 15
+offsetonface s_104 15
+offsetonface s_150 15
+offsetonface s_127 15
+offsetonface s_174 15
+offsetonface s_105 15
+offsetonface s_151 15
+offsetonface s_128 15
+offsetonface s_175 15
+offsetonface s_106 15
+offsetonface s_152 15
+offsetonface s_129 15
+offsetonface s_176 15
+offsetonface s_107 15
+offsetonface s_153 15
+offsetonface s_130 20
+offsetonface s_177 20
+offsetonface s_108 20
+offsetonface s_154 20
+offsetonface s_131 20
+offsetonface s_178 20
+offsetonface s_109 20
+offsetonface s_155 20
+offsetonface s_132 20
+offsetonface s_179 20
+offsetonface s_110 20
+offsetonface s_156 20
+offsetonface s_133 20
+offsetonface s_180 20
+offsetonface s_111 20
+offsetonface s_157 20
+offsetonface s_134 20
+offsetonface s_181 20
+offsetonface s_112 20
+offsetonface s_158 20
+offsetonface s_135 20
+offsetonface s_182 20
+offsetonface s_113 20
+offsetonface s_159 20
+offsetonface s_136 20
+offsetonface s_183 20
+offsetonface s_114 20
+offsetonface s_160 20
+offsetonface s_137 20
+offsetonface s_184 20
+offsetonface s_115 20
+offsetonface s_161 20
+offsetonface s_138 10
+offsetonface s_185 10
+offsetonface s_116 10
+offsetonface s_162 10
+offsetonface s_139 10
+offsetonface s_186 10
+offsetonface s_117 10
+offsetonface s_163 10
+offsetonface s_140 10
+offsetonface s_187 10
+offsetonface s_118 10
+offsetonface s_164 10
+offsetonface s_141 10
+offsetonface s_188 10
+offsetonface s_119 10
+offsetonface s_165 10
+offsetonface s_142 10
+offsetonface s_189 10
+offsetonface s_120 10
+offsetonface s_166 10
+offsetonface s_143 10
+offsetonface s_190 10
+offsetonface s_121 10
+offsetonface s_167 10
+offsetonface s_144 10
+offsetonface s_928 10
+
+offsetperform result
+
+unifysamedom result_unif result
+
+checkprops result -s 1.06617e+07 -v 5.80288e+08
+checknbshapes result_unif -wire 89 -face 68 -shell 1 -solid 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 10} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_case_05.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {22 28 34 37 31 25} {15 15 15 15 15 15} {1.32646e+06 2.29124e+07 58 58} 1
+perform_offset_multi_with_ref r0_02 s 0 {22 28 34 37 31 25} {20 20 20 20 20 20} {1.33071e+06 2.33084e+07 64 58} 1
+
+perform_offset_multi_with_ref r0_03 s 0 {1 4 18} {20 20 20} {1.27581e+06 2.21593e+07 49 49} 1
+perform_offset_multi_with_ref r0_04 s 0 {1 4 19} {20 20 20} {1.30573e+06 2.23156e+07 52 51} 1
+
+perform_offset_multi_with_ref r0_05 s 0 {14 16 18 19 21 30 39 50 34 23 43} {5 5 5 5 5 5 5 5 5 5 5} {1.30617e+06 2.23637e+07 58 58} 1
+
+perform_offset_multi_with_ref r10_01 s 10 {22 28 34 37 31 25} {15 15 15 15 15 15} {1.53928e+06 3.62401e+07 58 58} 1
+perform_offset_multi_with_ref r10_02 s 10 {22 28 34 37 31 25} {20 20 20 20 20 20} {1.54352e+06 3.66785e+07 64 58} 1
+
+perform_offset_multi_with_ref r10_03 s 10 {1 4 18} {20 20 20} {1.51232e+06 3.59638e+07 49 49} 1
+perform_offset_multi_with_ref r10_04 s 10 {1 4 19} {20 20 20} {1.53304e+06 3.61209e+07 52 51} 1
+
+# display all created shapes
+foreach val {0 10} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_case_06.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {50 56 62 28 22 16} {5 5 5 5 5 5} {3.6552e+06 2.29024e+08 74 74} 1
+perform_offset_multi_with_ref r0_02 s 0 {1 10 16 22 28 34 45 67 69 61 63 55 57 49 51 41} {5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5} {3.66906e+06 2.29716e+08 90 90} 1
+
+# display all created shapes
+foreach val {0} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_case_07.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {14 16 18 19 21 30 39 50 34 23 43} {5 5 5 5 5 5 5 5 5 5 5} {3.21582e+06 2.31469e+08 45 45} 1
+perform_offset_multi_with_ref r0_02 s 0 {15 20 18 9 4 6 24 26 29 35 40 38 46 44 49} {7 7 7 7 7 7 7 7 7 7 7 7 7 7 7} {3.2663e+06 2.31907e+08 71 71} 1
+
+# display all created shapes
+foreach val {0} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+restore [locate_data_file bug31148_case_08.brep] s
+
+perform_offset_multi_with_ref result s 0 {21 28 14 10 16 24} {10 10 10 10 10 10} {3.39098e+07 2.69762e+09 32 32} 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+restore [locate_data_file bug31148_case_09.brep] s
+
+perform_offset_multi_with_ref result s 0 {87 80 67 47 19 11 62 50 34} {10 10 10 10 10 10 10 10 10} {239234 3.80107e+06 46 46} 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0 10} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_case_10.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {19 21 23} {10 10 10} {4.882e+06 3.6973e+08 42 36} 1
+perform_offset_multi_with_ref r0_02 s 0 {20 22 24} {10 10 10} {4.8508e+06 3.71377e+08 42 36} 1
+
+perform_offset_multi_with_ref r10_01 s 10 {19 21 23} {30 30 30} {5.282e+06 4.20405e+08 42 36} 1
+perform_offset_multi_with_ref r10_02 s 10 {20 22 24} {30 30 30} {5.2148e+06 4.23051e+08 42 36} 1
+
+# display all created shapes
+foreach val {0 10} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_case_11.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {62 66 64 60 9 51} {15 15 15 15 15 15} {3.2808e+06 1.35876e+08 72 69} 1
+perform_offset_multi_with_ref r0_02 s 0 {29 52} {10 10} {3.27787e+06 1.35539e+08 58 55} 1
+perform_offset_multi_with_ref r0_03 s 0 {29 52} {10 70} {3.2781e+06 1.35539e+08 57 54} 1
+
+# display all created shapes
+foreach val {0} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_01 result
+copy r0_01_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+# unset draw variables for all offset values
+foreach val {0} {
+ foreach x [directory r${val}*_unif] {
+ unset $x
+ }
+}
+
+restore [locate_data_file bug31148_case_12.brep] s
+
+perform_offset_multi_with_ref r0_01 s 0 {48 49 50 38 1 39 40 35 25 14 15 18 9} {5 5 5 5 5 5 5 5 5 5 5 5 5} {3.28398e+06 2.29158e+08 52 52} 1
+
+perform_offset_multi_with_ref r0_02 s 0 {4 10 14 20 24 30 34 40 44 50} {4 4 4 4 4 4 4 4 4 4} {3.2691e+06 2.26799e+08 46 46} 1
+perform_offset_multi_with_ref r0_03 s 0 {4 10 14 20 24 30 34 40 44 50} {7 7 7 7 7 7 7 7 7 7} {3.2691e+06 2.26799e+08 46 46} 1
+
+perform_offset_multi_with_ref r0_04 s 0 {16 18 15 19 14 20} {10 10 7 7 5 5} {3.24265e+06 2.27026e+08 42 42} 1
+
+perform_offset_multi_with_ref r0_05 s 0 {6 16 26 36 46 8 18 28 38 48} {10 10 10 10 10 10 10 10 10 10} {3.24429e+06 2.27638e+08 56 56} 1
+perform_offset_multi_with_ref r0_06 s 0 {5 15 25 35 45 9 19 29 39 49} {7 7 7 7 7 7 7 7 7 7} {3.3322e+06 2.27616e+08 76 76} 1
+perform_offset_multi_with_ref r0_07 s 0 {6 16 26 36 46 8 18 28 38 48 5 15 25 35 45 9 19 29 39 49 4 14 24 34 44 10 20 30 40 50} \
+ {10 10 10 10 10 10 10 10 10 10 7 7 7 7 7 7 7 7 7 7 5 5 5 5 5 5 5 5 5 5} {3.22947e+06 2.28977e+08 66 66} 1
+
+
+# display all created shapes
+foreach val {0} {
+ foreach x [directory r${val}*_unif] {
+ if {[isdraw $x]} {
+ checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
+ }
+ }
+}
+
+copy r0_07 result
+copy r0_07_unif result_unif
--- /dev/null
+puts "========"
+puts "0031148: Offset adjacent co-planar faces with different offset values"
+puts "========"
+puts ""
+
+pload MODELING
+
+restore [locate_data_file bug31148_case_13.brep] s
+
+perform_offset_multi_with_ref result s 0 {17 20 21 22 23} {5 10 15 20 25} {795175 2.50687e+07 22 22} 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
--- /dev/null
+# Mode - Complete
+set calcul "c"
+# Join type - Intersection
+set type "i"
+
+proc compare_prop_values {prop m_res m_ref} {
+ if { ($m_ref != 0 && abs (($m_ref - $m_res) / double($m_ref)) > 1.e-2) || ($m_res == 0 && $m_ref != 0) } {
+ puts "Error: The $prop of result shape is $m_res, expected $m_ref"
+ return 0
+ } else {
+ puts "OK: The $prop of result shape is as expected"
+ return 1
+ }
+}
+
+proc compare_nbs {entity nb_res nb_ref} {
+ if {$nb_res != $nb_ref} {
+ puts "Error: number of $entity entities in the result shape is $nb_res, expected $nb_ref"
+ return 0
+ } else {
+ puts "OK: number of $entity entities in the result shape is as expected"
+ return 1
+ }
+}
+
+proc perform_offset_multi {theResult theShape theValue theFaceIds theFaceValues} {
+ upvar $theShape TheShape
+
+ global ${theResult}
+ global ${theResult}_unif
+
+ tcopy TheShape sx
+ offsetparameter 1.e-7 c i r
+ offsetload sx ${theValue}
+
+ set nbFaces [llength $theFaceIds]
+ if {$nbFaces > 0} {
+ explode sx f
+ }
+
+ for {set i 0} {$i < $nbFaces} {incr i} {
+ set face_id [lindex $theFaceIds $i]
+ set face_offset [lindex $theFaceValues $i]
+ offsetonface sx_${face_id} ${face_offset}
+ }
+
+ offsetperform ${theResult}
+
+ if {![catch { checkshape ${theResult} } ] } {
+ unifysamedom ${theResult}_unif ${theResult}
+ return 1
+ }
+ return 0
+}
+
+proc perform_offset_multi_with_ref {theResult theShape theValue theFaceIds theFaceValues theRefValues theUnified} {
+
+ upvar $theShape TheShape
+
+ global ${theResult}
+ global ${theResult}_unif
+
+ set operation_done [perform_offset_multi ${theResult} TheShape ${theValue} ${theFaceIds} ${theFaceValues}]
+
+ if {${operation_done} == 0} {
+ puts "Error: operation with offset value ${theValue} has failed"
+ return 0
+ }
+
+ set check_res {}
+
+ if { $theUnified == 1} {
+ set nbshapes_value [nbshapes ${theResult}_unif]
+ } else {
+ set nbshapes_value [nbshapes ${theResult}]
+ }
+
+ if { [llength $theRefValues] == 4} {
+ set area_value [lindex [sprops ${theResult}] 2]
+ set volume_value [lindex [vprops ${theResult}] 2]
+ set nbwires_value [lindex $nbshapes_value 13]
+ set nbfaces_value [lindex $nbshapes_value 16]
+
+ lappend checks_res [compare_prop_values "area" ${area_value} [lindex ${theRefValues} 0]]
+ lappend checks_res [compare_prop_values "volume" ${volume_value} [lindex ${theRefValues} 1]]
+
+ lappend checks_res [compare_nbs "wire" $nbwires_value [lindex ${theRefValues} 2]]
+ lappend checks_res [compare_nbs "face" $nbfaces_value [lindex ${theRefValues} 3]]
+ }
+
+ set nbshells_value [lindex $nbshapes_value 19]
+ set nbsolids_value [lindex $nbshapes_value 22]
+ lappend checks_res [compare_nbs "shell" $nbshells_value 1]
+ lappend checks_res [compare_nbs "solid" $nbsolids_value 1]
+
+ set OK 1
+ foreach x $checks_res {
+ if {$x == 0} {
+ set OK 0
+ break
+ }
+ }
+
+ set status "OK"
+ if {$OK == 0} {
+ puts "Error: operation with offset value ${theValue} produced incorrect result"
+ set status "KO"
+ }
+
+ puts "Offset value ${theValue} - $status: area - ${area_value}; volume - ${volume_value}; wires - ${nbwires_value}; faces - ${nbfaces_value} (${area_value} ${volume_value} ${nbwires_value} ${nbfaces_value})"
+
+ checkmaxtol ${theResult} -ref 1.e-6
+}
-puts "TODO OCC26578 All:An exception was caught"
-puts "TODO OCC26578 All:\\*\\* Exception \\*\\*"
-puts "TODO OCC26578 All:TEST INCOMPLETE"
+puts "TODO OCC26578 All: Error : is WRONG because number of"
+puts "TODO OCC26578 All: Faulty shapes in variables faulty_1 to faulty_"
+
restore [locate_data_file bug26663_test_offset_L3.brep] s
OFFSETSHAPE ${off_param} {} ${calcul} ${type}
checknbshapes result -ref [lrange [nbshapes s] 8 19]
-puts "TODO OCC26578 All:An exception was caught"
-puts "TODO OCC26578 All:\\*\\* Exception \\*\\*"
-puts "TODO OCC26578 All:TEST INCOMPLETE"
+puts "TODO OCC26578 All: Error : is WRONG because number of"
+puts "TODO OCC26578 All: Faulty shapes in variables faulty_1 to faulty_"
+
restore [locate_data_file bug26663_test_offset_L9.brep] s
OFFSETSHAPE ${off_param} {} ${calcul} ${type}
checknbshapes result -ref [lrange [nbshapes s] 8 19]
-puts "TODO OCC26578 All:An exception was caught"
-puts "TODO OCC26578 All:\\*\\* Exception \\*\\*"
-puts "TODO OCC26578 All:TEST INCOMPLETE"
+puts "TODO OCC26578 All: Error : is WRONG because number of"
+puts "TODO OCC26578 All: Faulty shapes in variables faulty_1 to faulty_"
+
restore [locate_data_file bug26663_test_offset_N1.brep] s
OFFSETSHAPE ${off_param} {} ${calcul} ${type}
checknbshapes result -ref [lrange [nbshapes s] 8 19]