mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b989082fe1 | ||
|
86e352849d | ||
|
6d140acb14 | ||
|
44be123039 |
@@ -127,6 +127,14 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
|
||||
for (ex.Init(S,TopAbs_EDGE,TopAbs_FACE); ex.More(); ex.Next())
|
||||
{
|
||||
const TopoDS_Edge& E = TopoDS::Edge(ex.Current());
|
||||
|
||||
if (!useTriangulation && BRep_Tool::IsGeometric(E))
|
||||
{
|
||||
BC.Initialize(E);
|
||||
BndLib_Add3dCurve::Add(BC, BRep_Tool::Tolerance(E), B);
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(Poly_Polygon3D) P3d = BRep_Tool::Polygon3D(E, l);
|
||||
if (!P3d.IsNull() && P3d->NbNodes() > 0)
|
||||
{
|
||||
@@ -143,7 +151,7 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
|
||||
else
|
||||
{
|
||||
BRep_Tool::PolygonOnTriangulation(E, Poly, T, l);
|
||||
if (useTriangulation && !Poly.IsNull() && !T.IsNull() && T->NbNodes() > 0)
|
||||
if (!Poly.IsNull() && !T.IsNull() && T->NbNodes() > 0)
|
||||
{
|
||||
const TColStd_Array1OfInteger& Indices = Poly->Nodes();
|
||||
nbNodes = Indices.Length();
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <ChFi3d.hxx>
|
||||
#include <LocalAnalysis_SurfaceContinuity.hxx>
|
||||
|
||||
static void CorrectOrientationOfTangent(gp_Vec& TangVec,
|
||||
const TopoDS_Vertex& aVertex,
|
||||
@@ -50,6 +51,12 @@ static void CorrectOrientationOfTangent(gp_Vec& TangVec,
|
||||
if (aVertex.IsSame(Vlast))
|
||||
TangVec.Reverse();
|
||||
}
|
||||
|
||||
static Standard_Boolean CheckMixedContinuity (const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const Standard_Real theAngTol);
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepOffset_Analyse
|
||||
//purpose :
|
||||
@@ -105,15 +112,168 @@ static void EdgeAnalyse(const TopoDS_Edge& E,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ChFi3d::IsTangentFaces(E, F1, F2)) //weak condition
|
||||
ConnectType = ChFiDS_Tangential;
|
||||
Standard_Boolean isTwoSplines = (aSurfType1 == GeomAbs_BSplineSurface || aSurfType1 == GeomAbs_BezierSurface) &&
|
||||
(aSurfType2 == GeomAbs_BSplineSurface || aSurfType2 == GeomAbs_BezierSurface);
|
||||
Standard_Boolean isMixedConcavity = Standard_False;
|
||||
if (isTwoSplines)
|
||||
{
|
||||
Standard_Real anAngTol = 0.1;
|
||||
isMixedConcavity = CheckMixedContinuity(E, F1, F2, anAngTol);
|
||||
}
|
||||
|
||||
if (!isMixedConcavity)
|
||||
{
|
||||
if (ChFi3d::IsTangentFaces(E, F1, F2)) //weak condition
|
||||
{
|
||||
ConnectType = ChFiDS_Tangential;
|
||||
}
|
||||
else
|
||||
{
|
||||
ConnectType = ChFi3d::DefineConnectType(E, F1, F2, SinTol, Standard_False);
|
||||
}
|
||||
}
|
||||
else
|
||||
ConnectType = ChFi3d::DefineConnectType(E, F1, F2, SinTol, Standard_False);
|
||||
{
|
||||
ConnectType = ChFiDS_Mixed;
|
||||
}
|
||||
}
|
||||
|
||||
I.Type(ConnectType);
|
||||
LI.Append(I);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : CheckMixedConcavity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean CheckMixedContinuity (const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const Standard_Real theAngTol)
|
||||
{
|
||||
Standard_Boolean aMixedCont = Standard_False;
|
||||
GeomAbs_Shape aCurrOrder = BRep_Tool::Continuity(theEdge, theFace1, theFace2);
|
||||
if (aCurrOrder > GeomAbs_C0)
|
||||
{
|
||||
//Method BRep_Tool::Continuity(...) always returns minimal continuity between faces
|
||||
//so, if aCurrOrder > C0 it means that faces are tangent along whole edge.
|
||||
return aMixedCont;
|
||||
}
|
||||
//But we caqnnot trust result, if it is C0. because this value set by default.
|
||||
Standard_Real TolC0 = Max(0.001, 1.5*BRep_Tool::Tolerance(theEdge));
|
||||
|
||||
Standard_Real aFirst;
|
||||
Standard_Real aLast;
|
||||
|
||||
Handle(Geom2d_Curve) aC2d1, aC2d2;
|
||||
|
||||
if (!theFace1.IsSame(theFace2) &&
|
||||
BRep_Tool::IsClosed(theEdge, theFace1) &&
|
||||
BRep_Tool::IsClosed(theEdge, theFace2))
|
||||
{
|
||||
//Find the edge in the face 1: this edge will have correct orientation
|
||||
TopoDS_Edge anEdgeInFace1;
|
||||
TopoDS_Face aFace1 = theFace1;
|
||||
aFace1.Orientation(TopAbs_FORWARD);
|
||||
TopExp_Explorer anExplo(aFace1, TopAbs_EDGE);
|
||||
for (; anExplo.More(); anExplo.Next())
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge(anExplo.Current());
|
||||
if (anEdge.IsSame(theEdge))
|
||||
{
|
||||
anEdgeInFace1 = anEdge;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (anEdgeInFace1.IsNull())
|
||||
{
|
||||
return aMixedCont;
|
||||
}
|
||||
|
||||
aC2d1 = BRep_Tool::CurveOnSurface(anEdgeInFace1, aFace1, aFirst, aLast);
|
||||
TopoDS_Face aFace2 = theFace2;
|
||||
aFace2.Orientation(TopAbs_FORWARD);
|
||||
anEdgeInFace1.Reverse();
|
||||
aC2d2 = BRep_Tool::CurveOnSurface(anEdgeInFace1, aFace2, aFirst, aLast);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Obtaining of pcurves of edge on two faces.
|
||||
aC2d1 = BRep_Tool::CurveOnSurface(theEdge, theFace1, aFirst, aLast);
|
||||
//For the case of seam edge
|
||||
TopoDS_Edge EE = theEdge;
|
||||
if (theFace1.IsSame(theFace2))
|
||||
{
|
||||
EE.Reverse();
|
||||
}
|
||||
aC2d2 = BRep_Tool::CurveOnSurface(EE, theFace2, aFirst, aLast);
|
||||
}
|
||||
|
||||
if (aC2d1.IsNull() || aC2d2.IsNull())
|
||||
{
|
||||
return aMixedCont;
|
||||
}
|
||||
|
||||
// Obtaining of two surfaces from adjacent faces.
|
||||
Handle(Geom_Surface) aSurf1 = BRep_Tool::Surface(theFace1);
|
||||
Handle(Geom_Surface) aSurf2 = BRep_Tool::Surface(theFace2);
|
||||
|
||||
if (aSurf1.IsNull() || aSurf2.IsNull())
|
||||
{
|
||||
return aMixedCont;
|
||||
}
|
||||
|
||||
Standard_Integer aNbSamples = 23;
|
||||
|
||||
// Computation of the continuity.
|
||||
Standard_Real aPar;
|
||||
Standard_Real aDelta = (aLast - aFirst) / (aNbSamples - 1);
|
||||
Standard_Integer i, istart = 1;
|
||||
Standard_Boolean isG1 = Standard_False;
|
||||
|
||||
for (i = 1, aPar = aFirst; i <= aNbSamples; i++, aPar += aDelta)
|
||||
{
|
||||
if (i == aNbSamples) aPar = aLast;
|
||||
|
||||
LocalAnalysis_SurfaceContinuity aCont(aC2d1, aC2d2, aPar,
|
||||
aSurf1, aSurf2, GeomAbs_G1, 0.001, TolC0, theAngTol, theAngTol, theAngTol);
|
||||
if (aCont.IsDone())
|
||||
{
|
||||
istart = i + 1;
|
||||
isG1 = aCont.IsG1();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (istart > aNbSamples / 2)
|
||||
{
|
||||
return aMixedCont;
|
||||
}
|
||||
|
||||
for (i = istart, aPar = aFirst; i <= aNbSamples; i++, aPar += aDelta)
|
||||
{
|
||||
if (i == aNbSamples) aPar = aLast;
|
||||
|
||||
LocalAnalysis_SurfaceContinuity aCont(aC2d1, aC2d2, aPar,
|
||||
aSurf1, aSurf2, GeomAbs_G1, 0.001, TolC0, theAngTol, theAngTol, theAngTol);
|
||||
if (!aCont.IsDone())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (aCont.IsG1() == isG1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
aMixedCont = Standard_True;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return aMixedCont;
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BuildAncestors
|
||||
|
@@ -29,7 +29,8 @@ enum BRepOffset_Error
|
||||
BRepOffset_CannotTrimEdges, //!< exception while trim edges
|
||||
BRepOffset_CannotFuseVertices, //!< exception while fuse vertices
|
||||
BRepOffset_CannotExtentEdge, //!< exception while extent edges
|
||||
BRepOffset_UserBreak //!< user break
|
||||
BRepOffset_UserBreak, //!< user break
|
||||
BRepOffset_MixedConnectivity //!< Different connectivity of faces along edge: partially C0 and tangent
|
||||
};
|
||||
|
||||
#endif // _BRepOffset_Error_HeaderFile
|
||||
|
@@ -910,6 +910,19 @@ void BRepOffset_MakeOffset::MakeOffsetShape(const Message_ProgressRange& theRang
|
||||
myAnalyse.SetFaceOffsetMap (myFaceOffset);
|
||||
}
|
||||
myAnalyse.Perform(myFaceComp,TolAngle, aPS.Next(aSteps(PIOperation_Analyse)));
|
||||
TopExp_Explorer anEExp(myFaceComp, TopAbs_EDGE);
|
||||
for (; anEExp.More(); anEExp.Next())
|
||||
{
|
||||
const TopoDS_Edge& anE = TopoDS::Edge(anEExp.Current());
|
||||
const BRepOffset_ListOfInterval& aLI = myAnalyse.Type(anE);
|
||||
if (aLI.IsEmpty())
|
||||
continue;
|
||||
if (aLI.Last().Type() == ChFiDS_Mixed)
|
||||
{
|
||||
myError = BRepOffset_MixedConnectivity;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!aPS.More())
|
||||
{
|
||||
myError = BRepOffset_UserBreak;
|
||||
@@ -2960,6 +2973,36 @@ void BRepOffset_MakeOffset::MakeMissingWalls (const Message_ProgressRange& theRa
|
||||
TopExp::Vertices(anEdge, V1, V2);
|
||||
Standard_Real aF, aL;
|
||||
const Handle(Geom_Curve) aC = BRep_Tool::Curve(anEdge, aF, aL);
|
||||
if (V3.IsNull() && V4.IsNull())
|
||||
{
|
||||
// Initially offset edge is created without vertices.
|
||||
// Then edge is trimmed by intersection line between
|
||||
// two adjacent extended offset faces and get vertices.
|
||||
// When intersection lines are invalid for any reason,
|
||||
// (one of reson is mixed connectivity of faces)
|
||||
// algoritm of cutting offset edge by intersection line
|
||||
// can fail and offset edge cannot get vertices.
|
||||
// Follwing workaround is only to avoid exeption if V3 and V4 are Null
|
||||
// Vertex points are invalid.
|
||||
Standard_Real anOEF, anOEL;
|
||||
TopAbs_Orientation anOEOri = OE.Orientation();
|
||||
OE.Orientation(TopAbs_FORWARD);
|
||||
Handle(Geom_Curve) anOEC = BRep_Tool::Curve(OE, anOEF, anOEL);
|
||||
BRep_Builder aBB;
|
||||
gp_Pnt aP1 = anOEC->Value(aF);
|
||||
gp_Pnt aP2 = anOEC->Value(aL);
|
||||
TopoDS_Vertex anOEV1, anOEV2;
|
||||
Standard_Real aTol = Max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2));
|
||||
aBB.MakeVertex(anOEV1, aP1, aTol);
|
||||
anOEV1.Orientation(TopAbs_FORWARD);
|
||||
aBB.MakeVertex(anOEV2, aP2, aTol);
|
||||
anOEV2.Orientation(TopAbs_REVERSED);
|
||||
aBB.Add(OE, anOEV1);
|
||||
aBB.Add(OE, anOEV2);
|
||||
aBB.Range(OE, aF, aL);
|
||||
OE.Orientation(anOEOri);
|
||||
TopExp::Vertices(OE, V4, V3);
|
||||
}
|
||||
if (!aC.IsNull() &&
|
||||
(!aC->IsClosed() && !aC->IsPeriodic()))
|
||||
{
|
||||
|
@@ -281,9 +281,11 @@ static Standard_Integer mkedge(Draw_Interpretor& di, Standard_Integer n, const c
|
||||
|
||||
Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[2]);
|
||||
Handle(Geom2d_Curve) C2d = DrawTrSurf::GetCurve2d(a[2]);
|
||||
if (C.IsNull() && C2d.IsNull()) {
|
||||
Handle(Poly_Polygon3D) P3d = DrawTrSurf::GetPolygon3D(a[2]);
|
||||
|
||||
if (C.IsNull() && C2d.IsNull() && P3d.IsNull()) {
|
||||
//std::cout << a[2] << " is not a curve" << std::endl;
|
||||
di << a[2] << " is not a curve\n";
|
||||
di << a[2] << " is not a curve or polygon 3d\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -291,7 +293,12 @@ static Standard_Integer mkedge(Draw_Interpretor& di, Standard_Integer n, const c
|
||||
|
||||
if (n == 3) {
|
||||
if (!C.IsNull()) edge = BRepBuilderAPI_MakeEdge(C);
|
||||
else edge = BRepBuilderAPI_MakeEdge2d(C2d);
|
||||
else if (!C2d.IsNull()) edge = BRepBuilderAPI_MakeEdge2d(C2d);
|
||||
else
|
||||
{
|
||||
BRep_Builder aBB;
|
||||
aBB.MakeEdge(edge, P3d);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Handle(Geom_Surface) S;
|
||||
|
@@ -415,6 +415,11 @@ static void reportOffsetState(Draw_Interpretor& theCommands,
|
||||
theCommands << "ERROR. Can not extent edge.";
|
||||
break;
|
||||
}
|
||||
case BRepOffset_MixedConnectivity:
|
||||
{
|
||||
theCommands << "ERROR. Mixed connectivity of faces.";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
theCommands << "ERROR. offsetperform operation not done.";
|
||||
@@ -974,7 +979,10 @@ Standard_Integer thickshell(Draw_Interpretor& theCommands,
|
||||
const BRepOffset_Error aRetCode = B.Error();
|
||||
reportOffsetState(theCommands, aRetCode);
|
||||
|
||||
DBRep::Set(a[1], B.Shape());
|
||||
if (!B.Shape().IsNull())
|
||||
{
|
||||
DBRep::Set(a[1], B.Shape());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1109,7 +1117,10 @@ Standard_Integer offsetshape(Draw_Interpretor& theCommands,
|
||||
const BRepOffset_Error aRetCode = B.Error();
|
||||
reportOffsetState(theCommands, aRetCode);
|
||||
|
||||
DBRep::Set(a[1], B.Shape());
|
||||
if (!B.Shape().IsNull())
|
||||
{
|
||||
DBRep::Set(a[1], B.Shape());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -692,7 +692,6 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
|
||||
else{
|
||||
sst = Spine->LastStatus();
|
||||
iedge = Spine->NbEdges();
|
||||
E[0] = Spine->Edges(iedge);
|
||||
V = Spine->LastVertex();
|
||||
}
|
||||
//Before all it is checked if the tangency is not dead.
|
||||
@@ -703,6 +702,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
|
||||
}
|
||||
|
||||
if(sst == ChFiDS_BreakPoint){
|
||||
Standard_Integer aLocNbG1Connections = 0;
|
||||
TopTools_ListIteratorOfListOfShape It;//,Jt;
|
||||
Standard_Boolean sommetpourri = Standard_False;
|
||||
TopTools_IndexedMapOfOrientedShape EdgesOfV;
|
||||
@@ -720,7 +720,10 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
|
||||
if (!F2.IsNull() && ChFi3d::IsTangentFaces(anEdge, F1, F2, GeomAbs_G2)) //smooth edge
|
||||
{
|
||||
if (!F1.IsSame(F2))
|
||||
{
|
||||
NbG1Connections++;
|
||||
aLocNbG1Connections++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -759,7 +762,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
|
||||
if (EdgesOfV.Extent() != 3)
|
||||
sommetpourri = Standard_True;
|
||||
|
||||
if(!sommetpourri){
|
||||
if(!sommetpourri && aLocNbG1Connections < 4){
|
||||
sst = ChFi3d_EdgeState(E,myEFMap);
|
||||
}
|
||||
if(ii==1)Spine->SetFirstStatus(sst);
|
||||
|
@@ -24,7 +24,8 @@ ChFiDS_Concave,
|
||||
ChFiDS_Convex,
|
||||
ChFiDS_Tangential,
|
||||
ChFiDS_FreeBound,
|
||||
ChFiDS_Other
|
||||
ChFiDS_Other,
|
||||
ChFiDS_Mixed
|
||||
};
|
||||
|
||||
#endif // _ChFiDS_TypeOfConcavity_HeaderFile
|
||||
|
@@ -150,7 +150,6 @@ static Standard_Boolean Connect (const Handle(ShapeAnalysis_Wire)& theSAW,
|
||||
const Standard_Integer number,
|
||||
Handle(ShapeExtend_WireData)& Gsewd)
|
||||
{
|
||||
(void)number;
|
||||
Gsewd = new ShapeExtend_WireData;//local translation (for mysewd)
|
||||
Handle(ShapeExtend_WireData) Gsewd3d = new ShapeExtend_WireData;//local translation (for mysewd3d)
|
||||
Handle(ShapeExtend_WireData) Gsewd2d = new ShapeExtend_WireData;//local translation (for mysewd2d)
|
||||
@@ -385,31 +384,17 @@ static Standard_Boolean Connect (const Handle(ShapeAnalysis_Wire)& theSAW,
|
||||
}
|
||||
}
|
||||
|
||||
if (!mysewd.IsNull())
|
||||
{
|
||||
okCurve = okCurve && Connect(saw, mysewd, Gsewd, (len3d > 1) || (len2d > 1), maxtol,
|
||||
distmin, revsewd, revnextsewd);
|
||||
}
|
||||
else
|
||||
{
|
||||
mysewd = Gsewd;
|
||||
}
|
||||
if (!mysewd3d.IsNull())
|
||||
{
|
||||
if (number > 1) {
|
||||
okCurve = okCurve && Connect (saw, mysewd, Gsewd, (len3d > 1) || (len2d > 1), maxtol,
|
||||
distmin, revsewd, revnextsewd);
|
||||
okCurve3d = okCurve3d && Connect (saw3d, mysewd3d, Gsewd3d, len3d > 1, maxtol,
|
||||
distmin, revsewd, revnextsewd);
|
||||
}
|
||||
else
|
||||
{
|
||||
mysewd3d = Gsewd3d;
|
||||
}
|
||||
if (!mysewd2d.IsNull())
|
||||
{
|
||||
okCurve2d = okCurve2d && Connect (saw2d, mysewd2d, Gsewd2d, len2d > 1, maxtol,
|
||||
distmin, revsewd, revnextsewd);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
mysewd = Gsewd;
|
||||
mysewd3d = Gsewd3d;
|
||||
mysewd2d = Gsewd2d;
|
||||
}
|
||||
return okCurve;
|
||||
|
@@ -395,7 +395,7 @@ TopoDS_Shape IGESToBRep_BRepEntity::TransferLoop(const Handle(IGESSolid_Loop)& s
|
||||
Curves2d->SetValue (i, start->ParametricCurve(iedge,i));
|
||||
}
|
||||
Handle(ShapeExtend_WireData) lsewd;//result of translation of current edge
|
||||
Result = Result && IB->Transfer (okCurve, okCurve3d, okCurve2d,
|
||||
Result = Result & IB->Transfer (okCurve, okCurve3d, okCurve2d,
|
||||
curve3d, Curves2d, !orientation,
|
||||
iedge, lsewd);
|
||||
if (iedge == 1) sewd = IB->WireData();//initialization
|
||||
|
@@ -343,7 +343,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferConicArc
|
||||
//The dimensions should be also obliged:
|
||||
//[a]=[b]=[c]=L^-2
|
||||
//if ( (Abs(a-c) <= GetEpsGeom()) && (Abs(b) < GetEpsCoeff()))
|
||||
Standard_Real eps2 = (Precision::PConfusion() * Precision::PConfusion()) / GetUnitFactor();
|
||||
Standard_Real eps2 = Precision::PConfusion() * Precision::PConfusion();
|
||||
if ( (Abs(a-c) <= eps2) && (Abs(b) < eps2)) {
|
||||
|
||||
// =================
|
||||
@@ -358,8 +358,8 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferConicArc
|
||||
|
||||
t1 = ElCLib::Parameter(circ, startPoint);
|
||||
t2 = ElCLib::Parameter(circ, endPoint);
|
||||
if (t1 > t2 && (t1 - t2) > Precision::Confusion() / GetUnitFactor()) t2 += 2.*M_PI;
|
||||
if (Abs(t1 - t2) <= Precision::Confusion() / GetUnitFactor()) { // t1 = t2
|
||||
if (t1 > t2 && (t1 - t2) > Precision::Confusion()) t2 += 2.*M_PI;
|
||||
if (Abs(t1 - t2) <= Precision::Confusion()) { // t1 = t2
|
||||
Message_Msg msg1160("IGES_1160");
|
||||
SendWarning(st, msg1160);
|
||||
}
|
||||
@@ -1249,7 +1249,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferLine
|
||||
|
||||
// modif du 15/10/97 : test moins severe
|
||||
// beaucoup de points confondus a GetEpsGeom()*GetUnitFactor()
|
||||
if (!Ps.IsEqual(Pe,Precision::Confusion() / GetUnitFactor())) { //:l3 abv 11 Jan 99: GetEpsGeom()*GetUnitFactor()/10.)) {
|
||||
if (!Ps.IsEqual(Pe,Precision::Confusion())) { //:l3 abv 11 Jan 99: GetEpsGeom()*GetUnitFactor()/10.)) {
|
||||
gp_Lin line(Ps, gp_Dir(gp_Vec(Ps,Pe)));
|
||||
Standard_Real t1 = ElCLib::Parameter(line, Ps);
|
||||
Standard_Real t2 = ElCLib::Parameter(line, Pe);
|
||||
@@ -1299,7 +1299,7 @@ Handle(Geom2d_Curve) IGESToBRep_BasicCurve::Transfer2dLine
|
||||
start->EndPoint().Y());
|
||||
}
|
||||
|
||||
if (!beg.IsEqual(end,Precision::PConfusion() / GetUnitFactor())) { //:l3 abv 11 Jan 99: GetEpsCoeff())) {
|
||||
if (!beg.IsEqual(end,Precision::PConfusion())) { //:l3 abv 11 Jan 99: GetEpsCoeff())) {
|
||||
gp_Lin2d line2d(beg, gp_Dir2d(gp_Vec2d(beg,end)));
|
||||
Standard_Real t1 = ElCLib::Parameter(line2d, beg);
|
||||
Standard_Real t2 = ElCLib::Parameter(line2d, end);
|
||||
|
@@ -312,7 +312,7 @@ Handle(Geom_CylindricalSurface) IGESToBRep_BasicSurface::TransferRigthCylindrica
|
||||
// Direction Reading Error : Null IGESEntity
|
||||
return res;
|
||||
}
|
||||
if (radius < Precision::Confusion() / GetUnitFactor()) {
|
||||
if (radius < Precision::Confusion()) {
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ Handle(Geom_ConicalSurface) IGESToBRep_BasicSurface::TransferRigthConicalSurface
|
||||
if (radius < 0) {
|
||||
return res;
|
||||
}
|
||||
if (radius < Precision::Confusion() / GetUnitFactor())
|
||||
if (radius < Precision::Confusion())
|
||||
radius = 0.;
|
||||
|
||||
gp_Pnt Pt = Point->Value();
|
||||
@@ -427,7 +427,7 @@ Handle(Geom_SphericalSurface) IGESToBRep_BasicSurface::TransferSphericalSurface
|
||||
// Direction Reading Error : Null IGESEntity
|
||||
return res;
|
||||
}
|
||||
if (radius < Precision::Confusion() / GetUnitFactor()){
|
||||
if (radius < Precision::Confusion()){
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -483,7 +483,7 @@ Handle(Geom_ToroidalSurface) IGESToBRep_BasicSurface::TransferToroidalSurface
|
||||
// Direction Reading Error : Null IGESEntity
|
||||
return res;
|
||||
}
|
||||
if (major < Precision::Confusion() / GetUnitFactor() || minor < Precision::Confusion() / GetUnitFactor()){
|
||||
if (major < Precision::Confusion()||minor < Precision::Confusion()){
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@@ -1330,7 +1330,7 @@ TopoDS_Shape IGESToBRep_TopoCurve::TransferBoundaryOnFace(TopoDS_Face& face,
|
||||
}
|
||||
else
|
||||
Curves2d = start->ParameterCurves(i);
|
||||
Result = Result && IB->Transfer (okCurve, okCurve3d, okCurve2d,
|
||||
Result = Result & IB->Transfer (okCurve, okCurve3d, okCurve2d,
|
||||
start->ModelSpaceCurve(i), start->Sense(i) == 2,
|
||||
Curves2d, i);
|
||||
}
|
||||
|
@@ -225,6 +225,14 @@ static Resource_KindOfLine WhatKindOfLine(OSD_File& aFile,
|
||||
aToken2.Clear();
|
||||
else {
|
||||
Line.Remove(1,Pos-1);
|
||||
const Standard_Integer aLineLength = Line.Length();
|
||||
if (aLineLength >= 2)
|
||||
{
|
||||
if (Line.Value(aLineLength - 1) == '\r')
|
||||
{
|
||||
Line.Remove(aLineLength - 1);
|
||||
}
|
||||
}
|
||||
Line.Remove(Line.Length());
|
||||
aToken2 = Line;
|
||||
}
|
||||
|
@@ -1,6 +1,3 @@
|
||||
puts "TODO CR23671 Linux: Error"
|
||||
puts "TODO CR23671 Linux: Draw_Failure: Could not open"
|
||||
|
||||
puts "============"
|
||||
puts "CR23671"
|
||||
puts "============"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO OCC26556 ALL: ERROR. offsetperform operation not done."
|
||||
puts "TODO OCC26556 ALL: ERROR. Mixed connectivity of faces."
|
||||
|
||||
puts "============"
|
||||
puts "OCC5805"
|
||||
@@ -20,6 +20,7 @@ if { [catch { offsetshape result a -1 a_6 } catch_result] } {
|
||||
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
||||
}
|
||||
|
||||
if { [isdraw result] } {
|
||||
checkmaxtol result -min_tol 1.
|
||||
|
||||
checkprops result -s 1185.03
|
||||
@@ -27,3 +28,4 @@ checkshape result
|
||||
|
||||
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
}
|
||||
|
@@ -1,6 +1,4 @@
|
||||
puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
|
||||
puts "TODO OCC25925 ALL: Tcl Exception:"
|
||||
puts "TODO OCC25925 ALL: TEST INCOMPLETE"
|
||||
puts "TODO OCC25925 ALL: ERROR. Mixed connectivity of faces."
|
||||
|
||||
puts "============"
|
||||
puts "OCC5805"
|
||||
@@ -25,6 +23,7 @@ if { [catch { offsetperform result } catch_result] } {
|
||||
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
||||
}
|
||||
|
||||
if { [isdraw result] } {
|
||||
checkmaxtol result -min_tol 1.
|
||||
|
||||
checkprops result -s 1185.03
|
||||
@@ -32,3 +31,4 @@ checkshape result
|
||||
|
||||
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
puts "TODO OCC25925 ALL: ERROR. Mixed connectivity of faces."
|
||||
|
||||
puts "============"
|
||||
puts "OCC5805"
|
||||
puts "============"
|
||||
@@ -21,6 +23,7 @@ if { [catch { offsetperform result } catch_result] } {
|
||||
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
||||
}
|
||||
|
||||
if { [isdraw result] } {
|
||||
checkmaxtol result -min_tol 1.
|
||||
|
||||
checkprops result -s 876.584
|
||||
@@ -28,3 +31,5 @@ checkshape result
|
||||
|
||||
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
puts "TODO OCC25925 ALL: ERROR. Mixed connectivity of faces."
|
||||
|
||||
puts "============"
|
||||
puts "OCC5805"
|
||||
puts "============"
|
||||
@@ -16,9 +18,12 @@ if { [catch { offsetshape result a -1 } catch_result] } {
|
||||
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
||||
}
|
||||
|
||||
if { [isdraw result] } {
|
||||
checkmaxtol result -min_tol 1.
|
||||
|
||||
checkprops result -s 876.584
|
||||
checkshape result
|
||||
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
}
|
||||
|
18
tests/bugs/modalg_8/bug33113
Normal file
18
tests/bugs/modalg_8/bug33113
Normal file
@@ -0,0 +1,18 @@
|
||||
puts "================================"
|
||||
puts "OCC33113: Modeling Algorithms - BRepFilletAPI_MakeFillet::Build SIGSEGV"
|
||||
puts "================================"
|
||||
|
||||
restore [locate_data_file bug33113.brep] sh
|
||||
|
||||
explode sh e
|
||||
copy sh_4 e
|
||||
|
||||
explode sh So
|
||||
copy sh_1 s
|
||||
|
||||
fillet res s 0.1 e
|
||||
|
||||
checkshape res
|
||||
|
||||
checkview -display res -3d -path ${imagedir}/${test_image}.png
|
||||
|
68
tests/lowalgos/bnd/bug30292
Normal file
68
tests/lowalgos/bnd/bug30292
Normal file
@@ -0,0 +1,68 @@
|
||||
puts "========"
|
||||
puts "0030292: Modeling Algorithms - BRepBndLib should avoid using Poly_Polygon3D when called with useTriangulation set to false"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
## geometric edge without any discrete representations
|
||||
|
||||
circle c 0 0 0 1
|
||||
mkedge e c
|
||||
set res1 [bounding e]
|
||||
set res2 [bounding e -noTriangulation]
|
||||
if {$res1 != $res2} {
|
||||
puts "Error: bounding boxes are different for geometric edge"
|
||||
}
|
||||
|
||||
## geometric edge with polygon 3d
|
||||
|
||||
incmesh e 0.1
|
||||
set res1_ref "-1.1000000999999999 -1.0927089740980542 -0.10000010000000001 1.1000000999999999 1.092708974098054 0.10000010000000001"
|
||||
set res2_ref "-1.0000001000000001 -1.0000001000000001 -9.9999999999999995e-08 1.0000001000000001 1.0000001000000001 9.9999999999999995e-08"
|
||||
unset res1
|
||||
set res1 [bounding e]
|
||||
foreach dd $res1 {
|
||||
if ![regexp $dd $res1_ref] {
|
||||
puts "Error: bounding box is wrong"
|
||||
}
|
||||
}
|
||||
unset res2
|
||||
set res2 [bounding e -noTriangulation]
|
||||
foreach dd $res2 {
|
||||
if ![regexp $dd $res2_ref] {
|
||||
puts "Error: bounding box is wrong"
|
||||
}
|
||||
}
|
||||
|
||||
## geometric edge with polygon on triangulation
|
||||
|
||||
pcylinder cyl 1 1
|
||||
incmesh cyl 0.1
|
||||
explode cyl e
|
||||
renamevar cyl_3 e
|
||||
unset res1
|
||||
set res1 [bounding e]
|
||||
foreach dd $res1 {
|
||||
if ![regexp $dd $res1_ref] {
|
||||
puts "Error: bounding box is wrong"
|
||||
}
|
||||
}
|
||||
unset res2
|
||||
set res2 [bounding e -noTriangulation]
|
||||
foreach dd $res2 {
|
||||
if ![regexp $dd $res2_ref] {
|
||||
puts "Error: bounding box is wrong"
|
||||
}
|
||||
}
|
||||
|
||||
## not geometric edge with polygon 3d
|
||||
|
||||
polygon3d pol3d 5 1 0 0 0 1 0 -1 0 0 0 -1 0 1 0 0
|
||||
mkedge e pol3d
|
||||
unset res1
|
||||
set res1 [bounding e]
|
||||
unset res2
|
||||
set res2 [bounding e -noTriangulation]
|
||||
if {$res1 != $res2} {
|
||||
puts "Error: bounding boxes are different for not geometric edge"
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
puts "TODO OCC26030 ALL: Error : The offset cannot be built"
|
||||
puts "TODO OCC26030 ALL: ERROR. Mixed connectivity of faces."
|
||||
|
||||
puts "========"
|
||||
puts "OCC26288"
|
||||
|
@@ -1,6 +1,5 @@
|
||||
puts "TODO OCC26577 All: Error : is WRONG because number of EDGE entities in shape"
|
||||
puts "TODO OCC26577 All: Error : is WRONG because number of SHELL entities in shape"
|
||||
|
||||
puts "TODO OCC26577 All: ERROR. Mixed connectivity of faces."
|
||||
puts "TODO OCC26577 All: Error : The offset cannot be built."
|
||||
|
||||
puts "=============================================================="
|
||||
puts "0027913: Sharing between edges was lost after offset operation"
|
||||
@@ -12,9 +11,11 @@ offsetparameter 1e-7 p i
|
||||
offsetload s 10
|
||||
offsetperform result
|
||||
|
||||
unifysamedom result_unif result
|
||||
if { [isdraw result] } {
|
||||
unifysamedom result_unif result
|
||||
|
||||
checkshape result
|
||||
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
|
||||
checkshape result
|
||||
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
|
||||
|
||||
checknbshapes result -ref [lrange [nbshapes s] 8 19]
|
||||
checknbshapes result -ref [lrange [nbshapes s] 8 19]
|
||||
}
|
||||
|
13
tests/offset/bugs/bug30055
Normal file
13
tests/offset/bugs/bug30055
Normal file
@@ -0,0 +1,13 @@
|
||||
puts "REQUIRED All: ERROR. Mixed connectivity of faces."
|
||||
puts "REQUIRED All: Error : The offset cannot be built."
|
||||
puts "============"
|
||||
puts "0030055: BRepOffset_MakeOffset throws TopoDS_Vertex hasn't gp_Pnt in intersection mode"
|
||||
puts "============"
|
||||
|
||||
restore [locate_data_file bug30055.brep] a
|
||||
|
||||
thickshell result a 1 i
|
||||
|
||||
if { [isdraw result] } {
|
||||
puts "ERROR - result must not be buit"
|
||||
}
|
@@ -1,4 +1,6 @@
|
||||
puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
|
||||
puts "TODO OCC25925 ALL: ERROR. Mixed connectivity of faces."
|
||||
puts "TODO OCC25925 ALL: Error : The offset cannot be built."
|
||||
|
||||
puts "============"
|
||||
puts "OCC5806"
|
||||
puts "============"
|
||||
@@ -28,11 +30,12 @@ explode resthru f
|
||||
if { [catch { offsetshape result resthru -0.5 resthru_6 resthru_7 } catch_result] } {
|
||||
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
||||
}
|
||||
if { [isdraw result] } {
|
||||
checkmaxtol result -min_tol 1.
|
||||
|
||||
checkmaxtol result -min_tol 1.
|
||||
checkprops result -s 1116.06
|
||||
checkshape result
|
||||
|
||||
checkprops result -s 1116.06
|
||||
checkshape result
|
||||
|
||||
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 - compound 0 -shape 41
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
puts "TODO OCC23190 ALL: ERROR. C0 continuity of input data."
|
||||
puts "TODO OCC23190 ALL: Error: The command cannot be built"
|
||||
puts "TODO OCC23190 ALL: result is not a topological shape!!!"
|
||||
puts "TODO OCC23068 ALL: TEST INCOMPLETE"
|
||||
puts "TODO OCC23068 ALL: Error : The offset cannot be built."
|
||||
|
||||
# Original bug : hkg60144/pro15325
|
||||
# Date : 17Juillet98
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
puts "TODO OCC23190 ALL: ERROR. C0 continuity of input data."
|
||||
puts "TODO OCC23190 ALL: Error: The command cannot be built"
|
||||
puts "TODO OCC23190 ALL: result is not a topological shape!!!"
|
||||
puts "TODO OCC23068 ALL: TEST INCOMPLETE"
|
||||
puts "TODO OCC23068 ALL: Error : The offset cannot be built."
|
||||
|
||||
# Original bug : cts21271
|
||||
# Date : 11Sept98
|
||||
|
||||
|
@@ -1,3 +1,5 @@
|
||||
puts "TODO OCC25925 ALL: ERROR. Mixed connectivity of faces."
|
||||
|
||||
puts "========"
|
||||
puts "OCC26443"
|
||||
puts "========"
|
||||
@@ -15,6 +17,8 @@ offsetshape r a -2
|
||||
dchrono h stop counter offsetshape
|
||||
fit
|
||||
|
||||
if { [isdraw r] } {
|
||||
checkshape r
|
||||
checknbshapes r -ref [lrange [nbshapes a] 8 19]
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
||||
}
|
||||
|
Reference in New Issue
Block a user