From: emv Date: Thu, 9 Feb 2017 05:57:49 +0000 (+0300) Subject: 0028442: Incorrect result of 3D offset operation in mode Complete, Join type - Inters... X-Git-Tag: V7_2_0_beta~244 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=0da0275c1845a9f80dc8a154f57eaa024bc48402;p=occt.git 0028442: Incorrect result of 3D offset operation in mode Complete, Join type - Intersection 1. For the support of the new configurations of the input shapes for the 3D offset algorithm (shapes containing the faces with holes, which are growing during offset operation and sometimes (depending on the offset value) even kill the faces themselves) the new function *FindFacesInsideHoleWires* has been implemented. This new function looks for the splits of the offset face located inside the new hole wire built from offset edges of the edges of the hole wires of the original face. All found splits are simply removed. 2. Test cases for the issue. --- diff --git a/src/BRepOffset/BRepOffset_MakeOffset.cxx b/src/BRepOffset/BRepOffset_MakeOffset.cxx index 20630701d4..80545e2a35 100644 --- a/src/BRepOffset/BRepOffset_MakeOffset.cxx +++ b/src/BRepOffset/BRepOffset_MakeOffset.cxx @@ -263,10 +263,6 @@ static const TopAbs_ShapeEnum theSSType, TopoDS_Shape& theResult); -static - Standard_Boolean CheckNormals(const TopoDS_Face& theFIm, - const TopoDS_Face& theFOr); - static void UpdateInitOffset(BRepAlgo_Image& myInitOffset, BRepAlgo_Image& myImageOffset, @@ -4113,7 +4109,7 @@ Standard_Boolean BuildShellsCompleteInter(const BOPCol_ListOfShape& theLF, TopTools_ListIteratorOfListOfShape aItLF(aLFOr); for (; aItLF.More(); aItLF.Next()) { const TopoDS_Face& aFOr = TopoDS::Face(aItLF.Value()); - if (CheckNormals(aF, aFOr)) { + if (BRepOffset_Tool::CheckPlanesNormals(aF, aFOr)) { aLF3.Append(aF); break; } @@ -4159,71 +4155,6 @@ Standard_Boolean GetSubShapes(const TopoDS_Shape& theShape, return Standard_True; } -//======================================================================= -//function : CheckNormals -//purpose : Comparing normal directions of the faces -//======================================================================= -Standard_Boolean CheckNormals(const TopoDS_Face& theFIm, - const TopoDS_Face& theFOr) -{ - - Standard_Real aUMin, aUMax, aVMin, aVMax, aU, aV, anAngle; - gp_Pnt aP; - gp_Vec aVecU, aVecV, aVNIm, aVNOr; - Standard_Boolean bIsCollinear; - // - BRepAdaptor_Surface aSFIm(theFIm), aSFOr(theFOr); - // - aUMin = aSFIm.FirstUParameter(); - aUMax = aSFIm.LastUParameter(); - aVMin = aSFIm.FirstVParameter(); - aVMax = aSFIm.LastVParameter(); - // - aU = (aUMin + aUMax) * 0.5; - if (Precision::IsInfinite(aUMin) && - Precision::IsInfinite(aUMax)) { - aU = 0.; - } - else if (Precision::IsInfinite(aUMin) && - !Precision::IsInfinite(aUMax)) { - aU = aUMax; - } - else if (!Precision::IsInfinite(aUMin) && - Precision::IsInfinite(aUMax)) { - aU = aUMin; - } - // - aV = (aVMin + aVMax) * 0.5; - if (Precision::IsInfinite(aVMin) && - Precision::IsInfinite(aVMax)) { - aV = 0.; - } - else if (Precision::IsInfinite(aVMin) && - !Precision::IsInfinite(aVMax)) { - aV = aVMax; - } - else if (!Precision::IsInfinite(aVMin) && - Precision::IsInfinite(aVMax)) { - aV = aVMin; - } - // - aSFIm.D1(aU, aV, aP, aVecU, aVecV); - aVNIm = aVecU.Crossed(aVecV); - if (theFIm.Orientation() == TopAbs_REVERSED) { - aVNIm.Reverse(); - } - // - aSFOr.D1(aU, aV, aP, aVecU, aVecV); - aVNOr = aVecU.Crossed(aVecV); - if (theFOr.Orientation() == TopAbs_REVERSED) { - aVNOr.Reverse(); - } - // - anAngle = aVNIm.Angle(aVNOr); - bIsCollinear = (anAngle < Precision::Confusion()); - return bIsCollinear; -} - //======================================================================= //function : IsPlanar //purpose : Checks if all the faces of the shape are planes diff --git a/src/BRepOffset/BRepOffset_MakeOffset_1.cxx b/src/BRepOffset/BRepOffset_MakeOffset_1.cxx index 7265969804..826244e819 100644 --- a/src/BRepOffset/BRepOffset_MakeOffset_1.cxx +++ b/src/BRepOffset/BRepOffset_MakeOffset_1.cxx @@ -115,6 +115,7 @@ static TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, TopTools_DataMapOfShapeShape& theArtInvFaces, TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopTools_DataMapOfShapeListOfShape& theDMFNewHoles, TopoDS_Shape& theSolids, TopTools_DataMapOfShapeListOfShape& theSSInterfs); @@ -122,6 +123,7 @@ static void BuildSplitsOfInvFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, const TopTools_MapOfShape& theModifiedEdges, TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopTools_DataMapOfShapeListOfShape& theDMFNewHoles, TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, TopTools_DataMapOfShapeShape& theFacesOrigins, TopTools_DataMapOfShapeListOfShape& theOEImages, @@ -156,6 +158,7 @@ static TopTools_DataMapOfShapeListOfShape& theDMFLNE, TopTools_DataMapOfShapeListOfShape& theDMFLIE, TopTools_DataMapOfShapeListOfShape& theDMFLVIE, + TopTools_DataMapOfShapeListOfShape& theDMEOrLEIm, TopTools_MapOfShape& theMEInverted, TopTools_MapOfShape& theEdgesInvalidByVertex); @@ -169,8 +172,20 @@ static const TopTools_ListOfShape& theLEValInverted, const TopTools_MapOfShape& theMEInverted, const TopTools_MapOfShape& theEdgesInvalidByVertex, + const TopTools_MapOfShape& theMFHoles, + TopTools_IndexedMapOfShape& theMFInvInHole, TopTools_ListOfShape& theInvFaces); +static + void FindFacesInsideHoleWires(const TopoDS_Face& theFOrigin, + const TopoDS_Face& theFOffset, + const TopTools_ListOfShape& theLFImages, + const TopTools_MapOfShape& theInvertedEdges, + const TopTools_DataMapOfShapeListOfShape& theDMEOrLEIm, + TopTools_MapOfShape& theMFHoles, + TopTools_DataMapOfShapeListOfShape& theDMFNewHoles, + Handle(IntTools_Context)& theContext); + static gp_Vec GetAverageTangent(const TopoDS_Shape& theS, const Standard_Integer theNbP); @@ -219,6 +234,8 @@ static const TopTools_DataMapOfShapeShape& theArtInvFaces, const TopTools_IndexedMapOfShape& theInvEdges, const TopTools_IndexedMapOfShape& theMFToCheckInt, + const TopTools_IndexedMapOfShape& theMFInvInHole, + const TopoDS_Shape& theFHoles, TopTools_DataMapOfShapeListOfShape& theSSInterfs, TopTools_IndexedMapOfShape& theMERemoved, TopTools_IndexedMapOfShape& theMEInside, @@ -278,6 +295,7 @@ static const TopoDS_Shape& theSolids, const TopTools_DataMapOfShapeListOfShape& theSSInterfs, TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopTools_DataMapOfShapeListOfShape& theDMFNewHoles, TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, TopTools_DataMapOfShapeShape& theFacesOrigins, TopTools_DataMapOfShapeListOfShape& theOEImages, @@ -636,12 +654,15 @@ void BRepOffset_MakeOffset::BuildSplitsOfExtendedFaces(const TopTools_ListOfShap // keep information of already invalid faces to avoid // infinite rebuilding of the same invalid face TopTools_DataMapOfShapeInteger anAlreadyInvFaces; + // images of the hole faces of the original faces + TopTools_DataMapOfShapeListOfShape aDMFNewHoles; // solid build from the new splits TopoDS_Shape aSolids; // now we can split the faces BuildSplitsOfFaces(theLF, aNewEdges, theEdgesOrigins, theAsDes, theFacesOrigins, anOEImages, anOEOrigins, aLastInvEdges, anEdgesToAvoid, anInvEdges, aValidEdges, - anInvertedEdges, anAlreadyInvFaces, anInvFaces, anArtInvFaces, aFImages, aSolids, aSSInterfs); + anInvertedEdges, anAlreadyInvFaces, anInvFaces, anArtInvFaces, aFImages, + aDMFNewHoles, aSolids, aSSInterfs); // // Find faces to rebuild if (anInvFaces.Extent()) { @@ -652,9 +673,10 @@ void BRepOffset_MakeOffset::BuildSplitsOfExtendedFaces(const TopTools_ListOfShap if (aFToRebuild.Extent()) { // vertices to avoid TopTools_MapOfShape aVAEmpty; - RebuildFaces(aFToRebuild, aFSelfRebAvoid, aSolids, aSSInterfs, aFImages, theEdgesOrigins, theFacesOrigins, - anOEImages, anOEOrigins, aLastInvEdges, anEdgesToAvoid, anInvEdges, aValidEdges, anInvertedEdges, - anAlreadyInvFaces, anInvFaces, anArtInvFaces, aVAEmpty, theETrimEInf, theAsDes); + RebuildFaces(aFToRebuild, aFSelfRebAvoid, aSolids, aSSInterfs, aFImages, aDMFNewHoles, + theEdgesOrigins, theFacesOrigins, anOEImages, anOEOrigins, aLastInvEdges, + anEdgesToAvoid, anInvEdges, aValidEdges, anInvertedEdges, anAlreadyInvFaces, + anInvFaces, anArtInvFaces, aVAEmpty, theETrimEInf, theAsDes); } } // Fill history for faces and edges @@ -668,6 +690,7 @@ void BRepOffset_MakeOffset::BuildSplitsOfExtendedFaces(const TopTools_ListOfShap void BuildSplitsOfInvFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, const TopTools_MapOfShape& theModifiedEdges, TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopTools_DataMapOfShapeListOfShape& theDMFNewHoles, TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, TopTools_DataMapOfShapeShape& theFacesOrigins, TopTools_DataMapOfShapeListOfShape& theOEImages, @@ -707,7 +730,8 @@ void BuildSplitsOfInvFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theF // BuildSplitsOfFaces(aLF, theModifiedEdges, theEdgesOrigins, theAsDes, theFacesOrigins, theOEImages, theOEOrigins, theLastInvEdges, theEdgesToAvoid, anInvEdges, theValidEdges, - anInvertedEdges, theAlreadyInvFaces, anInvFaces, anArtInvFaces, theFImages, aSolids, aSSInterfs); + anInvertedEdges, theAlreadyInvFaces, anInvFaces, anArtInvFaces, theFImages, + theDMFNewHoles, aSolids, aSSInterfs); // if (anInvFaces.Extent()) { TopTools_IndexedDataMapOfShapeListOfShape aFToRebuild; @@ -715,9 +739,10 @@ void BuildSplitsOfInvFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theF FindFacesToRebuild(theFImages, anInvEdges, anInvFaces, aSSInterfs, aFToRebuild, aFSelfRebAvoid); // if (aFToRebuild.Extent()) { - RebuildFaces(aFToRebuild, aFSelfRebAvoid, aSolids, aSSInterfs, theFImages, theEdgesOrigins, theFacesOrigins, - theOEImages, theOEOrigins, theLastInvEdges, theEdgesToAvoid, anInvEdges, theValidEdges, anInvertedEdges, - theAlreadyInvFaces, anInvFaces, anArtInvFaces, theVertsToAvoid, theETrimEInf, theAsDes); + RebuildFaces(aFToRebuild, aFSelfRebAvoid, aSolids, aSSInterfs, theFImages, theDMFNewHoles, + theEdgesOrigins, theFacesOrigins, theOEImages, theOEOrigins, theLastInvEdges, + theEdgesToAvoid, anInvEdges, theValidEdges, anInvertedEdges, theAlreadyInvFaces, + anInvFaces, anArtInvFaces, theVertsToAvoid, theETrimEInf, theAsDes); } } } @@ -743,6 +768,7 @@ void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF, TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, TopTools_DataMapOfShapeShape& theArtInvFaces, TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopTools_DataMapOfShapeListOfShape& theDMFNewHoles, TopoDS_Shape& theSolids, TopTools_DataMapOfShapeListOfShape& theSSInterfs) { @@ -767,6 +793,8 @@ void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF, TopTools_IndexedMapOfShape aMFToCheckInt; // map of edges created from vertex and marked as invalid TopTools_MapOfShape aMEdgeInvalidByVertex; + // connection map from old edges to new ones + TopTools_DataMapOfShapeListOfShape aDMEOrLEIm; // Handle(IntTools_Context) aCtx = new IntTools_Context; // build splits of faces @@ -877,7 +905,7 @@ void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF, // find invalid edges FindInvalidEdges(aF, aLFImages, theEdgesOrigins, theFacesOrigins, theOEImages, theOEOrigins, theInvEdges, theValidEdges, aDMFLVE, aDMFLNE, aDMFLIE, - aDMFLVIE, theInvertedEdges, aMEdgeInvalidByVertex); + aDMFLVIE, aDMEOrLEIm, theInvertedEdges, aMEdgeInvalidByVertex); // // save the new splits if (!pLFIm) { @@ -922,11 +950,16 @@ void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF, #endif // TopTools_ListOfShape anEmptyList; + // invalid faces inside the holes + TopTools_IndexedMapOfShape aMFInvInHole; + // all hole faces + TopoDS_Compound aFHoles; + aBB.MakeCompound(aFHoles); // find invalid faces // considering faces containing only invalid edges as invalid aItLF.Initialize(aLFDone); for (; aItLF.More(); aItLF.Next()) { - const TopoDS_Shape& aF = aItLF.Value(); + const TopoDS_Face& aF = TopoDS::Face(aItLF.Value()); TopTools_ListOfShape& aLFImages = theFImages.ChangeFromKey(aF); // TopTools_ListOfShape aLFInv; @@ -946,8 +979,21 @@ void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF, pLIVE = &anEmptyList; } // + // find faces inside holes wires + TopTools_MapOfShape aMFHoles; + const TopoDS_Face& aFOr = TopoDS::Face(theFacesOrigins.Find(aF)); + FindFacesInsideHoleWires(aFOr, aF, aLFImages, theInvertedEdges, + aDMEOrLEIm, aMFHoles, theDMFNewHoles, aCtx); + // + TopTools_MapIteratorOfMapOfShape aItMH(aMFHoles); + for (; aItMH.More(); aItMH.Next()) { + aBB.Add(aFHoles, aItMH.Value()); + } + // + // find invalid faces FindInvalidFaces(aLFImages, theInvEdges, theValidEdges, aDMFLVE, aDMFLIE, - *pLNE, *pLIVE, theInvertedEdges, aMEdgeInvalidByVertex, aLFInv); + *pLNE, *pLIVE, theInvertedEdges, aMEdgeInvalidByVertex, + aMFHoles, aMFInvInHole, aLFInv); } // if (aLFInv.Extent()) { @@ -999,7 +1045,8 @@ void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF, // remove inside faces TopTools_IndexedMapOfShape aMEInside; RemoveInsideFaces(theFImages, theInvFaces, theArtInvFaces, theInvEdges, - aMFToCheckInt, theSSInterfs, aMERemoved, aMEInside, theSolids); + aMFToCheckInt, aMFInvInHole, aFHoles, theSSInterfs, + aMERemoved, aMEInside, theSolids); // // make compound of valid splits TopoDS_Compound aCFIm; @@ -1426,6 +1473,7 @@ void FindInvalidEdges(const TopoDS_Face& theF, TopTools_DataMapOfShapeListOfShape& theDMFLNE, TopTools_DataMapOfShapeListOfShape& theDMFLIE, TopTools_DataMapOfShapeListOfShape& theDMFLVIE, + TopTools_DataMapOfShapeListOfShape& theDMEOrLEIm, TopTools_MapOfShape& theMEInverted, TopTools_MapOfShape& theEdgesInvalidByVertex) { @@ -1436,7 +1484,8 @@ void FindInvalidEdges(const TopoDS_Face& theF, // The edges created from vertices, i.e. as intersection between two faces connected only // by VERTEX, will also be checked on validity. For these edges the correct orientation will // be defined by the edges on the original face adjacent to the connection vertex - // + + // original face const TopoDS_Face& aFOr = *(TopoDS_Face*)&theFacesOrigins.Find(theF); // invalid edges TopTools_IndexedMapOfShape aMEInv; @@ -1558,6 +1607,12 @@ void FindInvalidEdges(const TopoDS_Face& theF, } else { FindShape(aSOr, aFOr, aEOrF); + // + TopTools_ListOfShape *pLEIm = theDMEOrLEIm.ChangeSeek(aSOr); + if (!pLEIm) { + pLEIm = theDMEOrLEIm.Bound(aSOr, TopTools_ListOfShape()); + } + AppendToList(*pLEIm, aEIm); } // if (aEOrF.IsNull()) { @@ -1707,6 +1762,8 @@ void FindInvalidFaces(TopTools_ListOfShape& theLFImages, const TopTools_ListOfShape& theLEValInverted, const TopTools_MapOfShape& theMEInverted, const TopTools_MapOfShape& theEdgesInvalidByVertex, + const TopTools_MapOfShape& theMFHoles, + TopTools_IndexedMapOfShape& theMFInvInHole, TopTools_ListOfShape& theInvFaces) { // The face should be considered as invalid in the following cases: @@ -1827,10 +1884,21 @@ void FindInvalidFaces(TopTools_ListOfShape& theLFImages, !(bHasValid || bAllValid) && !(bAllInvNeutral && (aNbChecked == 1)))) { theInvFaces.Append(aFIm); + if (theMFHoles.Contains(aFIm)) { + theMFInvInHole.Add(aFIm); + } aItLF.Next(); continue; } // + if (theMFHoles.Contains(aFIm)) { + // remove edges from neutral + TopExp::MapShapes(aFIm, TopAbs_EDGE, aMENRem); + // remove face + theLFImages.Remove(aItLF); + continue; + } + // if (!bAllInvNeutral) { aLFPT.Append(aFIm); } @@ -1898,6 +1966,159 @@ void FindInvalidFaces(TopTools_ListOfShape& theLFImages, } } +//======================================================================= +//function : FindFacesInsideHoleWires +//purpose : Find faces inside holes wires from the original face +//======================================================================= +void FindFacesInsideHoleWires(const TopoDS_Face& theFOrigin, + const TopoDS_Face& theFOffset, + const TopTools_ListOfShape& theLFImages, + const TopTools_MapOfShape& theInvertedEdges, + const TopTools_DataMapOfShapeListOfShape& theDMEOrLEIm, + TopTools_MapOfShape& theMFHoles, + TopTools_DataMapOfShapeListOfShape& theDMFNewHoles, + Handle(IntTools_Context)& theContext) +{ + if (theLFImages.IsEmpty()) { + return; + } + // + // find all hole wires in the original face + TopTools_ListOfShape aLHoleWires; + const TopoDS_Wire& anOuterWire = BRepTools::OuterWire(theFOrigin); + TopExp_Explorer aExpW(theFOrigin, TopAbs_WIRE); + for (; aExpW.More(); aExpW.Next()) { + const TopoDS_Wire& aHoleWire = TopoDS::Wire(aExpW.Current()); + if (!aHoleWire.IsSame(anOuterWire) && aHoleWire.Orientation() != TopAbs_INTERNAL) { + aLHoleWires.Append(aHoleWire); + } + } + // + if (aLHoleWires.IsEmpty()) { + // no holes in the face + return; + } + // + TopTools_ListOfShape *pLFNewHoles = theDMFNewHoles.ChangeSeek(theFOrigin); + // + if (!pLFNewHoles) { + pLFNewHoles = theDMFNewHoles.Bound(theFOrigin, TopTools_ListOfShape()); + } + if (pLFNewHoles->IsEmpty()) { + // + // find the faces representing holes in the images of the faces: + // 1. for each original hole wire try to build its image + // 2. build the new planar face from the images + // + // map vertices and edges of the splits + TopTools_IndexedMapOfShape aMESplits; + TopTools_ListIteratorOfListOfShape aItLF(theLFImages); + for (; aItLF.More(); aItLF.Next()) { + TopExp::MapShapes(aItLF.Value(), TopAbs_EDGE, aMESplits); + } + // + TopTools_ListIteratorOfListOfShape aItLW(aLHoleWires); + for (; aItLW.More(); aItLW.Next()) { + const TopoDS_Wire& aHoleWire = TopoDS::Wire(aItLW.Value()); + // find images of all edges of the original wire + TopTools_IndexedMapOfShape aMEImWire; + TopoDS_Iterator aItE(aHoleWire); + for (; aItE.More(); aItE.Next()) { + const TopoDS_Shape& aEOr = aItE.Value(); + const TopTools_ListOfShape *pLEIm = theDMEOrLEIm.Seek(aEOr); + if (!pLEIm || pLEIm->IsEmpty()) { + continue; + } + TopTools_ListIteratorOfListOfShape aItLEIm(*pLEIm); + for (; aItLEIm.More(); aItLEIm.Next()) { + const TopoDS_Shape& aEIm = aItLEIm.Value(); + if (aMESplits.Contains(aEIm)) { + aMEImWire.Add(aEIm); + } + } + } + // + if (aMEImWire.IsEmpty()) { + continue; + } + // + // build new planar face using these edges + BOPCol_ListOfShape aLE; + Standard_Integer i, aNbE = aMEImWire.Extent(); + for (i = 1; i <= aNbE; ++i) { + aLE.Append(aMEImWire(i).Oriented(TopAbs_FORWARD)); + aLE.Append(aMEImWire(i).Oriented(TopAbs_REVERSED)); + } + // + BOPAlgo_BuilderFace aBF; + aBF.SetFace(TopoDS::Face(theFOffset.Oriented(TopAbs_FORWARD))); + aBF.SetShapes(aLE); + aBF.Perform(); + // + const BOPCol_ListOfShape& aLFNew = aBF.Areas(); + if (aLFNew.IsEmpty()) { + continue; + } + // + // check if outer edges in the new faces are not inverted + // because the inverted edges mean that the hole has been + // filled during offset and there will be no faces to remove + TopTools_IndexedDataMapOfShapeListOfShape aDMEFNew; + TopTools_ListIteratorOfListOfShape aItLFNew(aLFNew); + for (; aItLFNew.More(); aItLFNew.Next()) { + TopExp::MapShapesAndAncestors(aItLFNew.Value(), TopAbs_EDGE, TopAbs_FACE, aDMEFNew); + } + // + aNbE = aDMEFNew.Extent(); + for (i = 1; i <= aNbE; ++i) { + if (aDMEFNew(i).Extent() == 1) { + const TopoDS_Shape& aE = aDMEFNew.FindKey(i); + if (theInvertedEdges.Contains(aE)) { + break; + } + } + } + // + if (i <= aNbE) { + continue; + } + // + aItLFNew.Initialize(aLFNew); + for (; aItLFNew.More(); aItLFNew.Next()) { + pLFNewHoles->Append(aItLFNew.Value()); + } + } + } + // + // among the splits of the offset face find those that are + // located inside the hole faces + // + TopTools_ListIteratorOfListOfShape aItLF(theLFImages); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Face& aFIm = TopoDS::Face(aItLF.Value()); + // + // get the point inside the face and classify it relatively hole faces + gp_Pnt aP3D; + gp_Pnt2d aP2D; + Standard_Integer iErr = BOPTools_AlgoTools3D::PointInFace(aFIm, aP3D, aP2D, theContext); + if (iErr) { + continue; + } + // + Standard_Real aTol = BRep_Tool::Tolerance(aFIm); + // + TopTools_ListIteratorOfListOfShape aItLFNew(*pLFNewHoles); + for (; aItLFNew.More(); aItLFNew.Next()) { + const TopoDS_Face& aFNew = TopoDS::Face(aItLFNew.Value()); + if (theContext->IsValidPointForFace(aP3D, aFNew, aTol)) { + // the face is classified as IN + theMFHoles.Add(aFIm); + break; + } + } + } +} + //======================================================================= //function : GetAverageTangent //purpose : Computes average tangent vector along the curve @@ -2570,6 +2791,8 @@ void RemoveInsideFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages, const TopTools_DataMapOfShapeShape& theArtInvFaces, const TopTools_IndexedMapOfShape& theInvEdges, const TopTools_IndexedMapOfShape& theMFToCheckInt, + const TopTools_IndexedMapOfShape& theMFInvInHole, + const TopoDS_Shape& theFHoles, TopTools_DataMapOfShapeListOfShape& theSSInterfs, TopTools_IndexedMapOfShape& theMERemoved, TopTools_IndexedMapOfShape& theMEInside, @@ -2646,8 +2869,12 @@ void RemoveInsideFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages, // to check them on validity - the created solids should be complete, // i.e. all faces should be included. // + TopTools_MapOfShape aMFToRem; // Check completeness if (aMV.HasDeleted()) { + TopTools_IndexedMapOfShape aMEHoles; + TopExp::MapShapes(theFHoles, TopAbs_EDGE, aMEHoles); + // // perform additional check on faces aNb = theFImages.Extent(); for (i = 1; i <= aNb; ++i) { @@ -2656,21 +2883,31 @@ void RemoveInsideFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages, continue; } // + Standard_Boolean bFaceKept = Standard_False; aItLF.Initialize(aLFIm); for (; aItLF.More(); aItLF.Next()) { const TopoDS_Shape& aFIm = aItLF.Value(); if (!aMV.IsDeleted(aFIm)) { - break; + bFaceKept = Standard_True; + continue; + } + // + TopExp_Explorer aExpE(aFIm, TopAbs_EDGE); + for (; aExpE.More(); aExpE.Next()) { + if (aMEHoles.Contains(aExpE.Current())) { + bFaceKept = Standard_True; + aMFToRem.Add(aFIm); + break; + } } } // - if (!aItLF.More()) { + if (!bFaceKept) { return; } } } // - TopTools_MapOfShape aMFToRem; TopTools_IndexedMapOfShape aMEBoundary; aNb = aDMFS.Extent(); for (i = 1; i <= aNb; ++i) { @@ -2696,6 +2933,43 @@ void RemoveInsideFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages, } } // + // check if the invalid faces inside the holes are really invalid: + // check its normal direction - if it has changed relatively the + // original face the offset face is invalid and should be kept for rebuilding + Standard_Integer aNbFH = theMFInvInHole.Extent(); + for (i = 1; i <= aNbFH; ++i) { + const TopoDS_Shape& aFInv = theMFInvInHole(i); + TopTools_ListOfShape aLFInvIm = aMV.Modified(aFInv); + if (aLFInvIm.IsEmpty()) { + aLFInvIm.Append(aFInv); + } + // + const TopoDS_Shape *pFOffset = aDMFImF.Seek(aFInv); + if (!pFOffset) { + continue; + } + TopTools_ListIteratorOfListOfShape aItLFInv(aLFInvIm); + for (; aItLFInv.More(); aItLFInv.Next()) { + const TopoDS_Shape& aFInvIm = aItLFInv.Value(); + const TopTools_ListOfShape* pLSols = aDMFS.Seek(aFInvIm); + if (!pLSols || pLSols->Extent() != 1) { + continue; + } + // + const TopoDS_Shape& aFSol = pLSols->First(); + // + TopoDS_Shape aFx; + if (!FindShape(aFInvIm, aFSol, aFx)) { + continue; + } + // + if (BRepOffset_Tool::CheckPlanesNormals(TopoDS::Face(aFx), TopoDS::Face(*pFOffset))) { + // the normal direction has not changed, thus the face can be removed + aMFToRem.Add(aFInvIm); + } + } + } + // TopoDS_Compound aSolids; BRep_Builder().MakeCompound(aSolids); TopTools_MapOfShape aMFKeep; @@ -3420,6 +3694,7 @@ void RebuildFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild const TopoDS_Shape& theSolids, const TopTools_DataMapOfShapeListOfShape& theSSInterfs, TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopTools_DataMapOfShapeListOfShape& theDMFNewHoles, TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, TopTools_DataMapOfShapeShape& theFacesOrigins, TopTools_DataMapOfShapeListOfShape& theOEImages, @@ -3444,7 +3719,7 @@ void RebuildFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild theInvFaces, theArtInvFaces, theVertsToAvoid, theETrimEInf, aModifiedEdges, theAsDes); // // 2. Repeat steps to build the correct faces - BuildSplitsOfInvFaces(theFToRebuild, aModifiedEdges, theFImages, theEdgesOrigins, + BuildSplitsOfInvFaces(theFToRebuild, aModifiedEdges, theFImages, theDMFNewHoles, theEdgesOrigins, theFacesOrigins, theOEImages, theOEOrigins, theLastInvEdges, theEdgesToAvoid, theVertsToAvoid, theAlreadyInvFaces, theValidEdges, theETrimEInf, theAsDes); diff --git a/src/BRepOffset/BRepOffset_Tool.cxx b/src/BRepOffset/BRepOffset_Tool.cxx index 4c8b98c5f7..e7488cde97 100644 --- a/src/BRepOffset/BRepOffset_Tool.cxx +++ b/src/BRepOffset/BRepOffset_Tool.cxx @@ -4022,5 +4022,30 @@ void BRepOffset_Tool::CorrectOrientation(const TopoDS_Shape& SI, } - - +//======================================================================= +//function : CheckNormals +//purpose : +//======================================================================= +Standard_Boolean BRepOffset_Tool::CheckPlanesNormals(const TopoDS_Face& theFace1, + const TopoDS_Face& theFace2, + const Standard_Real theTolAng) +{ + BRepAdaptor_Surface aBAS1(theFace1, Standard_False), aBAS2(theFace2, Standard_False); + if (aBAS1.GetType() != GeomAbs_Plane || + aBAS2.GetType() != GeomAbs_Plane) { + return Standard_False; + } + // + gp_Dir aDN1 = aBAS1.Plane().Position().Direction(); + if (theFace1.Orientation() == TopAbs_REVERSED) { + aDN1.Reverse(); + } + // + gp_Dir aDN2 = aBAS2.Plane().Position().Direction(); + if (theFace2.Orientation() == TopAbs_REVERSED) { + aDN2.Reverse(); + } + // + Standard_Real anAngle = aDN1.Angle(aDN2); + return (anAngle < theTolAng); +} diff --git a/src/BRepOffset/BRepOffset_Tool.hxx b/src/BRepOffset/BRepOffset_Tool.hxx index c4d9e3f681..25ad516b1b 100644 --- a/src/BRepOffset/BRepOffset_Tool.hxx +++ b/src/BRepOffset/BRepOffset_Tool.hxx @@ -132,27 +132,16 @@ public: Standard_EXPORT static Standard_Real Gabarit (const Handle(Geom_Curve)& aCurve); - - + //! Compares the normal directions of the planar faces and returns + //! TRUE if the directions are the same with the given precision.
+ Standard_EXPORT static Standard_Boolean CheckPlanesNormals(const TopoDS_Face& theFace1, + const TopoDS_Face& theFace2, + const Standard_Real theTolAng = 1.e-8); protected: - - - - private: - - - - }; - - - - - - #endif // _BRepOffset_Tool_HeaderFile diff --git a/tests/offset/shape_type_i_c/YA1 b/tests/offset/shape_type_i_c/YA1 new file mode 100644 index 0000000000..7548af0651 --- /dev/null +++ b/tests/offset/shape_type_i_c/YA1 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_input.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 100 + } +} +offsetperform result + +checkprops result -v 1.41675e+007 -s 507751 + +unifysamedom result_unif result +checknbshapes result_unif -face 16 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YA2 b/tests/offset/shape_type_i_c/YA2 new file mode 100644 index 0000000000..ac989c6be5 --- /dev/null +++ b/tests/offset/shape_type_i_c/YA2 @@ -0,0 +1,10 @@ +restore [locate_data_file bug28442_input.brep] s + +OFFSETSHAPE 130 {} $calcul $type + +checkprops result -v 1.31751e+008 -s 1.66862e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 11 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YA3 b/tests/offset/shape_type_i_c/YA3 new file mode 100644 index 0000000000..68e8bfd89a --- /dev/null +++ b/tests/offset/shape_type_i_c/YA3 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 0.5 + } +} +offsetperform result + +checkprops result -v 406.625 -s 605.617 + +unifysamedom result_unif result +checknbshapes result_unif -face 16 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YA4 b/tests/offset/shape_type_i_c/YA4 new file mode 100644 index 0000000000..e8700594cf --- /dev/null +++ b/tests/offset/shape_type_i_c/YA4 @@ -0,0 +1,10 @@ +restore [locate_data_file bug28442_simple.brep] s + +OFFSETSHAPE 1.5 {} $calcul $type + +checkprops result -v 1504.61 -s 1006.51 + +unifysamedom result_unif result +checknbshapes result_unif -face 16 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YA5 b/tests/offset/shape_type_i_c/YA5 new file mode 100644 index 0000000000..e6d76b9115 --- /dev/null +++ b/tests/offset/shape_type_i_c/YA5 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple2.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 0.5 + } +} +offsetperform result + +checkprops result -v 483.996 -s 587.42 + +unifysamedom result_unif result +checknbshapes result_unif -face 16 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YA6 b/tests/offset/shape_type_i_c/YA6 new file mode 100644 index 0000000000..fa9e6f4f42 --- /dev/null +++ b/tests/offset/shape_type_i_c/YA6 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple6.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 0.5 + } +} +offsetperform result + +checkprops result -v 484.958 -s 589.936 + +unifysamedom result_unif result +checknbshapes result_unif -face 21 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YA7 b/tests/offset/shape_type_i_c/YA7 new file mode 100644 index 0000000000..ad7961445d --- /dev/null +++ b/tests/offset/shape_type_i_c/YA7 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_input.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 130 + } +} +offsetperform result + +checkprops result -v 1.57185e+007 -s 547937 + +unifysamedom result_unif result +checknbshapes result_unif -face 17 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YA8 b/tests/offset/shape_type_i_c/YA8 new file mode 100644 index 0000000000..4c26b2a462 --- /dev/null +++ b/tests/offset/shape_type_i_c/YA8 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_input.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 150 + } +} +offsetperform result + +checkprops result -v 1.67576e+007 -s 563859 + +unifysamedom result_unif result +checknbshapes result_unif -face 15 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YA9 b/tests/offset/shape_type_i_c/YA9 new file mode 100644 index 0000000000..62c0ae28f5 --- /dev/null +++ b/tests/offset/shape_type_i_c/YA9 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_input.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 180 + } +} +offsetperform result + +checkprops result -v 1.836e+007 -s 577200 + +unifysamedom result_unif result +checknbshapes result_unif -face 6 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YB1 b/tests/offset/shape_type_i_c/YB1 new file mode 100644 index 0000000000..88e961903b --- /dev/null +++ b/tests/offset/shape_type_i_c/YB1 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_input.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 210 + } +} +offsetperform result + +checkprops result -v 1.998e+007 -s 618600 + +unifysamedom result_unif result +checknbshapes result_unif -face 6 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YB2 b/tests/offset/shape_type_i_c/YB2 new file mode 100644 index 0000000000..141066b15e --- /dev/null +++ b/tests/offset/shape_type_i_c/YB2 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 0.9 + } +} +offsetperform result + +checkprops result -v 465.053 -s 629.882 + +unifysamedom result_unif result +checknbshapes result_unif -face 17 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YB3 b/tests/offset/shape_type_i_c/YB3 new file mode 100644 index 0000000000..d0b3cfe9c9 --- /dev/null +++ b/tests/offset/shape_type_i_c/YB3 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 1.3 + } +} +offsetperform result + +checkprops result -v 524.605 -s 649.688 + +unifysamedom result_unif result +checknbshapes result_unif -face 17 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YB4 b/tests/offset/shape_type_i_c/YB4 new file mode 100644 index 0000000000..a2df45629c --- /dev/null +++ b/tests/offset/shape_type_i_c/YB4 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 1.6 + } +} +offsetperform result + +checkprops result -v 570.493 -s 664.008 + +unifysamedom result_unif result +checknbshapes result_unif -face 17 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YB5 b/tests/offset/shape_type_i_c/YB5 new file mode 100644 index 0000000000..e287ef3d71 --- /dev/null +++ b/tests/offset/shape_type_i_c/YB5 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 2 + } +} +offsetperform result + +checkprops result -v 633.44 -s 682.386 + +unifysamedom result_unif result +checknbshapes result_unif -face 15 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YB6 b/tests/offset/shape_type_i_c/YB6 new file mode 100644 index 0000000000..53e4db380e --- /dev/null +++ b/tests/offset/shape_type_i_c/YB6 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 2.5 + } +} +offsetperform result + +checkprops result -v 716.909 -s 682.741 + +unifysamedom result_unif result +checknbshapes result_unif -face 15 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YB7 b/tests/offset/shape_type_i_c/YB7 new file mode 100644 index 0000000000..4bdc4053fd --- /dev/null +++ b/tests/offset/shape_type_i_c/YB7 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 3.5 + } +} +offsetperform result + +checkprops result -v 901.771 -s 692.252 + +unifysamedom result_unif result +checknbshapes result_unif -face 14 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YB8 b/tests/offset/shape_type_i_c/YB8 new file mode 100644 index 0000000000..7210a85532 --- /dev/null +++ b/tests/offset/shape_type_i_c/YB8 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 4 + } +} +offsetperform result + +checkprops result -v 1000 -s 700 + +unifysamedom result_unif result +checknbshapes result_unif -face 6 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YB9 b/tests/offset/shape_type_i_c/YB9 new file mode 100644 index 0000000000..918170611a --- /dev/null +++ b/tests/offset/shape_type_i_c/YB9 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 4.3 + } +} +offsetperform result + +checkprops result -v 1060 -s 718 + +unifysamedom result_unif result +checknbshapes result_unif -face 6 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YC1 b/tests/offset/shape_type_i_c/YC1 new file mode 100644 index 0000000000..5eea3a1149 --- /dev/null +++ b/tests/offset/shape_type_i_c/YC1 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple1.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 1.4 + } +} +offsetperform result + +checkprops result -v 541.772 -s 665.099 + +unifysamedom result_unif result +checknbshapes result_unif -face 17 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YC2 b/tests/offset/shape_type_i_c/YC2 new file mode 100644 index 0000000000..dad83cc0a3 --- /dev/null +++ b/tests/offset/shape_type_i_c/YC2 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple1.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 1.8 + } +} +offsetperform result + +checkprops result -v 604.464 -s 682.853 + +unifysamedom result_unif result +checknbshapes result_unif -face 17 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YC3 b/tests/offset/shape_type_i_c/YC3 new file mode 100644 index 0000000000..5a470c6716 --- /dev/null +++ b/tests/offset/shape_type_i_c/YC3 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple1.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 2 + } +} +offsetperform result + +checkprops result -v 636.296 -s 691.505 + +unifysamedom result_unif result +checknbshapes result_unif -face 15 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YC4 b/tests/offset/shape_type_i_c/YC4 new file mode 100644 index 0000000000..ef7f6b636f --- /dev/null +++ b/tests/offset/shape_type_i_c/YC4 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple1.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 3.5 + } +} +offsetperform result + +checkprops result -v 901.771 -s 692.252 + +unifysamedom result_unif result +checknbshapes result_unif -face 14 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YC5 b/tests/offset/shape_type_i_c/YC5 new file mode 100644 index 0000000000..58269a1c25 --- /dev/null +++ b/tests/offset/shape_type_i_c/YC5 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple1.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 4 + } +} +offsetperform result + +checkprops result -v 1000 -s 700 + +unifysamedom result_unif result +checknbshapes result_unif -face 6 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YC6 b/tests/offset/shape_type_i_c/YC6 new file mode 100644 index 0000000000..c89776885f --- /dev/null +++ b/tests/offset/shape_type_i_c/YC6 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple1.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 4.5 + } +} +offsetperform result + +checkprops result -v 1100 -s 730 + +unifysamedom result_unif result +checknbshapes result_unif -face 6 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YC7 b/tests/offset/shape_type_i_c/YC7 new file mode 100644 index 0000000000..96c18f7041 --- /dev/null +++ b/tests/offset/shape_type_i_c/YC7 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple2.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 1.1 + } +} +offsetperform result + +checkprops result -v 576.314 -s 626.227 + +unifysamedom result_unif result +checknbshapes result_unif -face 17 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YC8 b/tests/offset/shape_type_i_c/YC8 new file mode 100644 index 0000000000..5323575971 --- /dev/null +++ b/tests/offset/shape_type_i_c/YC8 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple2.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 1.8 + } +} +offsetperform result + +checkprops result -v 682.107 -s 668.86 + +unifysamedom result_unif result +checknbshapes result_unif -face 17 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YC9 b/tests/offset/shape_type_i_c/YC9 new file mode 100644 index 0000000000..fe98a92adb --- /dev/null +++ b/tests/offset/shape_type_i_c/YC9 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple2.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 2.3 + } +} +offsetperform result + +checkprops result -v 757.26 -s 696.397 + +unifysamedom result_unif result +checknbshapes result_unif -face 19 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YD1 b/tests/offset/shape_type_i_c/YD1 new file mode 100644 index 0000000000..8592b9f065 --- /dev/null +++ b/tests/offset/shape_type_i_c/YD1 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple2.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 3.2 + } +} +offsetperform result + +checkprops result -v 895.772 -s 734.031 + +unifysamedom result_unif result +checknbshapes result_unif -face 20 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YD2 b/tests/offset/shape_type_i_c/YD2 new file mode 100644 index 0000000000..210d93afcc --- /dev/null +++ b/tests/offset/shape_type_i_c/YD2 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple2.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 4.2 + } +} +offsetperform result + +checkprops result -v 1061.61 -s 762.644 + +unifysamedom result_unif result +checknbshapes result_unif -face 22 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YD3 b/tests/offset/shape_type_i_c/YD3 new file mode 100644 index 0000000000..aab7d8263c --- /dev/null +++ b/tests/offset/shape_type_i_c/YD3 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple2.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 4.7 + } +} +offsetperform result + +checkprops result -v 1150.96 -s 775.193 + +unifysamedom result_unif result +checknbshapes result_unif -face 18 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YD4 b/tests/offset/shape_type_i_c/YD4 new file mode 100644 index 0000000000..fc3b1ff8f7 --- /dev/null +++ b/tests/offset/shape_type_i_c/YD4 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple2.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 5.2 + } +} +offsetperform result + +checkprops result -v 1244.51 -s 790.347 + +unifysamedom result_unif result +checknbshapes result_unif -face 18 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YD5 b/tests/offset/shape_type_i_c/YD5 new file mode 100644 index 0000000000..a5eeb6e070 --- /dev/null +++ b/tests/offset/shape_type_i_c/YD5 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple3.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 0.2 + } +} +offsetperform result + +checkprops result -v 437.086 -s 567.751 + +unifysamedom result_unif result +checknbshapes result_unif -face 16 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YD6 b/tests/offset/shape_type_i_c/YD6 new file mode 100644 index 0000000000..97e26386ea --- /dev/null +++ b/tests/offset/shape_type_i_c/YD6 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple3.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 1.5 + } +} +offsetperform result + +checkprops result -v 638.971 -s 643.477 + +unifysamedom result_unif result +checknbshapes result_unif -face 18 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YD7 b/tests/offset/shape_type_i_c/YD7 new file mode 100644 index 0000000000..f376ca16d9 --- /dev/null +++ b/tests/offset/shape_type_i_c/YD7 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple3.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 2.5 + } +} +offsetperform result + +checkprops result -v 796.631 -s 688.189 + +unifysamedom result_unif result +checknbshapes result_unif -face 18 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YD8 b/tests/offset/shape_type_i_c/YD8 new file mode 100644 index 0000000000..137b0cdbb6 --- /dev/null +++ b/tests/offset/shape_type_i_c/YD8 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple3.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 3.6 + } +} +offsetperform result + +checkprops result -v 980.046 -s 732.882 + +unifysamedom result_unif result +checknbshapes result_unif -face 18 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YD9 b/tests/offset/shape_type_i_c/YD9 new file mode 100644 index 0000000000..156c1c01e2 --- /dev/null +++ b/tests/offset/shape_type_i_c/YD9 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple3.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 4.2 + } +} +offsetperform result + +checkprops result -v 1084.24 -s 760.754 + +unifysamedom result_unif result +checknbshapes result_unif -face 19 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YE1 b/tests/offset/shape_type_i_c/YE1 new file mode 100644 index 0000000000..ff32f12c65 --- /dev/null +++ b/tests/offset/shape_type_i_c/YE1 @@ -0,0 +1,33 @@ +puts "TODO OCC27414 ALL: Error: The command cannot be built" +puts "TODO OCC27414 ALL: Tcl Exception" +puts "TODO OCC27414 ALL: TEST INCOMPLETE" + + +restore [locate_data_file bug28442_simple3.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 5 + } +} +offsetperform result + +checkprops result -v 1226.52 -s 799.334 + +unifysamedom result_unif result +checknbshapes result_unif -face 13 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YE2 b/tests/offset/shape_type_i_c/YE2 new file mode 100644 index 0000000000..60bc252cae --- /dev/null +++ b/tests/offset/shape_type_i_c/YE2 @@ -0,0 +1,33 @@ +puts "TODO OCC27414 ALL: Error: The command cannot be built" +puts "TODO OCC27414 ALL: Tcl Exception" +puts "TODO OCC27414 ALL: TEST INCOMPLETE" + + +restore [locate_data_file bug28442_simple3.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 6 + } +} +offsetperform result + +checkprops result -v 0 -s 0 + +unifysamedom result_unif result +checknbshapes result_unif -face 13 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YE3 b/tests/offset/shape_type_i_c/YE3 new file mode 100644 index 0000000000..2068e409cd --- /dev/null +++ b/tests/offset/shape_type_i_c/YE3 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple4.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 0.8 + } +} +offsetperform result + +checkprops result -v 508.318 -s 619.149 + +unifysamedom result_unif result +checknbshapes result_unif -face 21 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YE4 b/tests/offset/shape_type_i_c/YE4 new file mode 100644 index 0000000000..a822e9573c --- /dev/null +++ b/tests/offset/shape_type_i_c/YE4 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple4.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 1.4 + } +} +offsetperform result + +checkprops result -v 593.919 -s 655.117 + +unifysamedom result_unif result +checknbshapes result_unif -face 21 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YE5 b/tests/offset/shape_type_i_c/YE5 new file mode 100644 index 0000000000..cd729b2199 --- /dev/null +++ b/tests/offset/shape_type_i_c/YE5 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple4.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 1.7 + } +} +offsetperform result + +checkprops result -v 636.586 -s 669.86 + +unifysamedom result_unif result +checknbshapes result_unif -face 20 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YE6 b/tests/offset/shape_type_i_c/YE6 new file mode 100644 index 0000000000..b4563302fb --- /dev/null +++ b/tests/offset/shape_type_i_c/YE6 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple4.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 2.7 + } +} +offsetperform result + +checkprops result -v 783.404 -s 711.46 + +unifysamedom result_unif result +checknbshapes result_unif -face 17 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YE7 b/tests/offset/shape_type_i_c/YE7 new file mode 100644 index 0000000000..1318ea6fa6 --- /dev/null +++ b/tests/offset/shape_type_i_c/YE7 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple4.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 3.5 + } +} +offsetperform result + +checkprops result -v 914.348 -s 717.153 + +unifysamedom result_unif result +checknbshapes result_unif -face 14 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YE8 b/tests/offset/shape_type_i_c/YE8 new file mode 100644 index 0000000000..00a4ce5cca --- /dev/null +++ b/tests/offset/shape_type_i_c/YE8 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple4.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 4.5 + } +} +offsetperform result + +checkprops result -v 1100.29 -s 736.424 + +unifysamedom result_unif result +checknbshapes result_unif -face 14 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YE9 b/tests/offset/shape_type_i_c/YE9 new file mode 100644 index 0000000000..a99ee9d93d --- /dev/null +++ b/tests/offset/shape_type_i_c/YE9 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple5.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 0.9 + } +} +offsetperform result + +checkprops result -v 522.676 -s 625.27 + +unifysamedom result_unif result +checknbshapes result_unif -face 21 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YF1 b/tests/offset/shape_type_i_c/YF1 new file mode 100644 index 0000000000..63ec862123 --- /dev/null +++ b/tests/offset/shape_type_i_c/YF1 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple5.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 1.2 + } +} +offsetperform result + +checkprops result -v 565.605 -s 642.455 + +unifysamedom result_unif result +checknbshapes result_unif -face 19 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YF2 b/tests/offset/shape_type_i_c/YF2 new file mode 100644 index 0000000000..d7316c638b --- /dev/null +++ b/tests/offset/shape_type_i_c/YF2 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple5.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 2 + } +} +offsetperform result + +checkprops result -v 680.704 -s 684.886 + +unifysamedom result_unif result +checknbshapes result_unif -face 20 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YF3 b/tests/offset/shape_type_i_c/YF3 new file mode 100644 index 0000000000..1b7f9ea836 --- /dev/null +++ b/tests/offset/shape_type_i_c/YF3 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple5.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 2.7 + } +} +offsetperform result + +checkprops result -v 784.337 -s 712.928 + +unifysamedom result_unif result +checknbshapes result_unif -face 17 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YF4 b/tests/offset/shape_type_i_c/YF4 new file mode 100644 index 0000000000..bde37788d3 --- /dev/null +++ b/tests/offset/shape_type_i_c/YF4 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple5.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 3 + } +} +offsetperform result + +checkprops result -v 831.255 -s 714.751 + +unifysamedom result_unif result +checknbshapes result_unif -face 14 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YF5 b/tests/offset/shape_type_i_c/YF5 new file mode 100644 index 0000000000..73d428aaaf --- /dev/null +++ b/tests/offset/shape_type_i_c/YF5 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple5.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 3.5 + } +} +offsetperform result + +checkprops result -v 914.786 -s 720.359 + +unifysamedom result_unif result +checknbshapes result_unif -face 14 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YF6 b/tests/offset/shape_type_i_c/YF6 new file mode 100644 index 0000000000..ae32f23e59 --- /dev/null +++ b/tests/offset/shape_type_i_c/YF6 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple5.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 4.7 + } +} +offsetperform result + +checkprops result -v 1140 -s 742 + +unifysamedom result_unif result +checknbshapes result_unif -face 6 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YF7 b/tests/offset/shape_type_i_c/YF7 new file mode 100644 index 0000000000..db0422d2b0 --- /dev/null +++ b/tests/offset/shape_type_i_c/YF7 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple6.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 1 + } +} +offsetperform result + +checkprops result -v 560.833 -s 623.318 + +unifysamedom result_unif result +checknbshapes result_unif -face 21 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YF8 b/tests/offset/shape_type_i_c/YF8 new file mode 100644 index 0000000000..df9f1ea795 --- /dev/null +++ b/tests/offset/shape_type_i_c/YF8 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple6.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 1.5 + } +} +offsetperform result + +checkprops result -v 635.5 -s 653.92 + +unifysamedom result_unif result +checknbshapes result_unif -face 19 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YF9 b/tests/offset/shape_type_i_c/YF9 new file mode 100644 index 0000000000..d2aed4f397 --- /dev/null +++ b/tests/offset/shape_type_i_c/YF9 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple6.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 3 + } +} +offsetperform result + +checkprops result -v 858.491 -s 730.878 + +unifysamedom result_unif result +checknbshapes result_unif -face 17 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YG1 b/tests/offset/shape_type_i_c/YG1 new file mode 100644 index 0000000000..fc088e61fa --- /dev/null +++ b/tests/offset/shape_type_i_c/YG1 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple6.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 3.5 + } +} +offsetperform result + +checkprops result -v 937.546 -s 742.895 + +unifysamedom result_unif result +checknbshapes result_unif -face 16 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YG2 b/tests/offset/shape_type_i_c/YG2 new file mode 100644 index 0000000000..26952d20f2 --- /dev/null +++ b/tests/offset/shape_type_i_c/YG2 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple7.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 0.9 + } +} +offsetperform result + +checkprops result -v 532.498 -s 625.58 + +unifysamedom result_unif result +checknbshapes result_unif -face 21 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YG3 b/tests/offset/shape_type_i_c/YG3 new file mode 100644 index 0000000000..f03f706e60 --- /dev/null +++ b/tests/offset/shape_type_i_c/YG3 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple7.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 1.3 + } +} +offsetperform result + +checkprops result -v 591.624 -s 647.796 + +unifysamedom result_unif result +checknbshapes result_unif -face 21 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YG4 b/tests/offset/shape_type_i_c/YG4 new file mode 100644 index 0000000000..abf8431630 --- /dev/null +++ b/tests/offset/shape_type_i_c/YG4 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple7.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 1.7 + } +} +offsetperform result + +checkprops result -v 650.813 -s 669.163 + +unifysamedom result_unif result +checknbshapes result_unif -face 22 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YG5 b/tests/offset/shape_type_i_c/YG5 new file mode 100644 index 0000000000..091b40ad4e --- /dev/null +++ b/tests/offset/shape_type_i_c/YG5 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple7.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 3 + } +} +offsetperform result + +checkprops result -v 849.197 -s 722.694 + +unifysamedom result_unif result +checknbshapes result_unif -face 20 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YG6 b/tests/offset/shape_type_i_c/YG6 new file mode 100644 index 0000000000..14d11ef523 --- /dev/null +++ b/tests/offset/shape_type_i_c/YG6 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple7.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 4 + } +} +offsetperform result + +checkprops result -v 1016.84 -s 750.316 + +unifysamedom result_unif result +checknbshapes result_unif -face 18 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YG7 b/tests/offset/shape_type_i_c/YG7 new file mode 100644 index 0000000000..14a5152783 --- /dev/null +++ b/tests/offset/shape_type_i_c/YG7 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple8.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 3.5 + } +} +offsetperform result + +checkprops result -v 1446.71 -s 1074.67 + +unifysamedom result_unif result +checknbshapes result_unif -face 25 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YG8 b/tests/offset/shape_type_i_c/YG8 new file mode 100644 index 0000000000..5342e034b0 --- /dev/null +++ b/tests/offset/shape_type_i_c/YG8 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple8.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 5 + } +} +offsetperform result + +checkprops result -v 1837.67 -s 1118.82 + +unifysamedom result_unif result +checknbshapes result_unif -face 24 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YG9 b/tests/offset/shape_type_i_c/YG9 new file mode 100644 index 0000000000..dc7484dc7f --- /dev/null +++ b/tests/offset/shape_type_i_c/YG9 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple8.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 5.5 + } +} +offsetperform result + +checkprops result -v 1973.21 -s 1128.39 + +unifysamedom result_unif result +checknbshapes result_unif -face 24 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YH1 b/tests/offset/shape_type_i_c/YH1 new file mode 100644 index 0000000000..567091b707 --- /dev/null +++ b/tests/offset/shape_type_i_c/YH1 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple8.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 6.2 + } +} +offsetperform result + +checkprops result -v 2169.52 -s 1151.22 + +unifysamedom result_unif result +checknbshapes result_unif -face 22 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YH2 b/tests/offset/shape_type_i_c/YH2 new file mode 100644 index 0000000000..4d17d18744 --- /dev/null +++ b/tests/offset/shape_type_i_c/YH2 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple8.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 7.3 + } +} +offsetperform result + +checkprops result -v 2490.91 -s 1189.42 + +unifysamedom result_unif result +checknbshapes result_unif -face 14 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YH3 b/tests/offset/shape_type_i_c/YH3 new file mode 100644 index 0000000000..2e0593466c --- /dev/null +++ b/tests/offset/shape_type_i_c/YH3 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple8.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 8 + } +} +offsetperform result + +checkprops result -v 2700 -s 1230 + +unifysamedom result_unif result +checknbshapes result_unif -face 6 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YH4 b/tests/offset/shape_type_i_c/YH4 new file mode 100644 index 0000000000..b4f7405b8f --- /dev/null +++ b/tests/offset/shape_type_i_c/YH4 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple9.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 2.3 + } +} +offsetperform result + +checkprops result -v 1173.38 -s 1002.15 + +unifysamedom result_unif result +checknbshapes result_unif -face 22 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YH5 b/tests/offset/shape_type_i_c/YH5 new file mode 100644 index 0000000000..22811bbd3d --- /dev/null +++ b/tests/offset/shape_type_i_c/YH5 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple9.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 4 + } +} +offsetperform result + +checkprops result -v 1596 -s 1099.91 + +unifysamedom result_unif result +checknbshapes result_unif -face 16 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YH6 b/tests/offset/shape_type_i_c/YH6 new file mode 100644 index 0000000000..acfdb2e302 --- /dev/null +++ b/tests/offset/shape_type_i_c/YH6 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple9.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 5.5 + } +} +offsetperform result + +checkprops result -v 1977 -s 1167.43 + +unifysamedom result_unif result +checknbshapes result_unif -face 15 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YH7 b/tests/offset/shape_type_i_c/YH7 new file mode 100644 index 0000000000..49ba48a8a9 --- /dev/null +++ b/tests/offset/shape_type_i_c/YH7 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple9.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 7 + } +} +offsetperform result + +checkprops result -v 2400 -s 1160 + +unifysamedom result_unif result +checknbshapes result_unif -face 6 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YH8 b/tests/offset/shape_type_i_c/YH8 new file mode 100644 index 0000000000..648f51c0ba --- /dev/null +++ b/tests/offset/shape_type_i_c/YH8 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple9.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 7.5 + } +} +offsetperform result + +checkprops result -v 2550 -s 1195 + +unifysamedom result_unif result +checknbshapes result_unif -face 6 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YH9 b/tests/offset/shape_type_i_c/YH9 new file mode 100644 index 0000000000..29d1a6cd06 --- /dev/null +++ b/tests/offset/shape_type_i_c/YH9 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple10.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 2.3 + } +} +offsetperform result + +checkprops result -v 1173.38 -s 1002.15 + +unifysamedom result_unif result +checknbshapes result_unif -face 22 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YI1 b/tests/offset/shape_type_i_c/YI1 new file mode 100644 index 0000000000..94053dc44c --- /dev/null +++ b/tests/offset/shape_type_i_c/YI1 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple10.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 3.3 + } +} +offsetperform result + +checkprops result -v 1420.77 -s 1055.6 + +unifysamedom result_unif result +checknbshapes result_unif -face 22 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YI2 b/tests/offset/shape_type_i_c/YI2 new file mode 100644 index 0000000000..d874bb67bd --- /dev/null +++ b/tests/offset/shape_type_i_c/YI2 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple10.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 4.2 + } +} +offsetperform result + +checkprops result -v 1649.74 -s 1092.64 + +unifysamedom result_unif result +checknbshapes result_unif -face 16 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YI3 b/tests/offset/shape_type_i_c/YI3 new file mode 100644 index 0000000000..6edb55c005 --- /dev/null +++ b/tests/offset/shape_type_i_c/YI3 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple10.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 5.2 + } +} +offsetperform result + +checkprops result -v 1914.35 -s 1128.32 + +unifysamedom result_unif result +checknbshapes result_unif -face 15 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YI4 b/tests/offset/shape_type_i_c/YI4 new file mode 100644 index 0000000000..35c263b0b6 --- /dev/null +++ b/tests/offset/shape_type_i_c/YI4 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple10.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 6.5 + } +} +offsetperform result + +checkprops result -v 2271.64 -s 1187.85 + +unifysamedom result_unif result +checknbshapes result_unif -face 13 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YI5 b/tests/offset/shape_type_i_c/YI5 new file mode 100644 index 0000000000..2e804d33c0 --- /dev/null +++ b/tests/offset/shape_type_i_c/YI5 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple10.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 7.5 + } +} +offsetperform result + +checkprops result -v 2555.91 -s 1227.21 + +unifysamedom result_unif result +checknbshapes result_unif -face 12 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YI6 b/tests/offset/shape_type_i_c/YI6 new file mode 100644 index 0000000000..c525922a5e --- /dev/null +++ b/tests/offset/shape_type_i_c/YI6 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple10.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 9.3 + } +} +offsetperform result + +checkprops result -v 3090 -s 1321 + +unifysamedom result_unif result +checknbshapes result_unif -face 6 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YI7 b/tests/offset/shape_type_i_c/YI7 new file mode 100644 index 0000000000..291222d864 --- /dev/null +++ b/tests/offset/shape_type_i_c/YI7 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple11.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 2.5 + } +} +offsetperform result + +checkprops result -v 1196.69 -s 1020.67 + +unifysamedom result_unif result +checknbshapes result_unif -face 24 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YI8 b/tests/offset/shape_type_i_c/YI8 new file mode 100644 index 0000000000..a78be629a4 --- /dev/null +++ b/tests/offset/shape_type_i_c/YI8 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple11.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 3.5 + } +} +offsetperform result + +checkprops result -v 1442.83 -s 1065.3 + +unifysamedom result_unif result +checknbshapes result_unif -face 25 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YI9 b/tests/offset/shape_type_i_c/YI9 new file mode 100644 index 0000000000..30c9697ddf --- /dev/null +++ b/tests/offset/shape_type_i_c/YI9 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple11.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 4.2 + } +} +offsetperform result + +checkprops result -v 1622.85 -s 1081.68 + +unifysamedom result_unif result +checknbshapes result_unif -face 23 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YJ1 b/tests/offset/shape_type_i_c/YJ1 new file mode 100644 index 0000000000..e68f8970ab --- /dev/null +++ b/tests/offset/shape_type_i_c/YJ1 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple11.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 5 + } +} +offsetperform result + +checkprops result -v 1837.33 -s 1101.2 + +unifysamedom result_unif result +checknbshapes result_unif -face 22 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YJ2 b/tests/offset/shape_type_i_c/YJ2 new file mode 100644 index 0000000000..88b11281ea --- /dev/null +++ b/tests/offset/shape_type_i_c/YJ2 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple11.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 5.5 + } +} +offsetperform result + +checkprops result -v 1976.05 -s 1125.25 + +unifysamedom result_unif result +checknbshapes result_unif -face 22 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YJ3 b/tests/offset/shape_type_i_c/YJ3 new file mode 100644 index 0000000000..f6b0fefed7 --- /dev/null +++ b/tests/offset/shape_type_i_c/YJ3 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple11.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 6.2 + } +} +offsetperform result + +checkprops result -v 2172.83 -s 1149.47 + +unifysamedom result_unif result +checknbshapes result_unif -face 21 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YJ4 b/tests/offset/shape_type_i_c/YJ4 new file mode 100644 index 0000000000..324f2ab1f0 --- /dev/null +++ b/tests/offset/shape_type_i_c/YJ4 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple11.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 7.3 + } +} +offsetperform result + +checkprops result -v 2493.03 -s 1195.43 + +unifysamedom result_unif result +checknbshapes result_unif -face 14 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YJ5 b/tests/offset/shape_type_i_c/YJ5 new file mode 100644 index 0000000000..f246c43c87 --- /dev/null +++ b/tests/offset/shape_type_i_c/YJ5 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple11.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 8 + } +} +offsetperform result + +checkprops result -v 2700.83 -s 1235.47 + +unifysamedom result_unif result +checknbshapes result_unif -face 10 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YJ6 b/tests/offset/shape_type_i_c/YJ6 new file mode 100644 index 0000000000..ede25609dc --- /dev/null +++ b/tests/offset/shape_type_i_c/YJ6 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple11.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 9.2 + } +} +offsetperform result + +checkprops result -v 3060 -s 1314 + +unifysamedom result_unif result +checknbshapes result_unif -face 6 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YJ7 b/tests/offset/shape_type_i_c/YJ7 new file mode 100644 index 0000000000..fa731ee384 --- /dev/null +++ b/tests/offset/shape_type_i_c/YJ7 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple12.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 2.5 + } +} +offsetperform result + +checkprops result -v 1163.57 -s 1020.66 + +unifysamedom result_unif result +checknbshapes result_unif -face 20 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YJ8 b/tests/offset/shape_type_i_c/YJ8 new file mode 100644 index 0000000000..c40529c5b1 --- /dev/null +++ b/tests/offset/shape_type_i_c/YJ8 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple12.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 3.2 + } +} +offsetperform result + +checkprops result -v 1327.75 -s 1049.86 + +unifysamedom result_unif result +checknbshapes result_unif -face 20 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YJ9 b/tests/offset/shape_type_i_c/YJ9 new file mode 100644 index 0000000000..0f53584e48 --- /dev/null +++ b/tests/offset/shape_type_i_c/YJ9 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple12.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 4.4 + } +} +offsetperform result + +checkprops result -v 1640.18 -s 1049.39 + +unifysamedom result_unif result +checknbshapes result_unif -face 16 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YK1 b/tests/offset/shape_type_i_c/YK1 new file mode 100644 index 0000000000..9ac061d398 --- /dev/null +++ b/tests/offset/shape_type_i_c/YK1 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple12.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 5 + } +} +offsetperform result + +checkprops result -v 1810.17 -s 1052.79 + +unifysamedom result_unif result +checknbshapes result_unif -face 10 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YK2 b/tests/offset/shape_type_i_c/YK2 new file mode 100644 index 0000000000..f9ef4c7c08 --- /dev/null +++ b/tests/offset/shape_type_i_c/YK2 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple12.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 6 + } +} +offsetperform result + +checkprops result -v 2102.46 -s 1105.62 + +unifysamedom result_unif result +checknbshapes result_unif -face 10 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YK3 b/tests/offset/shape_type_i_c/YK3 new file mode 100644 index 0000000000..5e98d1b9d5 --- /dev/null +++ b/tests/offset/shape_type_i_c/YK3 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple13.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 3.1 + } +} +offsetperform result + +checkprops result -v 1316.75 -s 1063.5 + +unifysamedom result_unif result +checknbshapes result_unif -face 21 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YK4 b/tests/offset/shape_type_i_c/YK4 new file mode 100644 index 0000000000..cf876780ac --- /dev/null +++ b/tests/offset/shape_type_i_c/YK4 @@ -0,0 +1,28 @@ +restore [locate_data_file bug28442_simple13.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found == 0} { + continue + } + # reverse normal direction for faces with orientation REVERSED + if {[regexp {REVERSED} [whatis $f]]} { + set z [expr -1*$z] + } + # set offset value for top faces only + if {abs($z - 1) < 1.e-7 } { + offsetonface $f 5 + } +} +offsetperform result + +checkprops result -v 1811.61 -s 1059.5 + +unifysamedom result_unif result +checknbshapes result_unif -face 14 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png