1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-21 10:13:43 +03:00

0024255: Regressions in test cases on OCCT vc9 win64 Release

Updated test-cases from branch CR24255_3

0024255: Regressions in test cases on OCCT vc9 win64 Release

Small refactoring.

Fix for CASE bugs modalg_5 bug25298_09: FAILED (error)

Test-cases correction (bugs modalg_5 bugs25804_1, bug25704_2)
This commit is contained in:
ifv 2015-02-12 14:38:39 +03:00 committed by bugmaster
parent 48e653b689
commit 873c119ff1
102 changed files with 4301 additions and 3440 deletions

View File

@ -742,7 +742,7 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace
Handle(IntTools_Context)& theContext) Handle(IntTools_Context)& theContext)
{ {
Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint; Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
Standard_Integer iErr, aIx, aNbDomains; Standard_Integer iErr, aIx = 0, aNbDomains = 0;
Standard_Real aUMin, aUMax, aVMin, aVMax; Standard_Real aUMin, aUMax, aVMin, aVMax;
Standard_Real aVx = 0., aUx, aV1, aV2; Standard_Real aVx = 0., aUx, aV1, aV2;
gp_Dir2d aD2D (0., 1.); gp_Dir2d aD2D (0., 1.);
@ -764,25 +764,37 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace
BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax); BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax);
// //
aUx=IntTools_Tools::IntermediatePoint(aUMin, aUMax); aUx=IntTools_Tools::IntermediatePoint(aUMin, aUMax);
Standard_Integer i;
for(i = 1; i <= 2; ++i)
{
aP2D.SetCoord(aUx, 0.); aP2D.SetCoord(aUx, 0.);
aL2D=new Geom2d_Line (aP2D, aD2D); aL2D=new Geom2d_Line (aP2D, aD2D);
Geom2dAdaptor_Curve aHCur(aL2D); Geom2dAdaptor_Curve aHCur(aL2D);
// //
aIx=aHatcher.AddHatching(aHCur) ; aIx=aHatcher.AddHatching(aHCur) ;
// //
aHatcher.Trim(); aHatcher.Trim(aIx);
bIsDone=aHatcher.TrimDone(aIx); bIsDone=aHatcher.TrimDone(aIx);
if (!bIsDone) { if (!bIsDone) {
iErr=1; iErr=1;
return iErr; return iErr;
} }
// //
if(aHatcher.NbPoints(aIx) > 1)
{
aHatcher.ComputeDomains(aIx); aHatcher.ComputeDomains(aIx);
bIsDone=aHatcher.IsDone(aIx); bIsDone=aHatcher.IsDone(aIx);
if (!bIsDone) { if (!bIsDone) {
iErr=2; iErr=2;
return iErr; return iErr;
} }
break;
}
else
{
aUx = aUMax - (aUx - aUMin);
}
}
// //
aNbDomains=aHatcher.NbDomains(aIx); aNbDomains=aHatcher.NbDomains(aIx);
if (aNbDomains > 0) { if (aNbDomains > 0) {

View File

@ -100,7 +100,8 @@
#include <Geom2dLProp_CLProps2d.hxx> #include <Geom2dLProp_CLProps2d.hxx>
#include <Geom2dConvert_CompCurveToBSplineCurve.hxx> #include <Geom2dConvert_CompCurveToBSplineCurve.hxx>
#include <Standard_ErrorHandler.hxx> #include <Standard_ErrorHandler.hxx>
#ifdef OCCT_DEBUG
//#define DRAW
#ifdef DRAW #ifdef DRAW
#include <Draw.hxx> #include <Draw.hxx>
#include <DrawTrSurf.hxx> #include <DrawTrSurf.hxx>
@ -114,6 +115,7 @@ static Standard_Integer NbOFFSET = 0;
static Standard_Integer NbEDGES = 0; static Standard_Integer NbEDGES = 0;
static Standard_Integer NbBISSEC = 0; static Standard_Integer NbBISSEC = 0;
#endif #endif
#endif
// Modified by Sergey KHROMOV - Thu Nov 16 17:24:39 2000 Begin // Modified by Sergey KHROMOV - Thu Nov 16 17:24:39 2000 Begin
@ -167,9 +169,8 @@ static void EdgeVertices (const TopoDS_Edge& E,
TopExp::Vertices(E,V1,V2); TopExp::Vertices(E,V1,V2);
} }
} }
static Standard_Boolean VertexFromNode static Standard_Boolean VertexFromNode
(const Handle(MAT_Node)& aNode, (const Handle(MAT_Node)& aNode,
const Standard_Real Offset, const Standard_Real Offset,
gp_Pnt2d& PN, gp_Pnt2d& PN,
BRepFill_DataMapOfNodeShape& MapNodeVertex, BRepFill_DataMapOfNodeShape& MapNodeVertex,
@ -201,7 +202,7 @@ static Standard_Boolean IsSmallClosedEdge(const TopoDS_Edge& anEdge,
const TopoDS_Vertex& aVertex); const TopoDS_Vertex& aVertex);
static void MakeCircle static void MakeCircle
(const TopoDS_Edge& E, (const TopoDS_Edge& E,
const TopoDS_Vertex& V, const TopoDS_Vertex& V,
const TopoDS_Face& F, const TopoDS_Face& F,
const Standard_Real Offset, const Standard_Real Offset,
@ -209,7 +210,7 @@ static void MakeCircle
const Handle(Geom_Plane)& RefPlane); const Handle(Geom_Plane)& RefPlane);
static void MakeOffset static void MakeOffset
(const TopoDS_Edge& E, (const TopoDS_Edge& E,
const TopoDS_Face& F, const TopoDS_Face& F,
const Standard_Real Offset, const Standard_Real Offset,
BRepFill_IndexedDataMapOfOrientedShapeListOfShape& Map, BRepFill_IndexedDataMapOfOrientedShapeListOfShape& Map,
@ -224,7 +225,7 @@ static void MakeOffset
//======================================================================= //=======================================================================
static Standard_Boolean KPartCircle static Standard_Boolean KPartCircle
(const TopoDS_Face& mySpine, (const TopoDS_Face& mySpine,
const Standard_Real myOffset, const Standard_Real myOffset,
const Standard_Boolean IsOpenResult, const Standard_Boolean IsOpenResult,
const Standard_Real Alt, const Standard_Real Alt,
@ -351,25 +352,26 @@ void BRepFill_OffsetWire::Init(const TopoDS_Face& Spine,
myIsDone = Standard_False; myIsDone = Standard_False;
TopoDS_Shape aLocalShape = Spine.Oriented(TopAbs_FORWARD); TopoDS_Shape aLocalShape = Spine.Oriented(TopAbs_FORWARD);
mySpine = TopoDS::Face(aLocalShape); mySpine = TopoDS::Face(aLocalShape);
// mySpine = TopoDS::Face(Spine.Oriented(TopAbs_FORWARD)); // mySpine = TopoDS::Face(Spine.Oriented(TopAbs_FORWARD));
myJoinType = Join; myJoinType = Join;
myIsOpenResult = IsOpenResult; myIsOpenResult = IsOpenResult;
myMap.Clear(); myMap.Clear();
myMapSpine.Clear(); myMapSpine.Clear();
//------------------------------------------------------------------ //------------------------------------------------------------------
// cut the spine for bissectors. // cut the spine for bissectors.
//------------------------------------------------------------------ //------------------------------------------------------------------
// Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 Begin // Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 Begin
static BRepMAT2d_Explorer Exp; static BRepMAT2d_Explorer Exp;
Exp.Perform(mySpine); Exp.Perform(mySpine);
// TopoDS_Face anOldSpine = mySpine; // TopoDS_Face anOldSpine = mySpine;
mySpine = TopoDS::Face(Exp.ModifiedShape(mySpine)); mySpine = TopoDS::Face(Exp.ModifiedShape(mySpine));
PrepareSpine (); PrepareSpine ();
// Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 End // Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 End
TopoDS_Shape aShape; TopoDS_Shape aShape;
BRepFill_IndexedDataMapOfOrientedShapeListOfShape aMap; BRepFill_IndexedDataMapOfOrientedShapeListOfShape aMap;
Standard_Boolean Done; Standard_Boolean Done;
@ -381,12 +383,12 @@ void BRepFill_OffsetWire::Init(const TopoDS_Face& Spine,
// and Links Topology -> base elements of the map. // and Links Topology -> base elements of the map.
//----------------------------------------------------- //-----------------------------------------------------
// Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 Begin // Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 Begin
// static BRepMAT2d_Explorer Exp; // static BRepMAT2d_Explorer Exp;
// Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 End // Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 End
Exp.Perform(myWorkSpine); Exp.Perform(myWorkSpine);
myBilo.Compute(Exp, 1 ,MAT_Left, myJoinType, myIsOpenResult); myBilo.Compute(Exp, 1 ,MAT_Left, myJoinType, myIsOpenResult);
myLink.Perform(Exp, myBilo); myLink.Perform(Exp,myBilo);
} }
@ -429,7 +431,7 @@ const TopoDS_Shape& BRepFill_OffsetWire::Shape() const
//======================================================================= //=======================================================================
const TopTools_ListOfShape& BRepFill_OffsetWire::GeneratedShapes const TopTools_ListOfShape& BRepFill_OffsetWire::GeneratedShapes
(const TopoDS_Shape& SpineShape) (const TopoDS_Shape& SpineShape)
{ {
if (!myCallGen) { if (!myCallGen) {
if (!myMapSpine.IsEmpty()) { if (!myMapSpine.IsEmpty()) {
@ -689,7 +691,7 @@ void Compute (const TopoDS_Face& Spine,
const TopoDS_Wire& CurW = TopoDS::Wire(exp.Current()); const TopoDS_Wire& CurW = TopoDS::Wire(exp.Current());
TopoDS_Shape aLocalShape = CurW.Moved(L); TopoDS_Shape aLocalShape = CurW.Moved(L);
TopoDS_Wire NewW = TopoDS::Wire(aLocalShape); TopoDS_Wire NewW = TopoDS::Wire(aLocalShape);
// TopoDS_Wire NewW = TopoDS::Wire(CurW.Moved(L)); // TopoDS_Wire NewW = TopoDS::Wire(CurW.Moved(L));
B.Add(aShape,NewW); B.Add(aShape,NewW);
// update Map. // update Map.
TopoDS_Iterator it1( CurW); TopoDS_Iterator it1( CurW);
@ -708,7 +710,7 @@ void Compute (const TopoDS_Face& Spine,
//======================================================================= //=======================================================================
void BRepFill_OffsetWire::PerformWithBiLo void BRepFill_OffsetWire::PerformWithBiLo
(const TopoDS_Face& Spine, (const TopoDS_Face& Spine,
const Standard_Real Offset, const Standard_Real Offset,
const BRepMAT2d_BisectingLocus& Locus, const BRepMAT2d_BisectingLocus& Locus,
BRepMAT2d_LinkTopoBilo& Link, BRepMAT2d_LinkTopoBilo& Link,
@ -718,7 +720,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
myIsDone = Standard_False; myIsDone = Standard_False;
TopoDS_Shape aLocalShape = Spine.Oriented(TopAbs_FORWARD); TopoDS_Shape aLocalShape = Spine.Oriented(TopAbs_FORWARD);
myWorkSpine = TopoDS::Face(aLocalShape); myWorkSpine = TopoDS::Face(aLocalShape);
// myWorkSpine = TopoDS::Face(Spine.Oriented(TopAbs_FORWARD)); // myWorkSpine = TopoDS::Face(Spine.Oriented(TopAbs_FORWARD));
myJoinType = Join; myJoinType = Join;
myOffset = Offset ; myOffset = Offset ;
myShape.Nullify(); myShape.Nullify();
@ -727,8 +729,8 @@ void BRepFill_OffsetWire::PerformWithBiLo
if (mySpine.IsNull()) { if (mySpine.IsNull()) {
TopoDS_Shape aLocalShape = Spine.Oriented(TopAbs_FORWARD); TopoDS_Shape aLocalShape = Spine.Oriented(TopAbs_FORWARD);
mySpine = TopoDS::Face(aLocalShape); mySpine = TopoDS::Face(aLocalShape);
// mySpine = TopoDS::Face(Spine.Oriented(TopAbs_FORWARD)); // mySpine = TopoDS::Face(Spine.Oriented(TopAbs_FORWARD));
} }
myMap.Clear(); myMap.Clear();
if ( Abs(myOffset) < Precision::Confusion()) { if ( Abs(myOffset) < Precision::Confusion()) {
@ -805,11 +807,13 @@ void BRepFill_OffsetWire::PerformWithBiLo
} }
#ifdef OCCT_DEBUG
#ifdef DRAW #ifdef DRAW
if (AffichEdge) { if (AffichEdge) {
cout << " End Construction of geometric primitives "<<endl; cout << " End Construction of geometric primitives "<<endl;
} }
#endif #endif
#endif
//--------------------------------------------------- //---------------------------------------------------
@ -830,13 +834,15 @@ void BRepFill_OffsetWire::PerformWithBiLo
CurrentArc = Locus.Graph()->Arc(i); CurrentArc = Locus.Graph()->Arc(i);
Bisector_Bisec Bisec = Locus.GeomBis(CurrentArc,Reverse); Bisector_Bisec Bisec = Locus.GeomBis(CurrentArc,Reverse);
#ifdef OCCT_DEBUG
#ifdef DRAW #ifdef DRAW
if ( AffichGeom) { if ( AffichGeom) {
char name[256]; char name[256];
sprintf(name,"BISSEC_%d",NbBISSEC++); sprintf(name,"BISSEC_%d",NbBISSEC++);
DrawTrSurf::Set(name,Bisec.Value()); DrawTrSurf::Set(name,Bisec.Value());
} }
#endif
#endif #endif
//------------------------------------------------------------------- //-------------------------------------------------------------------
@ -882,14 +888,14 @@ void BRepFill_OffsetWire::PerformWithBiLo
if (!Node1->Infinite()) { if (!Node1->Infinite()) {
gp_Pnt2d aLocalPnt2d = Locus.GeomElt(Node1); gp_Pnt2d aLocalPnt2d = Locus.GeomElt(Node1);
StartOnEdge = VertexFromNode(Node1, myOffset, aLocalPnt2d ,MapNodeVertex,VS); StartOnEdge = VertexFromNode(Node1, myOffset, aLocalPnt2d ,MapNodeVertex,VS);
// StartOnEdge = VertexFromNode(Node1, myOffset, Locus.GeomElt(Node1), // StartOnEdge = VertexFromNode(Node1, myOffset, Locus.GeomElt(Node1),
// MapNodeVertex,VS); // MapNodeVertex,VS);
} }
if (!Node2->Infinite()) { if (!Node2->Infinite()) {
gp_Pnt2d aLocalPnt2d = Locus.GeomElt(Node2) ; gp_Pnt2d aLocalPnt2d = Locus.GeomElt(Node2) ;
EndOnEdge = VertexFromNode(Node2, myOffset, aLocalPnt2d ,MapNodeVertex,VE); EndOnEdge = VertexFromNode(Node2, myOffset, aLocalPnt2d ,MapNodeVertex,VE);
// EndOnEdge = VertexFromNode(Node2, myOffset, Locus.GeomElt(Node2), // EndOnEdge = VertexFromNode(Node2, myOffset, Locus.GeomElt(Node2),
// MapNodeVertex,VE); // MapNodeVertex,VE);
} }
//--------------------------------------------- //---------------------------------------------
@ -985,10 +991,12 @@ void BRepFill_OffsetWire::PerformWithBiLo
} }
} }
#ifdef OCCT_DEBUG
#ifdef DRAW #ifdef DRAW
if (AffichEdge) { if (AffichEdge) {
cout << " End Construction of vertices on offsets"<<endl; cout << " End Construction of vertices on offsets"<<endl;
} }
#endif
#endif #endif
//---------------------------------- //----------------------------------
@ -1106,6 +1114,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
dist2 = l3d.Distance( TV2->Pnt() ); dist2 = l3d.Distance( TV2->Pnt() );
if (! MapVertex.Contains( V1 )) if (! MapVertex.Contains( V1 ))
{ {
TV1->Pnt( f3d ); TV1->Pnt( f3d );
MapVertex.Add( V1 ); MapVertex.Add( V1 );
} }
@ -1132,7 +1141,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
//======================================================================= //=======================================================================
BRepFill_IndexedDataMapOfOrientedShapeListOfShape& BRepFill_IndexedDataMapOfOrientedShapeListOfShape&
BRepFill_OffsetWire::Generated() BRepFill_OffsetWire::Generated()
{ {
return myMap; return myMap;
} }
@ -1163,7 +1172,7 @@ void BRepFill_OffsetWire::PrepareSpine()
TopoDS_Wire NW; TopoDS_Wire NW;
B.MakeWire (NW); B.MakeWire (NW);
// Modified by Sergey KHROMOV - Thu Nov 16 17:29:55 2000 Begin // Modified by Sergey KHROMOV - Thu Nov 16 17:29:55 2000 Begin
Standard_Integer ForcedCut = 0; Standard_Integer ForcedCut = 0;
Standard_Integer nbResEdges = -1; Standard_Integer nbResEdges = -1;
TopTools_IndexedMapOfShape EdgeMap; TopTools_IndexedMapOfShape EdgeMap;
@ -1173,7 +1182,7 @@ void BRepFill_OffsetWire::PrepareSpine()
if (nbEdges == 1 && !myIsOpenResult) //in case of open wire there's no need to do it if (nbEdges == 1 && !myIsOpenResult) //in case of open wire there's no need to do it
ForcedCut = 2; ForcedCut = 2;
// Modified by Sergey KHROMOV - Thu Nov 16 17:29:48 2000 End // Modified by Sergey KHROMOV - Thu Nov 16 17:29:48 2000 End
for (TopoDS_Iterator IteW(IteF.Value()); IteW.More(); IteW.Next()) { for (TopoDS_Iterator IteW(IteF.Value()); IteW.More(); IteW.Next()) {
@ -1185,10 +1194,10 @@ void BRepFill_OffsetWire::PrepareSpine()
// Cut // Cut
TopoDS_Shape aLocalShape = E.Oriented(TopAbs_FORWARD); TopoDS_Shape aLocalShape = E.Oriented(TopAbs_FORWARD);
// Modified by Sergey KHROMOV - Thu Nov 16 17:29:29 2000 Begin // Modified by Sergey KHROMOV - Thu Nov 16 17:29:29 2000 Begin
if (nbEdges == 2 && nbResEdges == 0) if (nbEdges == 2 && nbResEdges == 0)
ForcedCut = 1; ForcedCut = 1;
// Modified by Sergey KHROMOV - Thu Nov 16 17:29:33 2000 End // Modified by Sergey KHROMOV - Thu Nov 16 17:29:33 2000 End
nbResEdges = CutEdge (TopoDS::Edge(aLocalShape), mySpine, ForcedCut, Cuts); nbResEdges = CutEdge (TopoDS::Edge(aLocalShape), mySpine, ForcedCut, Cuts);
if (Cuts.IsEmpty()) { if (Cuts.IsEmpty()) {
@ -1207,22 +1216,28 @@ void BRepFill_OffsetWire::PrepareSpine()
} }
} }
} }
// Modified by Sergey KHROMOV - Thu Mar 7 09:17:41 2002 Begin // Modified by Sergey KHROMOV - Thu Mar 7 09:17:41 2002 Begin
TopoDS_Vertex aV1; TopoDS_Vertex aV1;
TopoDS_Vertex aV2; TopoDS_Vertex aV2;
TopExp::Vertices(NW, aV1, aV2); TopExp::Vertices(NW, aV1, aV2);
NW.Closed(aV1.IsSame(aV2)); NW.Closed(aV1.IsSame(aV2));
// Modified by Sergey KHROMOV - Thu Mar 7 09:17:43 2002 End
// Modified by Sergey KHROMOV - Thu Mar 7 09:17:43 2002 End
B.Add(myWorkSpine, NW); B.Add(myWorkSpine, NW);
} }
#ifdef OCCT_DEBUG
#ifdef DRAW #ifdef DRAW
if ( AffichEdge) { if ( AffichEdge) {
DBRep::Set("WS",myWorkSpine); DBRep::Set("WS",myWorkSpine);
DBRep::Set("MS",mySpine);
BRepTools::Write(myWorkSpine, "WS");
BRepTools::Write(mySpine, "MS");
} }
#endif #endif
#endif
} }
@ -1266,7 +1281,7 @@ void BRepFill_OffsetWire::UpdateDetromp (BRepFill_DataMapOfOrientedShapeListOfSh
gp_Pnt2d P = Bis->Value((U2 + U1)*0.5); gp_Pnt2d P = Bis->Value((U2 + U1)*0.5);
Standard_Boolean IsP_inside = Standard_True; Standard_Boolean IsP_inside = Standard_True;
if (myJoinType == GeomAbs_Arc) if ((myJoinType != GeomAbs_Intersection) || EOnE)
IsP_inside = Trim.IsInside(P); IsP_inside = Trim.IsInside(P);
if (!IsP_inside) { if (!IsP_inside) {
if (!V1.IsNull()) { if (!V1.IsNull()) {
@ -1303,6 +1318,13 @@ void BRepFill_OffsetWire::UpdateDetromp (BRepFill_DataMapOfOrientedShapeListOfSh
} }
} }
} }
//else if(myJoinType != GeomAbs_Arc)
//{
// if (!V1.IsNull()) {
// Detromp(Shape1).Append(V1);
// Detromp(Shape2).Append(V1);
// }
//}
} }
//======================================================================= //=======================================================================
@ -1348,9 +1370,10 @@ void BRepFill_OffsetWire::MakeWires()
//-------------------------------------- //--------------------------------------
BRep_Builder B; BRep_Builder B;
// Standard_Integer NbEdges;
// Standard_Boolean NewWire = Standard_True; // Standard_Integer NbEdges;
// Standard_Boolean AddEdge = Standard_False; // Standard_Boolean NewWire = Standard_True;
// Standard_Boolean AddEdge = Standard_False;
TopoDS_Wire NW; TopoDS_Wire NW;
Standard_Boolean End; Standard_Boolean End;
@ -1373,9 +1396,10 @@ void BRepFill_OffsetWire::MakeWires()
End = Standard_False; End = Standard_False;
MVE.ChangeFromKey(CV).RemoveFirst(); MVE.ChangeFromKey(CV).RemoveFirst();
// Modified by Sergey KHROMOV - Thu Mar 14 11:29:59 2002 Begin // Modified by Sergey KHROMOV - Thu Mar 14 11:29:59 2002 Begin
Standard_Boolean isClosed = Standard_False; Standard_Boolean isClosed = Standard_False;
// Modified by Sergey KHROMOV - Thu Mar 14 11:30:00 2002 End
// Modified by Sergey KHROMOV - Thu Mar 14 11:30:00 2002 End
while(!End) { while(!End) {
//------------------------------- //-------------------------------
@ -1387,9 +1411,9 @@ void BRepFill_OffsetWire::MakeWires()
B.Add (NW,CE); B.Add (NW,CE);
if (VF.IsSame(CV) || !MVE.Contains(CV)) { if (VF.IsSame(CV) || !MVE.Contains(CV)) {
// Modified by Sergey KHROMOV - Thu Mar 14 11:30:14 2002 Begin // Modified by Sergey KHROMOV - Thu Mar 14 11:30:14 2002 Begin
isClosed = VF.IsSame(CV); isClosed = VF.IsSame(CV);
// Modified by Sergey KHROMOV - Thu Mar 14 11:30:15 2002 End // Modified by Sergey KHROMOV - Thu Mar 14 11:30:15 2002 End
End = Standard_True; End = Standard_True;
//MVE.UnBind(VF); //MVE.UnBind(VF);
TopoDS_Shape LastShape = MVE.FindKey(MVE.Extent()); TopoDS_Shape LastShape = MVE.FindKey(MVE.Extent());
@ -1426,10 +1450,10 @@ void BRepFill_OffsetWire::MakeWires()
} }
} }
} }
// Modified by Sergey KHROMOV - Thu Mar 14 11:29:31 2002 Begin // Modified by Sergey KHROMOV - Thu Mar 14 11:29:31 2002 Begin
// NW.Closed(Standard_True); // NW.Closed(Standard_True);
NW.Closed(isClosed); NW.Closed(isClosed);
// Modified by Sergey KHROMOV - Thu Mar 14 11:29:37 2002 End // Modified by Sergey KHROMOV - Thu Mar 14 11:29:37 2002 End
TheWires.Append(NW); TheWires.Append(NW);
} }
@ -1514,7 +1538,12 @@ void BRepFill_OffsetWire::FixHoles()
TopoDS_Vertex Vf, Vl; TopoDS_Vertex Vf, Vl;
TopExp::Vertices( Base, Vf, Vl ); TopExp::Vertices( Base, Vf, Vl );
if(Vf.IsNull() || Vl.IsNull()) if(Vf.IsNull() || Vl.IsNull())
{
Standard_Failure::Raise("BRepFill_OffsetWire::FixHoles(): Wrong wire."); Standard_Failure::Raise("BRepFill_OffsetWire::FixHoles(): Wrong wire.");
#ifdef OCCT_DEBUG
BRepTools::Write(Base, "Base");
#endif
}
gp_Pnt Pf, Pl; gp_Pnt Pf, Pl;
Pf = BRep_Tool::Pnt(Vf); Pf = BRep_Tool::Pnt(Vf);
Pl = BRep_Tool::Pnt(Vl); Pl = BRep_Tool::Pnt(Vl);
@ -1528,7 +1557,15 @@ void BRepFill_OffsetWire::FixHoles()
TopExp::Vertices( aWire, V1, V2 ); TopExp::Vertices( aWire, V1, V2 );
if(V1.IsNull() || V2.IsNull()) if(V1.IsNull() || V2.IsNull())
{
Standard_Failure::Raise("BRepFill_OffsetWire::FixHoles(): Wrong wire."); Standard_Failure::Raise("BRepFill_OffsetWire::FixHoles(): Wrong wire.");
#ifdef OCCT_DEBUG
BRepTools::Write(Base, "Base");
char name[128];
sprintf(name,"Wire_%d",i);
BRepTools::Write(aWire, name);
#endif
}
gp_Pnt P1, P2; gp_Pnt P1, P2;
P1 = BRep_Tool::Pnt(V1); P1 = BRep_Tool::Pnt(V1);
@ -1747,19 +1784,19 @@ Standard_Integer CutEdge (const TopoDS_Edge& E,
Standard_Real f,l; Standard_Real f,l;
Handle(Geom2d_Curve) C2d; Handle(Geom2d_Curve) C2d;
Handle(Geom2d_TrimmedCurve) CT2d; Handle(Geom2d_TrimmedCurve) CT2d;
// Modified by Sergey KHROMOV - Wed Mar 6 17:36:25 2002 Begin // Modified by Sergey KHROMOV - Wed Mar 6 17:36:25 2002 Begin
Standard_Real aTol = BRep_Tool::Tolerance(E); Standard_Real aTol = BRep_Tool::Tolerance(E);
Handle(Geom_Curve) aC; Handle(Geom_Curve) aC;
// Modified by Sergey KHROMOV - Wed Mar 6 17:36:25 2002 End // Modified by Sergey KHROMOV - Wed Mar 6 17:36:25 2002 End
TopoDS_Vertex V1,V2,VF,VL; TopoDS_Vertex V1,V2,VF,VL;
TopExp::Vertices (E,V1,V2); TopExp::Vertices (E,V1,V2);
BRep_Builder B; BRep_Builder B;
C2d = BRep_Tool::CurveOnSurface (E,F,f,l); C2d = BRep_Tool::CurveOnSurface (E,F,f,l);
// Modified by Sergey KHROMOV - Wed Mar 6 17:36:54 2002 Begin // Modified by Sergey KHROMOV - Wed Mar 6 17:36:54 2002 Begin
aC = BRep_Tool::Curve(E,f,l); aC = BRep_Tool::Curve(E,f,l);
// Modified by Sergey KHROMOV - Wed Mar 6 17:36:54 2002 End // Modified by Sergey KHROMOV - Wed Mar 6 17:36:54 2002 End
CT2d = new Geom2d_TrimmedCurve(C2d,f,l); CT2d = new Geom2d_TrimmedCurve(C2d,f,l);
//if (E.Orientation() == TopAbs_REVERSED) CT2d->Reverse(); //if (E.Orientation() == TopAbs_REVERSED) CT2d->Reverse();
@ -1773,7 +1810,7 @@ Standard_Integer CutEdge (const TopoDS_Edge& E,
//------------------------- //-------------------------
Cuter.Perform(CT2d); Cuter.Perform(CT2d);
// Modified by Sergey KHROMOV - Thu Nov 16 17:28:29 2000 Begin // Modified by Sergey KHROMOV - Thu Nov 16 17:28:29 2000 Begin
if (ForceCut == 0) { if (ForceCut == 0) {
if (Cuter.UnModified()) { if (Cuter.UnModified()) {
//----------------------------- //-----------------------------
@ -1789,6 +1826,7 @@ Standard_Integer CutEdge (const TopoDS_Edge& E,
CutCurve (CT2d, 2, theCurves); CutCurve (CT2d, 2, theCurves);
} else { } else {
for (Standard_Integer k = 1; k <= Cuter.NbCurves(); k++) for (Standard_Integer k = 1; k <= Cuter.NbCurves(); k++)
theCurves.Append(Cuter.Value(k)); theCurves.Append(Cuter.Value(k));
} }
} else if (ForceCut == 2) { } else if (ForceCut == 2) {
@ -1796,6 +1834,7 @@ Standard_Integer CutEdge (const TopoDS_Edge& E,
CutCurve (CT2d, 3, theCurves); CutCurve (CT2d, 3, theCurves);
} else { } else {
if (Cuter.NbCurves() == 2) { if (Cuter.NbCurves() == 2) {
Handle(Geom2d_TrimmedCurve)CC = Cuter.Value(1); Handle(Geom2d_TrimmedCurve)CC = Cuter.Value(1);
if (CC->LastParameter() > (l+f)/2.) { if (CC->LastParameter() > (l+f)/2.) {
@ -1811,7 +1850,8 @@ Standard_Integer CutEdge (const TopoDS_Edge& E,
} }
} }
} }
// Modified by Sergey KHROMOV - Thu Nov 16 17:28:37 2000 End
// Modified by Sergey KHROMOV - Thu Nov 16 17:28:37 2000 End
//-------------------------------------- //--------------------------------------
// Creation of cut edges. // Creation of cut edges.
@ -1824,16 +1864,16 @@ Standard_Integer CutEdge (const TopoDS_Edge& E,
if (k == theCurves.Length()) {VL = V2;} if (k == theCurves.Length()) {VL = V2;}
else { else {
// Modified by Sergey KHROMOV - Wed Mar 6 17:38:02 2002 Begin // Modified by Sergey KHROMOV - Wed Mar 6 17:38:02 2002 Begin
gp_Pnt P = aC->Value(CC->LastParameter()); gp_Pnt P = aC->Value(CC->LastParameter());
VL = BRepLib_MakeVertex(P); VL = BRepLib_MakeVertex(P);
B.UpdateVertex(VL, aTol); B.UpdateVertex(VL, aTol);
// Modified by Sergey KHROMOV - Wed Mar 6 17:38:05 2002 End // Modified by Sergey KHROMOV - Wed Mar 6 17:38:05 2002 End
} }
TopoDS_Shape aLocalShape = E.EmptyCopied(); TopoDS_Shape aLocalShape = E.EmptyCopied();
TopoDS_Edge NE = TopoDS::Edge(aLocalShape); TopoDS_Edge NE = TopoDS::Edge(aLocalShape);
// TopoDS_Edge NE = TopoDS::Edge(E.EmptyCopied()); // TopoDS_Edge NE = TopoDS::Edge(E.EmptyCopied());
NE.Orientation(TopAbs_FORWARD); NE.Orientation(TopAbs_FORWARD);
B.Add (NE,VF.Oriented(TopAbs_FORWARD)); B.Add (NE,VF.Oriented(TopAbs_FORWARD));
B.Add (NE,VL.Oriented(TopAbs_REVERSED)); B.Add (NE,VL.Oriented(TopAbs_REVERSED));
@ -1929,6 +1969,7 @@ void MakeCircle (const TopoDS_Edge& E,
LL.Append(OE); LL.Append(OE);
Map.Add(V,LL); Map.Add(V,LL);
#ifdef OCCT_DEBUG
#ifdef DRAW #ifdef DRAW
if ( AffichGeom && !OE.IsNull()) { if ( AffichGeom && !OE.IsNull()) {
char name[256]; char name[256];
@ -1936,6 +1977,7 @@ void MakeCircle (const TopoDS_Edge& E,
DBRep::Set(name,OE); DBRep::Set(name,OE);
} }
#endif #endif
#endif
} }
//======================================================================= //=======================================================================
@ -2059,13 +2101,15 @@ void MakeOffset (const TopoDS_Edge& E,
LL.Append(OE); LL.Append(OE);
Map.Add(E,LL); Map.Add(E,LL);
#ifdef OCCT_DEBUG
#ifdef DRAW #ifdef DRAW
if (AffichGeom && !OE.IsNull()) { if (AffichGeom && !OE.IsNull()) {
char name[256]; char name[256];
sprintf(name,"OFFSET_%d",++NbOFFSET); sprintf(name,"OFFSET_%d",++NbOFFSET);
DBRep::Set(name,OE); DBRep::Set(name,OE);
Standard_Real ii = 0; //Standard_Real ii = 0;
} }
#endif
#endif #endif
} }
@ -2188,6 +2232,7 @@ void TrimEdge (const TopoDS_Edge& E,
if (!BRep_Tool::Degenerated(E)) { if (!BRep_Tool::Degenerated(E)) {
for (Standard_Integer k = 1; k < TheVer.Length(); k ++) { for (Standard_Integer k = 1; k < TheVer.Length(); k ++) {
if (TheVer.Value(k).IsSame(TheVer.Value(k+1)) || if (TheVer.Value(k).IsSame(TheVer.Value(k+1)) ||
Abs(ThePar.Value(k)-ThePar.Value(k+1)) <= Precision::PConfusion()) { Abs(ThePar.Value(k)-ThePar.Value(k+1)) <= Precision::PConfusion()) {
if(k+1 == TheVer.Length()) { if(k+1 == TheVer.Length()) {
@ -2312,6 +2357,7 @@ void TrimEdge (const TopoDS_Edge& E,
TheBuilder.Range(NewEdge,ThePar.Value(k),ThePar.Value(k+1)); TheBuilder.Range(NewEdge,ThePar.Value(k),ThePar.Value(k+1));
#ifdef OCCT_DEBUG
#ifdef DRAW #ifdef DRAW
if ( AffichEdge) { if ( AffichEdge) {
char name[256]; char name[256];
@ -2333,7 +2379,7 @@ void TrimEdge (const TopoDS_Edge& E,
Draw::Set(name,dr); Draw::Set(name,dr);
} }
#endif #endif
#endif
S.Append(NewEdge); S.Append(NewEdge);
} }
} }
@ -2438,30 +2484,40 @@ static void CheckBadEdges(const TopoDS_Face& Spine, const Standard_Real Offset,
const TopoDS_Shape& SE = Link.GeneratingShape(Locus.BasicElt(ic,ie)); const TopoDS_Shape& SE = Link.GeneratingShape(Locus.BasicElt(ic,ie));
if (SE.ShapeType() == TopAbs_EDGE) { if (SE.ShapeType() == TopAbs_EDGE) {
if (aMap.Contains(SE)) { if (aMap.Contains(SE)) {
//cout << "Edge is treated second time" << endl; //cout << "Edge is treated second time" << endl;
continue; continue;
} }
TopoDS_Edge E = TopoDS::Edge(SE); TopoDS_Edge E = TopoDS::Edge(SE);
Standard_Real f,l; Standard_Real f,l;
Handle(Geom2d_Curve) G2d = BRep_Tool::CurveOnSurface(E,F,f,l); Handle(Geom2d_Curve) G2d = BRep_Tool::CurveOnSurface(E,F,f,l);
Geom2dAdaptor_Curve AC(G2d,f,l); Geom2dAdaptor_Curve AC(G2d,f,l);
GeomAbs_CurveType aCType = AC.GetType(); GeomAbs_CurveType aCType = AC.GetType();
if(aCType != GeomAbs_Line && aCType != GeomAbs_Circle) { if(aCType != GeomAbs_Line && aCType != GeomAbs_Circle) {
Standard_Boolean reverse = Standard_False; Standard_Boolean reverse = Standard_False;
if (E.Orientation() == TopAbs_FORWARD) reverse = Standard_True; if (E.Orientation() == TopAbs_FORWARD) reverse = Standard_True;
gp_Pnt2d P, Pc; gp_Pnt2d P, Pc;
gp_Dir2d N; gp_Dir2d N;
Geom2dLProp_CLProps2d aCLProps(G2d, 2, eps); Geom2dLProp_CLProps2d aCLProps(G2d, 2, eps);
aCLProps.SetParameter(f); aCLProps.SetParameter(f);
if(!aCLProps.IsTangentDefined()) { if(!aCLProps.IsTangentDefined()) {
BadEdges.Append(SE); BadEdges.Append(SE);
@ -2469,9 +2525,11 @@ static void CheckBadEdges(const TopoDS_Face& Spine, const Standard_Real Offset,
continue; continue;
} }
P = aCLProps.Value(); P = aCLProps.Value();
Standard_Real Crv = aCLProps.Curvature(); Standard_Real Crv = aCLProps.Curvature();
if(Crv >= eps) { if(Crv >= eps) {
aCLProps.Tangent(N); aCLProps.Tangent(N);
Standard_Real x = N.Y(), y = -N.X(); Standard_Real x = N.Y(), y = -N.X();
@ -2488,6 +2546,7 @@ static void CheckBadEdges(const TopoDS_Face& Spine, const Standard_Real Offset,
} }
} }
aCLProps.SetParameter(l); aCLProps.SetParameter(l);
if(!aCLProps.IsTangentDefined()) { if(!aCLProps.IsTangentDefined()) {
BadEdges.Append(SE); BadEdges.Append(SE);
@ -2495,9 +2554,11 @@ static void CheckBadEdges(const TopoDS_Face& Spine, const Standard_Real Offset,
continue; continue;
} }
P = aCLProps.Value(); P = aCLProps.Value();
Crv = aCLProps.Curvature(); Crv = aCLProps.Curvature();
if(Crv >= eps) { if(Crv >= eps) {
aCLProps.Tangent(N); aCLProps.Tangent(N);
Standard_Real x = N.Y(), y = -N.X(); Standard_Real x = N.Y(), y = -N.X();
@ -2526,6 +2587,7 @@ static void CheckBadEdges(const TopoDS_Face& Spine, const Standard_Real Offset,
//======================================================================= //=======================================================================
static Standard_Boolean PerformCurve (TColStd_SequenceOfReal& Parameters, static Standard_Boolean PerformCurve (TColStd_SequenceOfReal& Parameters,
TColgp_SequenceOfPnt& Points, TColgp_SequenceOfPnt& Points,
const Adaptor3d_Curve& C, const Adaptor3d_Curve& C,
const Standard_Real Deflection, const Standard_Real Deflection,
@ -2551,6 +2613,7 @@ static Standard_Boolean PerformCurve (TColStd_SequenceOfReal& Parameters,
if((aDelta/aDist) > 5.0e-14) if((aDelta/aDist) > 5.0e-14)
{ {
QuasiFleche(C,Deflection*Deflection, QuasiFleche(C,Deflection*Deflection,
UU1,Pdeb, UU1,Pdeb,
Ddeb, Ddeb,
UU2,Pfin, UU2,Pfin,
@ -2568,6 +2631,7 @@ static Standard_Boolean PerformCurve (TColStd_SequenceOfReal& Parameters,
//======================================================================= //=======================================================================
static void QuasiFleche(const Adaptor3d_Curve& C, static void QuasiFleche(const Adaptor3d_Curve& C,
const Standard_Real Deflection2, const Standard_Real Deflection2,
const Standard_Real Udeb, const Standard_Real Udeb,
const gp_Pnt& Pdeb, const gp_Pnt& Pdeb,
@ -2603,8 +2667,10 @@ static void QuasiFleche(const Adaptor3d_Curve& C,
Standard_Real N2 = Vdelta.SquareMagnitude(); Standard_Real N2 = Vdelta.SquareMagnitude();
if (N1 > Eps && N2 > Eps) { if (N1 > Eps && N2 > Eps) {
Standard_Real Normediff = Standard_Real Normediff =
(Vdeb.Normalized().XYZ()-Vdelta.Normalized().XYZ()).SquareModulus(); (Vdeb.Normalized().XYZ()-Vdelta.Normalized().XYZ()).SquareModulus();
if (Normediff > Eps) { if (Normediff > Eps) {
theFleche = Normediff*Norme/64.; theFleche = Normediff*Norme/64.;
flecheok = Standard_True; flecheok = Standard_True;
} }
@ -2622,6 +2688,7 @@ static void QuasiFleche(const Adaptor3d_Curve& C,
} }
else { else {
QuasiFleche(C,Deflection2,Udeb,Pdeb, QuasiFleche(C,Deflection2,Udeb,Pdeb,
Vdeb, Vdeb,
Udeb+Udelta,Pdelta, Udeb+Udelta,Pdelta,
Vdelta, Vdelta,
@ -2633,6 +2700,7 @@ static void QuasiFleche(const Adaptor3d_Curve& C,
if (Nbmin > 2) { if (Nbmin > 2) {
QuasiFleche(C,Deflection2,Udeb+Udelta,Pdelta, QuasiFleche(C,Deflection2,Udeb+Udelta,Pdelta,
Vdelta, Vdelta,
Ufin,Pfin, Ufin,Pfin,
Vfin, Vfin,

View File

@ -31,13 +31,17 @@
#include <Precision.hxx> #include <Precision.hxx>
#include <IntRes2d_IntersectionPoint.hxx> #include <IntRes2d_IntersectionPoint.hxx>
#include <IntRes2d_IntersectionSegment.hxx> #include <IntRes2d_IntersectionSegment.hxx>
#include <ElCLib.hxx>
#include <StdFail_NotDone.hxx> #include <StdFail_NotDone.hxx>
#ifdef OCCT_DEBUG
//#define DRAW
#ifdef DRAW #ifdef DRAW
#include <DrawTrSurf.hxx> #include <DrawTrSurf.hxx>
#include <DBRep.hxx> #include <DBRep.hxx>
static Standard_Boolean Affich = Standard_False; static Standard_Boolean Affich = Standard_False;
static Standard_Boolean AffichInt = Standard_False;
static Standard_Integer intind = 0;
#endif
#endif #endif
@ -83,18 +87,18 @@ BRepFill_TrimEdgeTool::BRepFill_TrimEdgeTool()
//======================================================================= //=======================================================================
BRepFill_TrimEdgeTool::BRepFill_TrimEdgeTool BRepFill_TrimEdgeTool::BRepFill_TrimEdgeTool
(const Bisector_Bisec& Bisec, (const Bisector_Bisec& Bisec,
const Handle(Geom2d_Geometry)& S1, const Handle(Geom2d_Geometry)& S1,
const Handle(Geom2d_Geometry)& S2, const Handle(Geom2d_Geometry)& S2,
const Standard_Real Offset) : const Standard_Real Offset) :
myOffset(Offset), myOffset(Offset),
myBisec(Bisec) myBisec(Bisec)
{ {
isPoint1 = (S1->DynamicType() == STANDARD_TYPE(Geom2d_CartesianPoint)); isPoint1 = (S1->DynamicType() == STANDARD_TYPE(Geom2d_CartesianPoint));
isPoint2 = (S2->DynamicType() == STANDARD_TYPE(Geom2d_CartesianPoint)); isPoint2 = (S2->DynamicType() == STANDARD_TYPE(Geom2d_CartesianPoint));
// return geometries of shapes. // return geometries of shapes.
// Standard_Real f,l; // Standard_Real f,l;
if (isPoint1) { if (isPoint1) {
myP1 = Handle(Geom2d_Point)::DownCast(S1)->Pnt2d(); myP1 = Handle(Geom2d_Point)::DownCast(S1)->Pnt2d();
} }
@ -102,10 +106,10 @@ myBisec(Bisec)
myC1 = Handle(Geom2d_Curve)::DownCast(S1); myC1 = Handle(Geom2d_Curve)::DownCast(S1);
#ifdef DRAW #ifdef DRAW
if ( Affich) { if ( Affich) {
//POP pour NT //POP pour NT
char* myC1name = "myC1"; char* myC1name = "myC1";
DrawTrSurf::Set(myC1name,myC1); DrawTrSurf::Set(myC1name,myC1);
// DrawTrSurf::Set("myC1",myC1); // DrawTrSurf::Set("myC1",myC1);
} }
#endif #endif
} }
@ -118,7 +122,7 @@ myBisec(Bisec)
if ( Affich) { if ( Affich) {
char* myC2name = "myC2"; char* myC2name = "myC2";
DrawTrSurf::Set(myC2name,myC2); DrawTrSurf::Set(myC2name,myC2);
// DrawTrSurf::Set("myC2",myC2); // DrawTrSurf::Set("myC2",myC2);
} }
#endif #endif
} }
@ -169,7 +173,7 @@ static void EvalParameters(const Geom2dAdaptor_Curve& Bis,
{ {
Geom2dInt_GInter Intersector; Geom2dInt_GInter Intersector;
Standard_Real Tol = Precision::Confusion(); Standard_Real Tol = Precision::Confusion();
// Standard_Real TolC = 1.e-9; // Standard_Real TolC = 1.e-9;
Geom2dAdaptor_Curve CBis(Bis); Geom2dAdaptor_Curve CBis(Bis);
Geom2dAdaptor_Curve CAC (AC); Geom2dAdaptor_Curve CAC (AC);
@ -318,23 +322,24 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
Geom2dAdaptor_Curve AC2(C2,f,l); Geom2dAdaptor_Curve AC2(C2,f,l);
#ifdef DRAW #ifdef DRAW
if ( Affich) { if ( AffichInt) {
f = AC1.FirstParameter(); f = AC1.FirstParameter();
l = AC1.LastParameter(); l = AC1.LastParameter();
char* CURVE1name = "CURVE1"; char name[32];
DrawTrSurf::Set(CURVE1name, new Geom2d_TrimmedCurve(C1,f,l)); sprintf(name,"C1_%d", ++intind);
DrawTrSurf::Set(name, new Geom2d_TrimmedCurve(C1,f,l));
f = AC2.FirstParameter(); f = AC2.FirstParameter();
l = AC2.LastParameter(); l = AC2.LastParameter();
char* CURVE2name = "CURVE2"; sprintf(name,"C2_%d", intind);
DrawTrSurf::Set(CURVE2name, new Geom2d_TrimmedCurve(C2,f,l)); DrawTrSurf::Set(name, new Geom2d_TrimmedCurve(C2,f,l));
f = myBis.FirstParameter(); f = myBis.FirstParameter();
l = myBis.LastParameter(); l = myBis.LastParameter();
char* bisname = "BIS"; sprintf(name,"BIS%d", intind);
DrawTrSurf::Set(bisname, new Geom2d_TrimmedCurve(myBis.Curve(),f,l)); DrawTrSurf::Set(name, new Geom2d_TrimmedCurve(myBis.Curve(),f,l));
char* Edge1name = "E1"; sprintf(name,"E1_%d", intind);
DBRep::Set(Edge1name, Edge1); DBRep::Set(name, Edge1);
char* Edge2name = "E2"; sprintf(name,"E2_%d", intind);
DBRep::Set(Edge2name, Edge2); DBRep::Set(name, Edge2);
} }
#endif #endif
@ -347,6 +352,7 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
EvalParameters (myBis,AC2,Points2); EvalParameters (myBis,AC2,Points2);
Standard_Integer SeanceDeRattrapage=0; Standard_Integer SeanceDeRattrapage=0;
Standard_Real TolInit= 1.e-9; Standard_Real TolInit= 1.e-9;
Standard_Integer nn = 7; Standard_Integer nn = 7;
@ -358,6 +364,63 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
nn = 6; nn = 6;
} }
if(Params.IsEmpty() && Points2.IsEmpty())
{
//Check, may be there are no intersections at all
// for case myBis == Line
if(myBis.GetType() == GeomAbs_Line)
{
Standard_Real dmax = TolInit;
Standard_Integer n = 0;
while(n < nn)
{
dmax *= 10.0;
++n;
}
dmax *= dmax;
//
gp_Lin2d anL = myBis.Line();
Standard_Boolean isFar1 = Standard_True;
Standard_Boolean isFar2 = Standard_True;
gp_Pnt2d aP;
//
Standard_Real d = RealLast();
AC1.D0(AC1.FirstParameter(), aP);
Standard_Real par = ElCLib::Parameter(anL, aP);
if(par >= myBis.FirstParameter() && par <= myBis.LastParameter())
{
d = anL.SquareDistance(aP);
}
AC1.D0(AC1.LastParameter(), aP);
par = ElCLib::Parameter(anL, aP);
if(par >= myBis.FirstParameter() && par <= myBis.LastParameter())
{
d = Min(anL.SquareDistance(aP), d);
}
isFar1 = d > dmax;
//
d = RealLast();
AC2.D0(AC2.FirstParameter(), aP);
par = ElCLib::Parameter(anL, aP);
if(par >= myBis.FirstParameter() && par <= myBis.LastParameter())
{
d = anL.SquareDistance(aP);
}
AC2.D0(AC2.LastParameter(), aP);
par = ElCLib::Parameter(anL, aP);
if(par >= myBis.FirstParameter() && par <= myBis.LastParameter())
{
d = Min(anL.SquareDistance(aP), d);
}
isFar2 = d > dmax;
//
if(isFar1 && isFar2)
{
return;
}
}
}
while ( SeanceDeRattrapage < nn // TolInit <= 0.01 while ( SeanceDeRattrapage < nn // TolInit <= 0.01
&& ( Points2.Length() != Params.Length() || && ( Points2.Length() != Params.Length() ||
(Points2.Length() == 0 && Params.Length() == 0) ) ) { (Points2.Length() == 0 && Params.Length() == 0) ) ) {
@ -387,7 +450,7 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
if(Params.Length() == 0 && Points2.Length() == 1) { if(Params.Length() == 0 && Points2.Length() == 1) {
//cout << "Params.Length() == 0 && Points2.Length() == 1" << endl; //cout << "Params.Length() == 0 && Points2.Length() == 1" << endl;
Standard_Real dmin; Standard_Real dmin, dmax = 0.25*myOffset*myOffset;
Standard_Real tBis = Points2(1).X(); Standard_Real tBis = Points2(1).X();
gp_Pnt2d PBis = myBis.Value(tBis); gp_Pnt2d PBis = myBis.Value(tBis);
@ -395,19 +458,26 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
gp_Pnt2d PC = AC1.Value(t); gp_Pnt2d PC = AC1.Value(t);
dmin = PC.SquareDistance(PBis); dmin = PC.SquareDistance(PBis);
gp_Pnt P(tBis, t, 0.); gp_Pnt P(tBis, t, 0.);
if(dmin < dmax)
{
Params.Append(P); Params.Append(P);
}
t = AC1.LastParameter(); t = AC1.LastParameter();
PC = AC1.Value(t); PC = AC1.Value(t);
if(dmin > PC.SquareDistance(PBis)) { Standard_Real dmin1 = PC.SquareDistance(PBis);
if(dmin > dmin1 && dmin1 < dmax ) {
P.SetY(t); P.SetY(t);
if(Params.IsEmpty())
Params.Append(P);
else
Params.SetValue(1,P); Params.SetValue(1,P);
} }
} }
else if(Params.Length() == 1 && Points2.Length() == 0) { else if(Params.Length() == 1 && Points2.Length() == 0) {
//cout << "Params.Length() == 1 && Points2.Length() == 0" << endl; //cout << "Params.Length() == 1 && Points2.Length() == 0" << endl;
Standard_Real dmin; Standard_Real dmin, dmax = 0.25*myOffset*myOffset;
Standard_Real tBis = Params(1).X(); Standard_Real tBis = Params(1).X();
gp_Pnt2d PBis = myBis.Value(tBis); gp_Pnt2d PBis = myBis.Value(tBis);
@ -415,12 +485,19 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
gp_Pnt2d PC = AC2.Value(t); gp_Pnt2d PC = AC2.Value(t);
dmin = PC.SquareDistance(PBis); dmin = PC.SquareDistance(PBis);
gp_Pnt P(tBis, t, 0.); gp_Pnt P(tBis, t, 0.);
if(dmin < dmax)
{
Points2.Append(P); Points2.Append(P);
}
t = AC2.LastParameter(); t = AC2.LastParameter();
PC = AC2.Value(t); PC = AC2.Value(t);
if(dmin > PC.SquareDistance(PBis)) { Standard_Real dmin1 = PC.SquareDistance(PBis);
if(dmin > dmin1 && dmin1 < dmax ) {
P.SetY(t); P.SetY(t);
if(Points2.IsEmpty())
Points2.Append(P);
else
Points2.SetValue(1,P); Points2.SetValue(1,P);
} }
} }
@ -495,7 +572,7 @@ void BRepFill_TrimEdgeTool::AddOrConfuse(const Standard_Boolean Start,
const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge1,
const TopoDS_Edge& Edge2, const TopoDS_Edge& Edge2,
TColgp_SequenceOfPnt& Params) TColgp_SequenceOfPnt& Params)
const const
{ {
Standard_Boolean ToProj = Standard_True; Standard_Boolean ToProj = Standard_True;
gp_Pnt2d PBis; gp_Pnt2d PBis;
@ -581,10 +658,10 @@ const
Standard_Boolean BRepFill_TrimEdgeTool::IsInside(const gp_Pnt2d& P) const Standard_Boolean BRepFill_TrimEdgeTool::IsInside(const gp_Pnt2d& P) const
{ {
// Modified by Sergey KHROMOV - Fri Sep 27 11:43:12 2002 Begin // Modified by Sergey KHROMOV - Fri Sep 27 11:43:12 2002 Begin
// Standard_Real Dist; // Standard_Real Dist;
Standard_Real Dist = RealLast(); Standard_Real Dist = RealLast();
// Modified by Sergey KHROMOV - Fri Sep 27 11:43:12 2002 End // Modified by Sergey KHROMOV - Fri Sep 27 11:43:12 2002 End
if (isPoint1) if (isPoint1)
Dist = P.Distance(myP1); Dist = P.Distance(myP1);
else if (isPoint2) else if (isPoint2)
@ -594,26 +671,26 @@ Standard_Boolean BRepFill_TrimEdgeTool::IsInside(const gp_Pnt2d& P) const
if (Projector.NbPoints() > 0) { if (Projector.NbPoints() > 0) {
Dist = Projector.LowerDistance(); Dist = Projector.LowerDistance();
} }
// Modified by Sergey KHROMOV - Fri Sep 27 11:43:43 2002 Begin // Modified by Sergey KHROMOV - Fri Sep 27 11:43:43 2002 Begin
// else { // else {
// gp_Pnt2d PF = myC1->Value(myC1->FirstParameter()); // gp_Pnt2d PF = myC1->Value(myC1->FirstParameter());
// gp_Pnt2d PL = myC1->Value(myC1->LastParameter()); // gp_Pnt2d PL = myC1->Value(myC1->LastParameter());
// Dist = Min (P.Distance(PF),P.Distance(PL)); // Dist = Min (P.Distance(PF),P.Distance(PL));
// } // }
// Check of distances between P and first and last point of the first curve // Check of distances between P and first and last point of the first curve
// should be performed in any case, despite of the results of projection. // should be performed in any case, despite of the results of projection.
gp_Pnt2d PF = myC1->Value(myC1->FirstParameter()); gp_Pnt2d PF = myC1->Value(myC1->FirstParameter());
gp_Pnt2d PL = myC1->Value(myC1->LastParameter()); gp_Pnt2d PL = myC1->Value(myC1->LastParameter());
Standard_Real aDistMin = Min (P.Distance(PF),P.Distance(PL)); Standard_Real aDistMin = Min (P.Distance(PF),P.Distance(PL));
if (Dist > aDistMin) if (Dist > aDistMin)
Dist = aDistMin; Dist = aDistMin;
// Modified by Sergey KHROMOV - Fri Sep 27 11:43:44 2002 End // Modified by Sergey KHROMOV - Fri Sep 27 11:43:44 2002 End
} }
// return (Dist < Abs(myOffset); // return (Dist < Abs(myOffset);
// return (Dist < Abs(myOffset) + Precision::Confusion()); // return (Dist < Abs(myOffset) + Precision::Confusion());
return (Dist < Abs(myOffset) - Precision::Confusion()); return (Dist < Abs(myOffset) - Precision::Confusion());
} }

View File

@ -780,7 +780,13 @@ static void SetEdgeTol(const TopoDS_Edge& E,
gp_Pnt Pc3d = HC->Value(u); gp_Pnt Pc3d = HC->Value(u);
gp_Pnt2d p2d = pc->Value(u); gp_Pnt2d p2d = pc->Value(u);
gp_Pnt Pcons = ElSLib::Value(p2d.X(),p2d.Y(),pln); gp_Pnt Pcons = ElSLib::Value(p2d.X(),p2d.Y(),pln);
Standard_Real eps = Max(Pc3d.XYZ().SquareModulus(), Pcons.XYZ().SquareModulus());
eps = Epsilon(eps);
Standard_Real temp = Pc3d.SquareDistance(Pcons); Standard_Real temp = Pc3d.SquareDistance(Pcons);
if(temp <= eps)
{
temp = 0.;
}
if(temp > d2) d2 = temp; if(temp > d2) d2 = temp;
} }
d2 = 1.5*sqrt(d2); d2 = 1.5*sqrt(d2);

View File

@ -19,7 +19,7 @@
#include <Precision.hxx> #include <Precision.hxx>
#include <math_Matrix.hxx> #include <math_Matrix.hxx>
#include <math_Vector.hxx> #include <math_Vector.hxx>
#include <math_Gauss.hxx> #include <math_Jacobi.hxx>
#include <gp_Lin.hxx> #include <gp_Lin.hxx>
#include <gp_Circ.hxx> #include <gp_Circ.hxx>
@ -45,6 +45,8 @@
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx> #include <TopoDS_Wire.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <BRep_Builder.hxx>
#include <BRepTopAdaptor_FClass2d.hxx>
#include <GeomLib.hxx> #include <GeomLib.hxx>
#include <Geom2d_Curve.hxx> #include <Geom2d_Curve.hxx>
@ -331,27 +333,15 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
continue; continue;
else else
{ {
const Standard_Integer aNbPolMax = 200;
Standard_Integer incr = 1;
if(iNbPol > aNbPolMax)
{
Standard_Integer nb = iNbPol;
while(nb > aNbPolMax)
{
incr++;
nb = (iNbPol-1) / incr;
}
}
Handle(TColgp_HArray1OfPnt) aPoles = new (TColgp_HArray1OfPnt) (1, iNbPol); Handle(TColgp_HArray1OfPnt) aPoles = new (TColgp_HArray1OfPnt) (1, iNbPol);
GC->Poles(aPoles->ChangeArray1()); GC->Poles(aPoles->ChangeArray1());
gp_Pnt aPolePrev = aPoles->Value(1), aPoleNext; gp_Pnt aPolePrev = aPoles->Value(1), aPoleNext;
Standard_Real dfDistPrev = 0., dfDistNext; Standard_Real dfDistPrev = 0., dfDistNext;
Standard_Integer iPol; for (Standard_Integer iPol=1; iPol<=iNbPol; iPol++)
for (iPol = 1; iPol <= iNbPol; iPol += incr)
{ {
if (iPol <= iNbPol - incr) if (iPol<iNbPol)
{ {
aPoleNext = aPoles->Value(iPol+incr); aPoleNext = aPoles->Value(iPol+1);
dfDistNext = aPolePrev.Distance(aPoleNext); dfDistNext = aPolePrev.Distance(aPoleNext);
} }
else else
@ -436,50 +426,115 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
aMat(1,1)+=w*p.X()*p.X(); aMat(1,1)+=w*p.X()*p.X();
aMat(1,2)+=w*p.X()*p.Y(); aMat(1,2)+=w*p.X()*p.Y();
aMat(1,3)+=w*p.X()*p.Z(); aMat(1,3)+=w*p.X()*p.Z();
aMat(2,1)+=w*p.Y()*p.X(); //
aMat(2,2)+=w*p.Y()*p.Y(); aMat(2,2)+=w*p.Y()*p.Y();
aMat(2,3)+=w*p.Y()*p.Z(); aMat(2,3)+=w*p.Y()*p.Z();
aMat(3,1)+=w*p.Z()*p.X(); //
aMat(3,2)+=w*p.Z()*p.Y();
aMat(3,3)+=w*p.Z()*p.Z(); aMat(3,3)+=w*p.Z()*p.Z();
aVec(1) -= w*p.X(); }
aVec(2) -= w*p.Y(); aMat(2,1) = aMat(1,2);
aVec(3) -= w*p.Z(); aMat(3,1) = aMat(1,3);
aMat(3,2) = aMat(2,3);
//
math_Jacobi anEignval(aMat);
math_Vector anEVals(1,3);
Standard_Boolean isSolved = anEignval.IsDone();
Standard_Integer isol = 0;
if(isSolved)
{
anEVals = anEignval.Values();
//We need vector with eigenvalue ~ 0.
Standard_Real anEMin = RealLast();
Standard_Real anEMax = -anEMin;
for(i = 1; i <= 3; ++i)
{
Standard_Real anE = Abs(anEVals(i));
if(anEMin > anE)
{
anEMin = anE;
isol = i;
}
if(anEMax < anE)
{
anEMax = anE;
}
}
if(isol == 0)
{
isSolved = Standard_False;
}
else
{
Standard_Real eps = Epsilon(anEMax);
if(anEMin <= eps)
{
anEignval.Vector(isol, aVec);
}
else
{
//try using vector product of other axes
Standard_Integer ind[2] = {0,0};
for(i = 1; i <= 3; ++i)
{
if(i == isol)
{
continue;
}
if(ind[0] == 0)
{
ind[0] = i;
continue;
}
if(ind[1] == 0)
{
ind[1] = i;
continue;
}
}
math_Vector aVec1(1, 3, 0.), aVec2(1, 3, 0.);
anEignval.Vector(ind[0], aVec1);
anEignval.Vector(ind[1], aVec2);
gp_Vec aV1(aVec1(1), aVec1(2), aVec1(3));
gp_Vec aV2(aVec2(1), aVec2(2), aVec2(3));
gp_Vec aN = aV1^ aV2;
aVec(1) = aN.X();
aVec(2) = aN.Y();
aVec(3) = aN.Z();
}
if (aVec.Norm2() < gp::Resolution()) {
isSolved = Standard_False;
}
}
} }
// Solve the system of equations to get plane coefficients
math_Gauss aSolver(aMat);
Standard_Boolean isSolved = aSolver.IsDone();
// //
// let us be more tolerant (occ415) // let us be more tolerant (occ415)
Standard_Real dfDist = RealLast(); Standard_Real dfDist = RealLast();
Handle(Geom_Plane) aPlane; Handle(Geom_Plane) aPlane;
// //
if (isSolved) { if (isSolved) {
aSolver.Solve(aVec); //Plane normal can have two directions, direction is chosen
if (aVec.Norm2()<gp::Resolution()) { //according to direction of eigenvector
isSolved = Standard_False; gp_Vec anN(aVec(1), aVec(2), aVec(3));
} aPlane = new Geom_Plane(aBaryCenter,anN);
}
//
if (isSolved) {
aPlane = new Geom_Plane(aBaryCenter,gp_Dir(aVec(1),aVec(2),aVec(3)));
dfDist = Controle (aPoints, aPlane); dfDist = Controle (aPoints, aPlane);
} }
// //
if (!isSolved || myTolerance < dfDist) { if (!isSolved || myTolerance < dfDist) {
gp_Pnt aFirstPnt=aPoints(1); gp_Pnt aFirstPnt=aPoints(1);
for (iPoint=2; iPoint<=aPoints.Length(); iPoint++) { for (iPoint=2; iPoint<=aPoints.Length(); iPoint++) {
const gp_Pnt& aNextPnt = aPoints(iPoint); gp_Vec aDir(aFirstPnt,aPoints(iPoint));
gp_Vec aDir(aFirstPnt, aNextPnt);
Standard_Real dfSide=aDir.Magnitude(); Standard_Real dfSide=aDir.Magnitude();
if (dfSide<myTolerance) { if (dfSide<myTolerance) {
continue; // degeneration continue; // degeneration
} }
for (Standard_Integer iP1=iPoint+1; iP1<=aPoints.Length(); iP1++) { for (Standard_Integer iP1=iPoint+1; iP1<=aPoints.Length(); iP1++) {
gp_Vec aCross = gp_Vec(aFirstPnt,aPoints(iP1)) ^ aDir ; gp_Vec aCross = gp_Vec(aFirstPnt,aPoints(iP1)) ^ aDir ;
if (aCross.Magnitude() > dfSide*myTolerance) { if (aCross.Magnitude() > dfSide*myTolerance) {
Handle(Geom_Plane) aPlane2 = new Geom_Plane(aFirstPnt, aCross); Handle(Geom_Plane) aPlane2 = new Geom_Plane(aBaryCenter, aCross);
Standard_Real dfDist2 = Controle (aPoints, aPlane2); Standard_Real dfDist2 = Controle (aPoints, aPlane2);
if (dfDist2 < myTolerance) { if (dfDist2 < myTolerance) {
myTolReached = dfDist2; myTolReached = dfDist2;
@ -504,6 +559,23 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
//myTolReached = dfDist; //myTolReached = dfDist;
//XXt //XXt
mySurface = aPlane; mySurface = aPlane;
//If S is wire, try to orient surface according to orientation of wire.
if(S.ShapeType() == TopAbs_WIRE && S.Closed())
{
//
TopoDS_Wire aW = TopoDS::Wire(S);
TopoDS_Face aTmpFace = BRepLib_MakeFace(mySurface, Precision::Confusion());
BRep_Builder BB;
BB.Add(aTmpFace, aW);
BRepTopAdaptor_FClass2d FClass(aTmpFace, 0.);
if ( FClass.PerformInfinitePoint() == TopAbs_IN )
{
gp_Dir aN = aPlane->Position().Direction();
aN.Reverse();
mySurface = new Geom_Plane(aPlane->Position().Location(), aN);
}
}
} }
//XXf //XXf
myTolReached = dfDist; myTolReached = dfDist;

View File

@ -39,14 +39,27 @@
#include <BRep_Builder.hxx> #include <BRep_Builder.hxx>
#include <BRepLib.hxx> #include <BRepLib.hxx>
#include <TopTools_IndexedDataMapOfShapeShape.hxx> #include <TopTools_IndexedDataMapOfShapeShape.hxx>
#include <GeomAbs_CurveType.hxx>
#include <Geom2d_Circle.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2d_Ellipse.hxx>
#include <Geom2d_Parabola.hxx>
#include <Geom2d_Hyperbola.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <GCE2d_MakeArcOfCircle.hxx>
#include <GCE2d_MakeSegment.hxx>
//
// Modified by Sergey KHROMOV - Thu Dec 5 10:38:14 2002 Begin // Modified by Sergey KHROMOV - Thu Dec 5 10:38:14 2002 Begin
static TopoDS_Edge MakeEdge(const Handle(Geom2d_Curve) &theCurve, static TopoDS_Edge MakeEdge(const Handle(Geom2d_Curve) &theCurve,
const TopoDS_Face &theFace, const TopoDS_Face &theFace,
const TopoDS_Vertex &theVFirst, const TopoDS_Vertex &theVFirst,
const TopoDS_Vertex &theVLast); const TopoDS_Vertex &theVLast);
// Modified by Sergey KHROMOV - Thu Dec 5 10:38:16 2002 End // Modified by Sergey KHROMOV - Thu Dec 5 10:38:16 2002 End
//
static GeomAbs_CurveType GetCurveType(const Handle(Geom2d_Curve)& theC2d);
static void AdjustCurveEnd(Handle(Geom2d_BoundedCurve)& theC2d, const gp_Pnt2d theP,
const Standard_Boolean isFirst);
//
//======================================================================= //=======================================================================
//function : BRepMAT2d_Explorer //function : BRepMAT2d_Explorer
//purpose : //purpose :
@ -79,7 +92,7 @@ void BRepMAT2d_Explorer::Perform(const TopoDS_Face& aFace)
TopoDS_Face F = TopoDS::Face(aFace); TopoDS_Face F = TopoDS::Face(aFace);
F.Orientation(TopAbs_FORWARD); F.Orientation(TopAbs_FORWARD);
TopExp_Explorer Exp (F,TopAbs_WIRE); TopExp_Explorer Exp (F,TopAbs_WIRE);
// Modified by Sergey KHROMOV - Tue Nov 26 16:10:37 2002 Begin // Modified by Sergey KHROMOV - Tue Nov 26 16:10:37 2002 Begin
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(F); Handle(Geom_Surface) aSurf = BRep_Tool::Surface(F);
TopoDS_Face aNewF = BRepBuilderAPI_MakeFace(aSurf, Precision::Confusion()); TopoDS_Face aNewF = BRepBuilderAPI_MakeFace(aSurf, Precision::Confusion());
@ -91,8 +104,8 @@ void BRepMAT2d_Explorer::Perform(const TopoDS_Face& aFace)
BRepLib::BuildCurves3d(aNewF); BRepLib::BuildCurves3d(aNewF);
myModifShapes.Add(aFace, aNewF); myModifShapes.Add(aFace, aNewF);
// CheckConnection(); // CheckConnection();
// Modified by Sergey KHROMOV - Tue Nov 26 16:10:38 2002 End // Modified by Sergey KHROMOV - Tue Nov 26 16:10:38 2002 End
} }
//======================================================================= //=======================================================================
@ -104,40 +117,40 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
const TopoDS_Face& aFace, const TopoDS_Face& aFace,
TopoDS_Face& aNewFace) TopoDS_Face& aNewFace)
{ {
// Modified by Sergey KHROMOV - Tue Nov 26 14:25:46 2002 Begin // Modified by Sergey KHROMOV - Tue Nov 26 14:25:46 2002 Begin
// This method is totally rewroted to include check // This method is totally rewroted to include check
// of connection and creation of a new spine. // of connection and creation of a new spine.
NewContour(); NewContour();
myIsClosed(currentContour) = (Spine.Closed()) ? Standard_True : Standard_False; myIsClosed(currentContour) = (Spine.Closed()) ? Standard_True : Standard_False;
// Modified by skv - Wed Jun 23 12:23:01 2004 Integration Begin // Modified by skv - Wed Jun 23 12:23:01 2004 Integration Begin
// Taking into account side of bisecting loci construction. // Taking into account side of bisecting loci construction.
// TopoDS_Wire aWFwd = TopoDS::Wire(Spine.Oriented(TopAbs_FORWARD)); // TopoDS_Wire aWFwd = TopoDS::Wire(Spine.Oriented(TopAbs_FORWARD));
// BRepTools_WireExplorer anExp(aWFwd, aFace); // BRepTools_WireExplorer anExp(aWFwd, aFace);
BRepTools_WireExplorer anExp(Spine, aFace); BRepTools_WireExplorer anExp(Spine, aFace);
// Modified by skv - Wed Jun 23 12:23:02 2004 Integration End // Modified by skv - Wed Jun 23 12:23:02 2004 Integration End
TopTools_IndexedDataMapOfShapeShape anOldNewE; TopTools_IndexedDataMapOfShapeShape anOldNewE;
if (!anExp.More()) if (!anExp.More())
return; return;
TopoDS_Edge aFirstEdge = anExp.Current(); TopoDS_Edge aFirstEdge = anExp.Current();
TopoDS_Edge aPrevEdge = aFirstEdge;
Standard_Real UFirst,ULast, aD; Standard_Real UFirst,ULast, aD;
Handle(Geom2d_BSplineCurve) BCurve;
Handle(Geom2d_Curve) C2d; Handle(Geom2d_Curve) C2d;
Handle(Geom2d_TrimmedCurve) CT2d; Handle(Geom2d_TrimmedCurve) CT2d;
Handle(Geom2d_TrimmedCurve) aFirstCurve; Handle(Geom2d_TrimmedCurve) aFirstCurve;
gp_Pnt2d aPFirst; gp_Pnt2d aPFirst;
gp_Pnt2d aPLast; gp_Pnt2d aPLast;
gp_Pnt2d aPCurFirst; gp_Pnt2d aPCurFirst;
// Modified by skv - Mon Jul 11 19:00:25 2005 Integration Begin // Modified by skv - Mon Jul 11 19:00:25 2005 Integration Begin
// Set the confusion tolerance in accordance with the further algo // Set the confusion tolerance in accordance with the further algo
// Standard_Real aTolConf = Precision::Confusion(); // Standard_Real aTolConf = Precision::Confusion();
Standard_Real aTolConf = 1.e-8; Standard_Real aTolConf = 1.e-8;
// Modified by skv - Mon Jul 11 19:00:25 2005 Integration End // Modified by skv - Mon Jul 11 19:00:25 2005 Integration End
Standard_Boolean isModif = Standard_False; Standard_Boolean isModif = Standard_False;
// Treatment of the first edge of a wire. // Treatment of the first edge of a wire.
anOldNewE.Add(aFirstEdge, aFirstEdge); anOldNewE.Add(aFirstEdge, aFirstEdge);
C2d = BRep_Tool::CurveOnSurface (aFirstEdge, aFace, UFirst, ULast); C2d = BRep_Tool::CurveOnSurface (aFirstEdge, aFace, UFirst, ULast);
CT2d = new Geom2d_TrimmedCurve(C2d,UFirst,ULast); CT2d = new Geom2d_TrimmedCurve(C2d,UFirst,ULast);
@ -152,7 +165,7 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
aFirstCurve = CT2d; aFirstCurve = CT2d;
anExp.Next(); anExp.Next();
// Treatment of the next edges: // Treatment of the next edges:
for (; anExp.More(); anExp.Next()) { for (; anExp.More(); anExp.Next()) {
TopoDS_Edge anEdge = anExp.Current(); TopoDS_Edge anEdge = anExp.Current();
@ -175,15 +188,16 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
// code should be rewritten. // code should be rewritten.
isModif = Standard_True; isModif = Standard_True;
// //
//modified by NIZNHY-PKV Tue Aug 7 09:14:03 2007f Standard_Integer aNbC = theCurves.Value(currentContour).Length();
//BCurve = Geom2dConvert::CurveToBSplineCurve(CT2d); Handle(Geom2d_BoundedCurve) CPrev =
BCurve=Geom2dConvert::CurveToBSplineCurve(CT2d, Convert_QuasiAngular); Handle(Geom2d_BoundedCurve)::DownCast(theCurves.ChangeValue(currentContour).ChangeValue(aNbC));
//modified by NIZNHY-PKV Tue Aug 7 09:14:07 2007t //
GeomAbs_CurveType TCPrev = GetCurveType(CPrev);
BCurve->SetPole(1, aPLast); GeomAbs_CurveType TCCurr = GetCurveType(CT2d);
CT2d = new Geom2d_TrimmedCurve(BCurve, BCurve->FirstParameter(), //
BCurve->LastParameter()); if(TCCurr <= TCPrev)
{
AdjustCurveEnd(CT2d, aPLast, Standard_True);
// Creation of new edge. // Creation of new edge.
TopoDS_Edge aNewEdge; TopoDS_Edge aNewEdge;
TopoDS_Vertex aVf = TopExp::FirstVertex(anEdge); TopoDS_Vertex aVf = TopExp::FirstVertex(anEdge);
@ -198,9 +212,32 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
anOldNewE.ChangeFromKey(anEdge) = aNewEdge; anOldNewE.ChangeFromKey(anEdge) = aNewEdge;
} }
else
{
gp_Pnt2d aP = CT2d->Value(CT2d->FirstParameter());
AdjustCurveEnd(CPrev, aP, Standard_False);
theCurves.ChangeValue(currentContour).ChangeValue(aNbC) = CPrev;
//Change previous edge
TopoDS_Edge aNewEdge;
TopoDS_Vertex aVf = TopExp::FirstVertex(aPrevEdge);
TopoDS_Vertex aVl = TopExp::LastVertex(aPrevEdge);
if (aPrevEdge.Orientation() == TopAbs_FORWARD)
aNewEdge = MakeEdge(CPrev, aNewFace, aVf, aVl);
else
aNewEdge = MakeEdge(CPrev->Reversed(), aNewFace, aVf, aVl);
aNewEdge.Orientation(aPrevEdge.Orientation());
anOldNewE.ChangeFromKey(aPrevEdge) = aNewEdge;
}
}
aPLast = CT2d->Value(CT2d->LastParameter()); aPLast = CT2d->Value(CT2d->LastParameter());
Add(CT2d); Add(CT2d);
aPrevEdge = anEdge;
} }
// Check of the distance between the first and the last point of wire // Check of the distance between the first and the last point of wire
@ -208,19 +245,19 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
if (myIsClosed(currentContour) && aPLast.Distance(aPFirst) > aTolConf) { if (myIsClosed(currentContour) && aPLast.Distance(aPFirst) > aTolConf) {
isModif = Standard_True; isModif = Standard_True;
//
//modified by NIZNHY-PKV Tue Aug 7 09:20:08 2007f Standard_Integer aNbC = theCurves.Value(currentContour).Length();
//Handle(Geom2d_BSplineCurve) Handle(Geom2d_BoundedCurve) CPrev =
//BCurve = Geom2dConvert::CurveToBSplineCurve(aFirstCurve); Handle(Geom2d_BoundedCurve)::DownCast(theCurves.ChangeValue(currentContour).ChangeValue(aNbC));
BCurve = Geom2dConvert::CurveToBSplineCurve(aFirstCurve, Convert_QuasiAngular); //
//modified by NIZNHY-PKV Tue Aug 7 09:20:11 2007t GeomAbs_CurveType TCPrev = GetCurveType(CPrev);
GeomAbs_CurveType TCCurr = GetCurveType(aFirstCurve);
BCurve->SetPole(1, aPLast); //
aFirstCurve = new Geom2d_TrimmedCurve(BCurve, BCurve->FirstParameter(), if(TCCurr <= TCPrev)
BCurve->LastParameter()); {
AdjustCurveEnd(aFirstCurve, aPLast, Standard_True);
theCurves.ChangeValue(currentContour).ChangeValue(1) = aFirstCurve; theCurves.ChangeValue(currentContour).ChangeValue(1) = aFirstCurve;
// Creation of new edge.
// Creation of new first edge.
TopoDS_Edge aNewEdge; TopoDS_Edge aNewEdge;
TopoDS_Vertex aVf = TopExp::FirstVertex(aFirstEdge); TopoDS_Vertex aVf = TopExp::FirstVertex(aFirstEdge);
TopoDS_Vertex aVl = TopExp::LastVertex(aFirstEdge); TopoDS_Vertex aVl = TopExp::LastVertex(aFirstEdge);
@ -231,8 +268,31 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
aNewEdge = MakeEdge(aFirstCurve->Reversed(), aNewFace, aVf, aVl); aNewEdge = MakeEdge(aFirstCurve->Reversed(), aNewFace, aVf, aVl);
aNewEdge.Orientation(aFirstEdge.Orientation()); aNewEdge.Orientation(aFirstEdge.Orientation());
anOldNewE.ChangeFromKey(aFirstEdge) = aNewEdge; anOldNewE.ChangeFromKey(aFirstEdge) = aNewEdge;
} }
else
{
gp_Pnt2d aP = aFirstCurve->Value(aFirstCurve->FirstParameter());
AdjustCurveEnd(CPrev, aP, Standard_False);
theCurves.ChangeValue(currentContour).ChangeValue(aNbC) = CPrev;
//Change previous edge
TopoDS_Edge aNewEdge;
TopoDS_Vertex aVf = TopExp::FirstVertex(aPrevEdge);
TopoDS_Vertex aVl = TopExp::LastVertex(aPrevEdge);
if (aPrevEdge.Orientation() == TopAbs_FORWARD)
aNewEdge = MakeEdge(CPrev, aNewFace, aVf, aVl);
else
aNewEdge = MakeEdge(CPrev->Reversed(), aNewFace, aVf, aVl);
aNewEdge.Orientation(aPrevEdge.Orientation());
anOldNewE.ChangeFromKey(aPrevEdge) = aNewEdge;
}
}
TopoDS_Wire aNewWire; TopoDS_Wire aNewWire;
BRep_Builder aBuilder; BRep_Builder aBuilder;
@ -263,7 +323,7 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
aNewWire = Spine; aNewWire = Spine;
aBuilder.Add(aNewFace, aNewWire); aBuilder.Add(aNewFace, aNewWire);
// Modified by Sergey KHROMOV - Tue Nov 26 14:25:53 2002 End // Modified by Sergey KHROMOV - Tue Nov 26 14:25:53 2002 End
} }
//======================================================================= //=======================================================================
@ -302,10 +362,10 @@ void BRepMAT2d_Explorer::Clear()
{ {
theCurves.Clear() ; theCurves.Clear() ;
currentContour = 0; currentContour = 0;
// Modified by Sergey KHROMOV - Wed Mar 6 16:07:55 2002 Begin // Modified by Sergey KHROMOV - Wed Mar 6 16:07:55 2002 Begin
myIsClosed.Clear(); myIsClosed.Clear();
myModifShapes.Clear(); myModifShapes.Clear();
// Modified by Sergey KHROMOV - Wed Mar 6 16:07:55 2002 End // Modified by Sergey KHROMOV - Wed Mar 6 16:07:55 2002 End
} }
@ -318,9 +378,9 @@ void BRepMAT2d_Explorer::NewContour()
{ {
TColGeom2d_SequenceOfCurve Contour; TColGeom2d_SequenceOfCurve Contour;
theCurves.Append(Contour); theCurves.Append(Contour);
// Modified by Sergey KHROMOV - Wed Mar 6 16:12:05 2002 Begin // Modified by Sergey KHROMOV - Wed Mar 6 16:12:05 2002 Begin
myIsClosed.Append(Standard_False); myIsClosed.Append(Standard_False);
// Modified by Sergey KHROMOV - Wed Mar 6 16:12:05 2002 End // Modified by Sergey KHROMOV - Wed Mar 6 16:12:05 2002 End
currentContour ++ ; currentContour ++ ;
} }
@ -353,7 +413,7 @@ Standard_Integer BRepMAT2d_Explorer::NumberOfContours() const
Standard_Integer BRepMAT2d_Explorer::NumberOfCurves Standard_Integer BRepMAT2d_Explorer::NumberOfCurves
(const Standard_Integer IndexContour) (const Standard_Integer IndexContour)
const const
{ {
return theCurves.Value(IndexContour).Length(); return theCurves.Value(IndexContour).Length();
} }
@ -421,7 +481,7 @@ TopoDS_Shape BRepMAT2d_Explorer::Shape() const
const TColGeom2d_SequenceOfCurve& BRepMAT2d_Explorer::Contour const TColGeom2d_SequenceOfCurve& BRepMAT2d_Explorer::Contour
(const Standard_Integer IC) (const Standard_Integer IC)
const const
{ {
return theCurves.Value(IC); return theCurves.Value(IC);
} }
@ -498,3 +558,85 @@ TopoDS_Edge MakeEdge(const Handle(Geom2d_Curve) &theCurve,
return aNewEdge; return aNewEdge;
} }
// Modified by Sergey KHROMOV - Wed Mar 6 17:40:14 2002 End // Modified by Sergey KHROMOV - Wed Mar 6 17:40:14 2002 End
//
//=======================================================================
//function : GetCurveType
//purpose : Get curve type.
//=======================================================================
GeomAbs_CurveType GetCurveType(const Handle(Geom2d_Curve)& theC2d)
{
GeomAbs_CurveType aTypeCurve = GeomAbs_OtherCurve;
Handle(Standard_Type) TheType = theC2d->DynamicType();
if ( TheType == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
TheType = (*((Handle(Geom2d_TrimmedCurve)*)&theC2d))->BasisCurve()->DynamicType();
}
if ( TheType == STANDARD_TYPE(Geom2d_Circle)) {
aTypeCurve = GeomAbs_Circle;
}
else if ( TheType ==STANDARD_TYPE(Geom2d_Line)) {
aTypeCurve = GeomAbs_Line;
}
else if ( TheType == STANDARD_TYPE(Geom2d_Ellipse)) {
aTypeCurve = GeomAbs_Ellipse;
}
else if ( TheType == STANDARD_TYPE(Geom2d_Parabola)) {
aTypeCurve = GeomAbs_Parabola;
}
else if ( TheType == STANDARD_TYPE(Geom2d_Hyperbola)) {
aTypeCurve = GeomAbs_Hyperbola;
}
else if ( TheType == STANDARD_TYPE(Geom2d_BezierCurve)) {
aTypeCurve = GeomAbs_BezierCurve;
}
else if ( TheType == STANDARD_TYPE(Geom2d_BSplineCurve)) {
aTypeCurve = GeomAbs_BSplineCurve;
}
else {
aTypeCurve = GeomAbs_OtherCurve;
}
return aTypeCurve;
}
//=======================================================================
//function : AdjustCurveEnd
//purpose :
//=======================================================================
void AdjustCurveEnd(Handle(Geom2d_BoundedCurve)& theC2d, const gp_Pnt2d theP,
const Standard_Boolean isFirst)
{
GeomAbs_CurveType aType = GetCurveType(theC2d);
if(aType == GeomAbs_Line)
{
//create new line
if(isFirst)
{
gp_Pnt2d aP = theC2d->Value(theC2d->LastParameter());
theC2d = GCE2d_MakeSegment(theP, aP);
}
else
{
gp_Pnt2d aP = theC2d->Value(theC2d->FirstParameter());
theC2d = GCE2d_MakeSegment(aP, theP);
}
}
else
{
//Convert to BSpline and adjust first pole
Handle(Geom2d_BSplineCurve) BCurve =
Geom2dConvert::CurveToBSplineCurve(theC2d, Convert_QuasiAngular);
if(isFirst)
{
BCurve->SetPole(1, theP);
theC2d = new Geom2d_TrimmedCurve(BCurve, BCurve->FirstParameter(),
BCurve->LastParameter());
}
else
{
BCurve->SetPole(BCurve->NbPoles(), theP);
theC2d = new Geom2d_TrimmedCurve(BCurve, BCurve->FirstParameter(),
BCurve->LastParameter());
}
}
}

View File

@ -36,6 +36,10 @@
#include <TopoDS_Wire.hxx> #include <TopoDS_Wire.hxx>
#include <StdFail_NotDone.hxx> #include <StdFail_NotDone.hxx>
#ifdef OCCT_DEBUG
#include <BRepTools.hxx>
static Standard_Boolean AffichSpine = Standard_False;
#endif
//======================================================================= //=======================================================================
//function : BRepOffsetAPI_MakeOffset //function : BRepOffsetAPI_MakeOffset
@ -183,8 +187,20 @@ static void BuildDomains(TopoDS_Face& myFace,
StdFail_NotDone::Raise ("BRepOffsetAPI_MakeOffset : Build Domains"); StdFail_NotDone::Raise ("BRepOffsetAPI_MakeOffset : Build Domains");
} }
TopTools_ListOfShape Faces; TopTools_ListOfShape Faces;
#ifdef OCCT_DEBUG
Standard_Integer ns = 0;
#endif
for (; FR.More(); FR.Next()) { for (; FR.More(); FR.Next()) {
Faces.Append(FR.Current()); Faces.Append(FR.Current());
#ifdef OCCT_DEBUG
if(AffichSpine)
{
char name[32];
ns++;
sprintf(name, "FR%d",ns);
BRepTools::Write(FR.Current(), name);
}
#endif
} }
//=========================================== //===========================================

View File

@ -21,6 +21,7 @@
#include <Geom2d_Point.hxx> #include <Geom2d_Point.hxx>
#include <Geom2d_CartesianPoint.hxx> #include <Geom2d_CartesianPoint.hxx>
#include <Geom2d_TrimmedCurve.hxx> #include <Geom2d_TrimmedCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <gp.hxx> #include <gp.hxx>
#include <gp_Pnt2d.hxx> #include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx> #include <gp_Vec2d.hxx>
@ -31,13 +32,19 @@
#include <Bisector_BisecAna.hxx> #include <Bisector_BisecAna.hxx>
#include <Bisector_BisecPC.hxx> #include <Bisector_BisecPC.hxx>
#include <Bisector_BisecCC.hxx> #include <Bisector_BisecCC.hxx>
#include <GCE2d_MakeSegment.hxx>
/* #ifdef OCCT_DEBUG
//#define DRAW
#ifdef DRAW
#include <DrawTrSurf.hxx> #include <DrawTrSurf.hxx>
static char tname[100]; #pragma comment(lib, "TKDraw.lib")
static Standard_CString name = tname ; static char name[100];
static Standard_Integer nbb = 0; static Standard_Integer nbb = 0;
*/ static Standard_Boolean Affich = Standard_False;
#endif
#endif
static Standard_Boolean IsMaxRC (const Handle(Geom2d_Curve)& C, static Standard_Boolean IsMaxRC (const Handle(Geom2d_Curve)& C,
Standard_Real U, Standard_Real U,
@ -88,14 +95,63 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
->BasisCurve()->DynamicType(); ->BasisCurve()->DynamicType();
} }
Handle(Geom2d_Curve) afirstcurve1 = afirstcurve;
Handle(Geom2d_Curve) asecondcurve1 = asecondcurve;
if(Type1 == STANDARD_TYPE(Geom2d_BSplineCurve))
{
Handle(Geom2d_BSplineCurve) aBS;
if(afirstcurve->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
{
aBS = Handle(Geom2d_BSplineCurve)::DownCast(Handle(Geom2d_TrimmedCurve)::DownCast(afirstcurve)
->BasisCurve());
}
else
{
aBS = Handle(Geom2d_BSplineCurve)::DownCast(afirstcurve);
}
if(aBS->Degree() == 1 && aBS->NbPoles() == 2)
{
if(aBS->Pole(1).Distance(aBS->Pole(2)) < 1.e-4)
{
afirstcurve1 = GCE2d_MakeSegment(aBS->Pole(1), aBS->Pole(2));
Type1 = STANDARD_TYPE(Geom2d_Line);
}
}
}
if(Type2 == STANDARD_TYPE(Geom2d_BSplineCurve))
{
Handle(Geom2d_BSplineCurve) aBS;
if(asecondcurve->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
{
aBS = Handle(Geom2d_BSplineCurve)::DownCast(Handle(Geom2d_TrimmedCurve)::DownCast(asecondcurve)
->BasisCurve());
}
else
{
aBS = Handle(Geom2d_BSplineCurve)::DownCast(asecondcurve);
}
if(aBS->Degree() == 1 && aBS->NbPoles() == 2)
{
if(aBS->Pole(1).Distance(aBS->Pole(2)) < 1.e-4)
{
asecondcurve1 = GCE2d_MakeSegment(aBS->Pole(1), aBS->Pole(2));
Type2 = STANDARD_TYPE(Geom2d_Line);
}
}
}
if ( (Type1 == STANDARD_TYPE(Geom2d_Circle) || Type1 == STANDARD_TYPE(Geom2d_Line)) && if ( (Type1 == STANDARD_TYPE(Geom2d_Circle) || Type1 == STANDARD_TYPE(Geom2d_Line)) &&
(Type2 == STANDARD_TYPE(Geom2d_Circle) || Type2 == STANDARD_TYPE(Geom2d_Line)) ) { (Type2 == STANDARD_TYPE(Geom2d_Circle) || Type2 == STANDARD_TYPE(Geom2d_Line)) )
{
//------------------------------------------------------------------ //------------------------------------------------------------------
// Analytic Bissectrice. // Analytic Bissectrice.
//------------------------------------------------------------------ //------------------------------------------------------------------
Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna(); Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna();
BisAna->Perform(afirstcurve , BisAna->Perform(afirstcurve1 ,
asecondcurve , asecondcurve1 ,
apoint , apoint ,
afirstvector , afirstvector ,
asecondvector , asecondvector ,
@ -137,8 +193,8 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
// Bissectrice algo // Bissectrice algo
//------------------------------------------------------------------- //-------------------------------------------------------------------
Handle(Bisector_BisecCC) BisCC = new Bisector_BisecCC(); Handle(Bisector_BisecCC) BisCC = new Bisector_BisecCC();
BisCC -> Perform(asecondcurve, BisCC -> Perform(asecondcurve1,
afirstcurve , afirstcurve1 ,
adirection , adirection ,
adirection , adirection ,
apoint); apoint);
@ -146,18 +202,33 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
if (BisCC -> IsEmpty()) { if (BisCC -> IsEmpty()) {
// bissectrice is empty. a point is projected at the end of the guide curve. // bissectrice is empty. a point is projected at the end of the guide curve.
// Construction of a false bissectrice. // Construction of a false bissectrice.
// modified by NIZHNY-EAP Mon Feb 21 12:00:13 2000 ___BEGIN___ // modified by NIZHNY-EAP Mon Feb 21 12:00:13 2000 ___BEGIN___
gp_Pnt2d aP1 = afirstcurve1->Value(afirstcurve1->LastParameter());
gp_Pnt2d aP2 = asecondcurve1->Value(asecondcurve1->FirstParameter());
gp_Pnt2d aPm(.5*(aP1.XY()+aP2.XY()));
Standard_Real Nx, Ny;
if(aPm.Distance(apoint) > 10.*Precision::Confusion())
{
Nx = apoint.X() - aPm.X();
Ny = apoint.Y() - aPm.Y();
if(adirection < 0)
{
Nx = -Nx;
Ny = -Ny;
}
}
else
{
gp_Dir2d dir1(afirstvector), dir2(asecondvector); gp_Dir2d dir1(afirstvector), dir2(asecondvector);
Standard_Real
Nx = - dir1.X() - dir2.X(), Nx = - dir1.X() - dir2.X(),
Ny = - dir1.Y() - dir2.Y(); Ny = - dir1.Y() - dir2.Y();
if (Abs(Nx) <= gp::Resolution() && Abs(Ny) <= gp::Resolution()) { if (Abs(Nx) <= gp::Resolution() && Abs(Ny) <= gp::Resolution()) {
Nx = - afirstvector.Y(); Nx = -afirstvector.Y();
Ny = afirstvector.X(); Ny = afirstvector.X();
} }
//gp_Dir2d N ( - adirection*afirstvector.Y(), adirection*afirstvector.X()); }
gp_Dir2d N ( adirection*Nx, adirection*Ny); gp_Dir2d N ( adirection*Nx, adirection*Ny);
// modified by NIZHNY-EAP Mon Feb 21 12:00:19 2000 ___END___ // modified by NIZHNY-EAP Mon Feb 21 12:00:19 2000 ___END___
Handle (Geom2d_CartesianPoint) PG = new Geom2d_CartesianPoint(apoint); Handle (Geom2d_CartesianPoint) PG = new Geom2d_CartesianPoint(apoint);
Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N); Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N);
@ -177,9 +248,12 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
} }
} }
} }
UFirst = Max(UFirst, Bis->FirstParameter());
ULast = Min(ULast, Bis->LastParameter());
thebisector = new Geom2d_TrimmedCurve(Bis,UFirst,ULast); thebisector = new Geom2d_TrimmedCurve(Bis,UFirst,ULast);
#ifdef DRAW
/* if(Affich)
{
sprintf( name, "c1_%d", ++nbb ); sprintf( name, "c1_%d", ++nbb );
DrawTrSurf::Set( name, afirstcurve ); DrawTrSurf::Set( name, afirstcurve );
sprintf( name, "c2_%d", nbb ); sprintf( name, "c2_%d", nbb );
@ -188,7 +262,9 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
DrawTrSurf::Set( name, apoint ); DrawTrSurf::Set( name, apoint );
sprintf( name, "b%d", nbb ); sprintf( name, "b%d", nbb );
DrawTrSurf::Set( name, thebisector ); DrawTrSurf::Set( name, thebisector );
*/ }
#endif
} }
//=========================================================================== //===========================================================================
@ -273,7 +349,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
BisPC -> Perform(afirstcurvereverse , BisPC -> Perform(afirstcurvereverse ,
asecondpoint->Pnt2d(), asecondpoint->Pnt2d(),
- adirection ); - adirection );
// Modified by Sergey KHROMOV - Thu Feb 21 16:49:54 2002 Begin // Modified by Sergey KHROMOV - Thu Feb 21 16:49:54 2002 Begin
if (BisPC -> IsEmpty()) { if (BisPC -> IsEmpty()) {
gp_Dir2d dir1(afirstvector), dir2(asecondvector); gp_Dir2d dir1(afirstvector), dir2(asecondvector);
Standard_Real Standard_Real
@ -283,7 +359,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
Nx = - afirstvector.Y(); Nx = - afirstvector.Y();
Ny = afirstvector.X(); Ny = afirstvector.X();
} }
// gp_Dir2d N ( -adirection*afirstvector.Y(), adirection*afirstvector.X()); // gp_Dir2d N ( -adirection*afirstvector.Y(), adirection*afirstvector.X());
gp_Dir2d N ( adirection*Nx, adirection*Ny); gp_Dir2d N ( adirection*Nx, adirection*Ny);
Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N); Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N);
Handle (Geom2d_TrimmedCurve) BisL = new Geom2d_TrimmedCurve(L,0,RC); Handle (Geom2d_TrimmedCurve) BisL = new Geom2d_TrimmedCurve(L,0,RC);
@ -293,7 +369,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
ULast = BisAna->ParameterOfEndPoint(); ULast = BisAna->ParameterOfEndPoint();
Bis = BisAna; Bis = BisAna;
} else { } else {
// Modified by Sergey KHROMOV - Wed Mar 6 17:01:08 2002 End // Modified by Sergey KHROMOV - Wed Mar 6 17:01:08 2002 End
UFirst = BisPC->Parameter(apoint); UFirst = BisPC->Parameter(apoint);
ULast = BisPC->LastParameter(); ULast = BisPC->LastParameter();
if(UFirst >= ULast) if(UFirst >= ULast)
@ -317,18 +393,25 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
} }
} }
} }
if(UFirst < Bis->FirstParameter())
UFirst = Bis->FirstParameter();
if(ULast > Bis->LastParameter())
ULast = Bis->LastParameter();
thebisector = new Geom2d_TrimmedCurve(Bis,UFirst,ULast); thebisector = new Geom2d_TrimmedCurve(Bis,UFirst,ULast);
/* #ifdef DRAW
if(Affich)
{
sprintf( name, "c1_%d", ++nbb ); sprintf( name, "c1_%d", ++nbb );
DrawTrSurf::Set( name, afirstcurve ); DrawTrSurf::Set( name, afirstcurve );
sprintf( name, "c2_%d", nbb ); sprintf( name, "c2_%d", nbb );
DrawTrSurf::Set( name, SecondPnt ); DrawTrSurf::Set( name, asecondpoint->Pnt2d() );
sprintf( name, "p%d", nbb ); sprintf( name, "p%d", nbb );
DrawTrSurf::Set( name, apoint ); DrawTrSurf::Set( name, apoint );
sprintf( name, "b%d", nbb ); sprintf( name, "b%d", nbb );
DrawTrSurf::Set( name, thebisector ); DrawTrSurf::Set( name, thebisector );
*/ }
#endif
} }
//=========================================================================== //===========================================================================
@ -382,7 +465,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint ,
Bis = BisAna; Bis = BisAna;
} }
else { else {
// Standard_Real UPoint = 0.; // Standard_Real UPoint = 0.;
Standard_Boolean IsLine = Standard_False; Standard_Boolean IsLine = Standard_False;
Standard_Real RC = Precision::Infinite(); Standard_Real RC = Precision::Infinite();
@ -413,7 +496,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint ,
BisPC -> Perform(asecondcurve , BisPC -> Perform(asecondcurve ,
afirstpoint->Pnt2d(), afirstpoint->Pnt2d(),
adirection ); adirection );
// Modified by Sergey KHROMOV - Thu Feb 21 16:49:54 2002 Begin // Modified by Sergey KHROMOV - Thu Feb 21 16:49:54 2002 Begin
if (BisPC -> IsEmpty()) { if (BisPC -> IsEmpty()) {
gp_Dir2d dir1(afirstvector), dir2(asecondvector); gp_Dir2d dir1(afirstvector), dir2(asecondvector);
Standard_Real Standard_Real
@ -423,7 +506,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint ,
Nx = - afirstvector.Y(); Nx = - afirstvector.Y();
Ny = afirstvector.X(); Ny = afirstvector.X();
} }
// gp_Dir2d N ( -adirection*afirstvector.Y(), adirection*afirstvector.X()); // gp_Dir2d N ( -adirection*afirstvector.Y(), adirection*afirstvector.X());
gp_Dir2d N ( adirection*Nx, adirection*Ny); gp_Dir2d N ( adirection*Nx, adirection*Ny);
Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N); Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N);
Handle (Geom2d_TrimmedCurve) BisL = new Geom2d_TrimmedCurve(L,0,RC); Handle (Geom2d_TrimmedCurve) BisL = new Geom2d_TrimmedCurve(L,0,RC);
@ -433,7 +516,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint ,
ULast = BisAna->ParameterOfEndPoint(); ULast = BisAna->ParameterOfEndPoint();
Bis = BisAna; Bis = BisAna;
} else { } else {
// Modified by Sergey KHROMOV - Thu Feb 21 16:49:58 2002 End // Modified by Sergey KHROMOV - Thu Feb 21 16:49:58 2002 End
UFirst = BisPC->Parameter(apoint); UFirst = BisPC->Parameter(apoint);
ULast = BisPC->LastParameter(); ULast = BisPC->LastParameter();
if(UFirst >= ULast) if(UFirst >= ULast)
@ -455,18 +538,25 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint ,
} }
} }
} }
UFirst = Max(UFirst, Bis->FirstParameter());
ULast = Min(ULast, Bis->LastParameter());
thebisector = new Geom2d_TrimmedCurve(Bis,UFirst,ULast); thebisector = new Geom2d_TrimmedCurve(Bis,UFirst,ULast);
/* #ifdef DRAW
if(Affich)
{
sprintf( name, "c1_%d", ++nbb ); sprintf( name, "c1_%d", ++nbb );
DrawTrSurf::Set( name, FirstPnt ); DrawTrSurf::Set( name, afirstpoint->Pnt2d() );
sprintf( name, "c2_%d", nbb ); sprintf( name, "c2_%d", nbb );
DrawTrSurf::Set( name, asecondcurve ); DrawTrSurf::Set( name, asecondcurve );
sprintf( name, "p%d", nbb ); sprintf( name, "p%d", nbb );
DrawTrSurf::Set( name, apoint ); DrawTrSurf::Set( name, apoint );
sprintf( name, "b%d", nbb ); sprintf( name, "b%d", nbb );
DrawTrSurf::Set( name, thebisector ); DrawTrSurf::Set( name, thebisector );
*/ }
#endif
} }
//=========================================================================== //===========================================================================
@ -503,7 +593,9 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint ,
Bis->ParameterOfStartPoint(), Bis->ParameterOfStartPoint(),
Bis->ParameterOfEndPoint()); Bis->ParameterOfEndPoint());
/* #ifdef DRAW
if(Affich)
{
sprintf( name, "c1_%d", ++nbb ); sprintf( name, "c1_%d", ++nbb );
DrawTrSurf::Set( name, afirstpoint->Pnt2d() ); DrawTrSurf::Set( name, afirstpoint->Pnt2d() );
sprintf( name, "c2_%d", nbb ); sprintf( name, "c2_%d", nbb );
@ -512,7 +604,8 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint ,
DrawTrSurf::Set( name, apoint ); DrawTrSurf::Set( name, apoint );
sprintf( name, "b%d", nbb ); sprintf( name, "b%d", nbb );
DrawTrSurf::Set( name, thebisector ); DrawTrSurf::Set( name, thebisector );
*/ }
#endif
} }
//============================================================================= //=============================================================================

View File

@ -122,7 +122,6 @@ void Bisector_BisecCC::Perform(const Handle(Geom2d_Curve)& Cu1,
// Calculate first point of the polygon. // Calculate first point of the polygon.
//--------------------------------------------- //---------------------------------------------
Standard_Boolean isProjDone = ProjOnCurve (Origin,curve1, U); Standard_Boolean isProjDone = ProjOnCurve (Origin,curve1, U);
P = ValueByInt (U,UC1,UC2,Dist);
if(!isProjDone) if(!isProjDone)
{ {
@ -130,6 +129,20 @@ void Bisector_BisecCC::Perform(const Handle(Geom2d_Curve)& Cu1,
return; return;
} }
P = ValueByInt (U,UC1,UC2,Dist);
if(Dist < Precision::Confusion())
{
gp_Pnt2d aP1 = curve1->Value(UC1);
gp_Pnt2d aP2 = curve2->Value(UC2);
Standard_Real dp = (aP1.Distance(P)+aP2.Distance(P));
Standard_Real dorig = (aP1.Distance(Origin)+aP2.Distance(Origin));
if(dp < dorig)
{
isEmpty = Standard_True;
return;
}
}
if (Dist < Precision::Infinite()) { if (Dist < Precision::Infinite()) {
//---------------------------------------------------- //----------------------------------------------------
// the parameter of the origin point gives a point // the parameter of the origin point gives a point
@ -619,8 +632,8 @@ gp_Pnt2d Bisector_BisecCC::ValueAndDist (const Standard_Real U,
//--------------------------------------------------------------- //---------------------------------------------------------------
gp_Pnt2d P1; gp_Pnt2d P1;
gp_Vec2d T1; gp_Vec2d T1;
Standard_Real EpsH = 1.E-8; Standard_Real EpsH = 1.E-9;
Standard_Real EpsH100 = 1.E-6; Standard_Real EpsH100 = 1.E-7;
curve1->D1 (U1,P1,T1); curve1->D1 (U1,P1,T1);
gp_Vec2d N1(T1.Y(), - T1.X()); gp_Vec2d N1(T1.Y(), - T1.X());
@ -818,7 +831,7 @@ gp_Pnt2d Bisector_BisecCC::ValueByInt (const Standard_Real U,
} }
} }
/* /*
if (!YaSol) { if (!YaSol) {
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// Construction de la bisectrice point courbe et de la droite passant // Construction de la bisectrice point courbe et de la droite passant
@ -859,7 +872,7 @@ gp_Pnt2d Bisector_BisecCC::ValueByInt (const Standard_Real U,
} }
} }
} }
*/ */
if (YaSol) { if (YaSol) {
Dist = DMin; Dist = DMin;
@ -1294,6 +1307,17 @@ static Standard_Boolean PointByInt(const Handle(Geom2d_Curve)& CA,
// Point found => Test distance curvature + Angular test // Point found => Test distance curvature + Angular test
//--------------------------------------------------------------- //---------------------------------------------------------------
P2 = CB->Value(UOnB); P2 = CB->Value(UOnB);
if(P1.SquareDistance(PSol) < 1.e-32)
{
YaSol = Standard_False;
return YaSol;
}
if(P2.SquareDistance(PSol) < 1.e-32)
{
YaSol = Standard_False;
return YaSol;
}
gp_Dir2d PP1Unit(P1.X() - PSol.X(),P1.Y() - PSol.Y()); gp_Dir2d PP1Unit(P1.X() - PSol.X(),P1.Y() - PSol.Y());
gp_Dir2d PP2Unit(P2.X() - PSol.X(),P2.Y() - PSol.Y()); gp_Dir2d PP2Unit(P2.X() - PSol.X(),P2.Y() - PSol.Y());
@ -1431,8 +1455,8 @@ void Bisector_BisecCC::Dump(const Standard_Integer ,
Indent (Offset); Indent (Offset);
cout <<"Bisector_BisecCC :"<<endl; cout <<"Bisector_BisecCC :"<<endl;
Indent (Offset); Indent (Offset);
// cout <<"Curve1 :"<<curve1<<endl; // cout <<"Curve1 :"<<curve1<<endl;
// cout <<"Curve2 :"<<curve2<<endl; // cout <<"Curve2 :"<<curve2<<endl;
cout <<"Sign1 :"<<sign1<<endl; cout <<"Sign1 :"<<sign1<<endl;
cout <<"Sign2 :"<<sign2<<endl; cout <<"Sign2 :"<<sign2<<endl;

View File

@ -33,12 +33,14 @@
#include <Precision.hxx> #include <Precision.hxx>
#include <math_BissecNewton.hxx> #include <math_BissecNewton.hxx>
#include <ElCLib.hxx> #include <ElCLib.hxx>
#ifdef OCCT_DEBUG
//#define DRAW
#ifdef DRAW #ifdef DRAW
#include <Draw_Appli.hxx> #include <DrawTrSurf.hxx>
#include <DrawTrSurf_Curve2d.hxx> static char name[100];
#include <Draw_Marker2D.hxx>
static Standard_Boolean Affich = Standard_False; static Standard_Boolean Affich = Standard_False;
static Standard_Integer nbint = 0;
#endif
#endif #endif
//=================================================================================== //===================================================================================
@ -285,21 +287,17 @@ void Bisector_Inter::SinglePerform(const Handle(Geom2d_Curve)& CBis1,
#ifdef DRAW #ifdef DRAW
if (Affich) { if (Affich) {
Handle(DrawTrSurf_Curve2d) dr; sprintf( name, "i1_%d", ++nbint);
Draw_Color Couleur = Draw_bleu; DrawTrSurf::Set(name, Bis1);
sprintf( name, "i2_%d", nbint);
dr = new DrawTrSurf_Curve2d(Bis1,Couleur,100); DrawTrSurf::Set(name, Bis2);
dout << dr;
dr = new DrawTrSurf_Curve2d(Bis2,Couleur,100);
dout << dr;
if (IsDone() && !IsEmpty()) { if (IsDone() && !IsEmpty()) {
for (Standard_Integer k = 1; k <= NbPoints(); k++) { for (Standard_Integer k = 1; k <= NbPoints(); k++) {
gp_Pnt2d P = Point(k).Value(); gp_Pnt2d P = Point(k).Value();
Handle(Draw_Marker2D) drp = new Draw_Marker2D(P,Draw_Plus,Draw_vert); sprintf( name, "ip_%d_%d", nbint, k);
dout << drp; DrawTrSurf::Set(name, P);
} }
} }
dout.Flush();
} }
#endif #endif
} }

View File

@ -1738,7 +1738,7 @@ void ChFi3d_ComputeArete(const ChFiDS_CommonPoint& P1,
//purpose : //purpose :
//======================================================================= //=======================================================================
Handle(TopOpeBRepDS_SurfaceCurveInterference) ChFi3d_FilCurveInDS Handle(TopOpeBRepDS_SurfaceCurveInterference) ChFi3d_FilCurveInDS
(const Standard_Integer Icurv, (const Standard_Integer Icurv,
const Standard_Integer Isurf, const Standard_Integer Isurf,
const Handle(Geom2d_Curve)& Pcurv, const Handle(Geom2d_Curve)& Pcurv,
const TopAbs_Orientation Et) const TopAbs_Orientation Et)
@ -1776,7 +1776,7 @@ Standard_EXPORT void ChFi3d_FilCommonPoint(const BRepBlend_Extremity& SP,
ChFiDS_CommonPoint& CP, ChFiDS_CommonPoint& CP,
const Standard_Real Tol) const Standard_Real Tol)
{ {
// BRep_Tool Outil; // BRep_Tool Outil;
Standard_Real Dist, maxtol = Max(Tol,CP.Tolerance()); Standard_Real Dist, maxtol = Max(Tol,CP.Tolerance());
CP.SetPoint(SP.Value()); // One starts with the point and the vector CP.SetPoint(SP.Value()); // One starts with the point and the vector
@ -1986,7 +1986,7 @@ static Standard_Boolean
//==================================================================== //====================================================================
static Standard_Boolean ChFi3d_Contains static Standard_Boolean ChFi3d_Contains
(const TopOpeBRepDS_ListOfInterference& LI, (const TopOpeBRepDS_ListOfInterference& LI,
const Standard_Integer igros, const Standard_Integer igros,
const Standard_Integer ipetit, const Standard_Integer ipetit,
const Standard_Boolean isvertex = Standard_False, const Standard_Boolean isvertex = Standard_False,
@ -2101,7 +2101,7 @@ void ChFi3d_FilDS(const Standard_Integer SolidIndex,
const Standard_Real tol3d, const Standard_Real tol3d,
const Standard_Real tol2d) const Standard_Real tol2d)
{ {
// BRep_Tool Outil; // BRep_Tool Outil;
TopExp_Explorer ex; TopExp_Explorer ex;
Handle(ChFiDS_Spine) spine = CorDat->Spine(); Handle(ChFiDS_Spine) spine = CorDat->Spine();
Standard_Boolean Closed = Standard_False; Standard_Boolean Closed = Standard_False;
@ -2629,14 +2629,14 @@ void ChFi3d_FilDS(const Standard_Integer SolidIndex,
TCurv.ChangeCurve().Nullify(); TCurv.ChangeCurve().Nullify();
Handle(TopOpeBRepDS_Interference) bidinterf; Handle(TopOpeBRepDS_Interference) bidinterf;
TCurv.SetSCI( Interfc1, bidinterf); TCurv.SetSCI( Interfc1, bidinterf);
// bidinterf = TCurv.GetSCI1(); // bidinterf = TCurv.GetSCI1();
// TCurv.SetSCI(bidinterf, Interfc1); // TCurv.SetSCI(bidinterf, Interfc1);
} }
} }
} }
else { else {
// Degene = (Fd->VertexLastOnS1().Point().IsEqual( // Degene = (Fd->VertexLastOnS1().Point().IsEqual(
// Fd->VertexLastOnS2().Point(), 0) ); // Fd->VertexLastOnS2().Point(), 0) );
// eap, Apr 29 2002, occ 293 // eap, Apr 29 2002, occ 293
if (!isInDS2) { if (!isInDS2) {
@ -2974,8 +2974,8 @@ Handle(Geom_Surface) trsfsurf(const Handle(Adaptor3d_HSurface)& HS,
} }
res = new Geom_RectangularTrimmedSurface(res,U1,U2,V1,V2); res = new Geom_RectangularTrimmedSurface(res,U1,U2,V1,V2);
} }
// Handle(GeomAdaptor_HSurface) temp = new GeomAdaptor_HSurface(res,U1,U2,V1,V2); // Handle(GeomAdaptor_HSurface) temp = new GeomAdaptor_HSurface(res,U1,U2,V1,V2);
// dom = new Adaptor3d_TopolTool(temp); // dom = new Adaptor3d_TopolTool(temp);
return res; return res;
} }
//======================================================================= //=======================================================================
@ -3181,7 +3181,7 @@ Standard_Boolean ChFi3d_ComputeCurves(Handle(Adaptor3d_HSurface)& S1,
if(!gs1.IsNull() && !gs2.IsNull()) { if(!gs1.IsNull() && !gs2.IsNull()) {
GeomInt_IntSS inter; GeomInt_IntSS inter;
// Modified by skv - Fri Oct 24 14:24:47 2003 OCC4077 Begin // Modified by skv - Fri Oct 24 14:24:47 2003 OCC4077 Begin
// Standard_Real tolap = 1.e-7;//car l approx de la wline est faite dans [0,1] // Standard_Real tolap = 1.e-7;//car l approx de la wline est faite dans [0,1]
// Set the lowest tolerance which is used in new boolean operations. // Set the lowest tolerance which is used in new boolean operations.
Standard_Real tolap = 2.e-7; Standard_Real tolap = 2.e-7;
// Modified by skv - Fri Oct 24 14:24:48 2003 OCC4077 End // Modified by skv - Fri Oct 24 14:24:48 2003 OCC4077 End
@ -3191,17 +3191,17 @@ Standard_Boolean ChFi3d_ComputeCurves(Handle(Adaptor3d_HSurface)& S1,
#if defined(IRIX) || defined(__sgi) #if defined(IRIX) || defined(__sgi)
if(nbl==0) { if(nbl==0) {
// solution of adjustment for SGI // solution of adjustment for SGI
// if the intersection of gs1 with gs2 doesnot worke // if the intersection of gs1 with gs2 doesnot worke
// then the intersection of gs2 with gs1 is attempted. // then the intersection of gs2 with gs1 is attempted.
inter.Perform(gs2,gs1,tolap,1,1,1); inter.Perform(gs2,gs1,tolap,1,1,1);
// inter.Perform(gs2,dom2,gs1,dom1,tolap,1,1,1); // inter.Perform(gs2,dom2,gs1,dom1,tolap,1,1,1);
if(!inter.IsDone()) return Standard_False; if(!inter.IsDone()) return Standard_False;
nbl = inter.NbLines(); nbl = inter.NbLines();
// if GeomInt does not make the intersection the solution of adjustment // if GeomInt does not make the intersection the solution of adjustment
// is not attempted // is not attempted
if (nbl==0) return Standard_False; if (nbl==0) return Standard_False;
} }
#endif #endif
@ -3307,7 +3307,7 @@ Standard_Boolean ChFi3d_ComputeCurves(Handle(Adaptor3d_HSurface)& S1,
// At this stage : // At this stage :
// classic intersections have failed, the path is approached in vain. // classic intersections have failed, the path is approached in vain.
// Standard_Real Step = 0.1; // Standard_Real Step = 0.1;
for(;;) { for(;;) {
//Attention the parameters of arrow for the path and //Attention the parameters of arrow for the path and
//the tolerance for the approximation can't be taken as those of the //the tolerance for the approximation can't be taken as those of the
@ -3370,7 +3370,7 @@ Standard_Boolean ChFi3d_ComputeCurves(Handle(Adaptor3d_HSurface)& S1,
Standard_Integer indd = 0, indf = 0; Standard_Integer indd = 0, indf = 0;
for(i = 1; i <= nbp; i++) { for(i = 1; i <= nbp; i++) {
dd = L2S->Value(i).Value().Distance(pntd); dd = L2S->Value(i).Value().Distance(pntd);
if(dd < ddeb) { ddeb = dd; indd = i;} if(dd <= ddeb) { ddeb = dd; indd = i;}
dd = L2S->Value(i).Value().Distance(pntf); dd = L2S->Value(i).Value().Distance(pntf);
if(dd < dfin) { dfin = dd; indf = i;} if(dd < dfin) { dfin = dd; indf = i;}
} }
@ -3442,10 +3442,10 @@ Standard_Boolean ChFi3d_ComputeCurves(Handle(Adaptor3d_HSurface)& S1,
Standard_True,Standard_True,Standard_True, Standard_True,Standard_True,Standard_True,
1,nbp); 1,nbp);
if(!approx.IsDone()) return Standard_False; if(!approx.IsDone()) return Standard_False;
// tolreached = approx.TolReached3d(); // tolreached = approx.TolReached3d();
// Standard_Real tolr2d = approx.TolReached2d(); // Standard_Real tolr2d = approx.TolReached2d();
// tolreached = Max(tolreached,ChFi3d_ConvTol2dToTol3d(S1,tolr2d)); // tolreached = Max(tolreached,ChFi3d_ConvTol2dToTol3d(S1,tolr2d));
// tolreached = Max(tolreached,ChFi3d_ConvTol2dToTol3d(S2,tolr2d)); // tolreached = Max(tolreached,ChFi3d_ConvTol2dToTol3d(S2,tolr2d));
const AppParCurves_MultiBSpCurve& mbs = approx.Value(1); const AppParCurves_MultiBSpCurve& mbs = approx.Value(1);
Standard_Integer nbpol = mbs.NbPoles(); Standard_Integer nbpol = mbs.NbPoles();
TColgp_Array1OfPnt pol3d(1,nbpol); TColgp_Array1OfPnt pol3d(1,nbpol);
@ -3459,14 +3459,14 @@ Standard_Boolean ChFi3d_ComputeCurves(Handle(Adaptor3d_HSurface)& S1,
pol3d(1) = pntd; pol3d(1) = pntd;
pol2d1(1).SetCoord(Pardeb(1),Pardeb(2)); pol2d1(1).SetCoord(Pardeb(1),Pardeb(2));
pol2d2(1).SetCoord(Pardeb(3),Pardeb(4)); pol2d2(1).SetCoord(Pardeb(3),Pardeb(4));
// tolreached = Max(tolreached,ddeb); // tolreached = Max(tolreached,ddeb);
} }
if(dfin >= tol2) { if(dfin >= tol2) {
pol3d(nbpol) = pntf; pol3d(nbpol) = pntf;
pol2d1(nbpol).SetCoord(Parfin(1),Parfin(2)); pol2d1(nbpol).SetCoord(Parfin(1),Parfin(2));
pol2d2(nbpol).SetCoord(Parfin(3),Parfin(4)); pol2d2(nbpol).SetCoord(Parfin(3),Parfin(4));
// tolreached = Max(tolreached,dfin); // tolreached = Max(tolreached,dfin);
} }
const TColStd_Array1OfReal& knots = mbs.Knots(); const TColStd_Array1OfReal& knots = mbs.Knots();
const TColStd_Array1OfInteger& mults = mbs.Multiplicities(); const TColStd_Array1OfInteger& mults = mbs.Multiplicities();
@ -3475,6 +3475,8 @@ Standard_Boolean ChFi3d_ComputeCurves(Handle(Adaptor3d_HSurface)& S1,
Pc1 = new Geom2d_BSplineCurve(pol2d1,knots,mults,deg); Pc1 = new Geom2d_BSplineCurve(pol2d1,knots,mults,deg);
Pc2 = new Geom2d_BSplineCurve(pol2d2,knots,mults,deg); Pc2 = new Geom2d_BSplineCurve(pol2d2,knots,mults,deg);
tolreached = ChFi3d_EvalTolReached(S1,Pc1,S2,Pc2,C3d); tolreached = ChFi3d_EvalTolReached(S1,Pc1,S2,Pc2,C3d);
tolreached = Max(tolreached,ddeb);
tolreached = Max(tolreached,dfin);
return Standard_True; return Standard_True;
} }
} }
@ -4434,9 +4436,9 @@ void ChFi3d_cherche_edge(const TopoDS_Vertex & V,
//======================================================================= //=======================================================================
Standard_Integer ChFi3d_nbface (const TopTools_ListOfShape & mapVF ) Standard_Integer ChFi3d_nbface (const TopTools_ListOfShape & mapVF )
{ Standard_Integer nface=0; { Standard_Integer nface=0;
TopTools_ListIteratorOfListOfShape ItF,JtF; TopTools_ListIteratorOfListOfShape ItF,JtF;
Standard_Integer fj = 0; Standard_Integer fj = 0;
for (ItF.Initialize(mapVF); ItF.More(); ItF.Next()) { for (ItF.Initialize(mapVF); ItF.More(); ItF.Next()) {
fj++; fj++;
Standard_Integer kf = 1; Standard_Integer kf = 1;
const TopoDS_Shape& cur = ItF.Value(); const TopoDS_Shape& cur = ItF.Value();
@ -4444,8 +4446,8 @@ Standard_Integer ChFi3d_nbface (const TopTools_ListOfShape & mapVF )
if(cur.IsSame(JtF.Value())) break; if(cur.IsSame(JtF.Value())) break;
} }
if(kf == fj) nface++; if(kf == fj) nface++;
} }
return nface; return nface;
} }
//======================================================================= //=======================================================================
@ -4457,18 +4459,18 @@ void ChFi3d_edge_common_faces (const TopTools_ListOfShape & mapEF,
TopoDS_Face & F1, TopoDS_Face & F1,
TopoDS_Face & F2) TopoDS_Face & F2)
{ TopTools_ListIteratorOfListOfShape It; { TopTools_ListIteratorOfListOfShape It;
TopoDS_Face F; TopoDS_Face F;
Standard_Boolean trouve; Standard_Boolean trouve;
It.Initialize(mapEF); It.Initialize(mapEF);
F1=TopoDS::Face(It.Value()); F1=TopoDS::Face(It.Value());
trouve=Standard_False; trouve=Standard_False;
for(It.Initialize(mapEF);It.More()&&!trouve;It.Next()) { for(It.Initialize(mapEF);It.More()&&!trouve;It.Next()) {
F=TopoDS::Face (It.Value()); F=TopoDS::Face (It.Value());
if (!F.IsSame(F1)) { if (!F.IsSame(F1)) {
F2=F;trouve=Standard_True; F2=F;trouve=Standard_True;
} }
} }
if (!trouve) F2=F1; if (!trouve) F2=F1;
} }
/***********************************************************/ /***********************************************************/
@ -4479,19 +4481,19 @@ Standard_Real ChFi3d_AngleEdge (const TopoDS_Vertex & Vtx,
const TopoDS_Edge& E1, const TopoDS_Edge& E1,
const TopoDS_Edge & E2) const TopoDS_Edge & E2)
{ Standard_Real angle; { Standard_Real angle;
BRepAdaptor_Curve BCurv1(E1); BRepAdaptor_Curve BCurv1(E1);
BRepAdaptor_Curve BCurv2(E2); BRepAdaptor_Curve BCurv2(E2);
Standard_Real parE1,parE2; Standard_Real parE1,parE2;
gp_Vec dir1,dir2 ; gp_Vec dir1,dir2 ;
gp_Pnt P1,P2 ; gp_Pnt P1,P2 ;
parE1=BRep_Tool::Parameter(Vtx,E1); parE1=BRep_Tool::Parameter(Vtx,E1);
parE2=BRep_Tool::Parameter(Vtx,E2); parE2=BRep_Tool::Parameter(Vtx,E2);
BCurv1.D1(parE1,P1,dir1); BCurv1.D1(parE1,P1,dir1);
BCurv2.D1(parE2,P2,dir2); BCurv2.D1(parE2,P2,dir2);
if (!Vtx.IsSame(TopExp::FirstVertex(E1))) dir1.Reverse(); if (!Vtx.IsSame(TopExp::FirstVertex(E1))) dir1.Reverse();
if (!Vtx.IsSame(TopExp::FirstVertex(E2))) dir2.Reverse(); if (!Vtx.IsSame(TopExp::FirstVertex(E2))) dir2.Reverse();
angle=Abs(dir1.Angle(dir2)); angle=Abs(dir1.Angle(dir2));
return angle; return angle;
} }
//================================================================== //==================================================================
@ -4586,24 +4588,24 @@ void ChFi3d_cherche_vertex (const TopoDS_Edge & E1,
TopoDS_Vertex & vertex, TopoDS_Vertex & vertex,
Standard_Boolean & trouve) Standard_Boolean & trouve)
{ Standard_Integer i,j; { Standard_Integer i,j;
TopoDS_Vertex Vcur1,Vcur2; TopoDS_Vertex Vcur1,Vcur2;
trouve=Standard_False; trouve=Standard_False;
TopTools_IndexedMapOfShape MapV1,MapV2; TopTools_IndexedMapOfShape MapV1,MapV2;
TopExp::MapShapes( E1,TopAbs_VERTEX,MapV1); TopExp::MapShapes( E1,TopAbs_VERTEX,MapV1);
TopExp::MapShapes( E2,TopAbs_VERTEX,MapV2); TopExp::MapShapes( E2,TopAbs_VERTEX,MapV2);
for ( i=1; i<= MapV1.Extent()&&!trouve; i++) { for ( i=1; i<= MapV1.Extent()&&!trouve; i++) {
TopoDS_Shape alocalshape = TopoDS_Shape (MapV1(i)); TopoDS_Shape alocalshape = TopoDS_Shape (MapV1(i));
Vcur1=TopoDS::Vertex(alocalshape); Vcur1=TopoDS::Vertex(alocalshape);
// Vcur1=TopoDS::Vertex(TopoDS_Shape (MapV1(i))); // Vcur1=TopoDS::Vertex(TopoDS_Shape (MapV1(i)));
for ( j=1; j<= MapV2.Extent()&&!trouve; j++) { for ( j=1; j<= MapV2.Extent()&&!trouve; j++) {
TopoDS_Shape aLocalShape = TopoDS_Shape (MapV2(j)); TopoDS_Shape aLocalShape = TopoDS_Shape (MapV2(j));
Vcur2=TopoDS::Vertex(aLocalShape); Vcur2=TopoDS::Vertex(aLocalShape);
// Vcur2=TopoDS::Vertex(TopoDS_Shape (MapV2(j))); // Vcur2=TopoDS::Vertex(TopoDS_Shape (MapV2(j)));
if (Vcur2.IsSame(Vcur1)) { if (Vcur2.IsSame(Vcur1)) {
vertex=Vcur1;trouve=Standard_True; vertex=Vcur1;trouve=Standard_True;
} }
} }
} }
} }
//======================================================================= //=======================================================================
//function : ChFi3d_Couture //function : ChFi3d_Couture
@ -4613,20 +4615,20 @@ void ChFi3d_Couture( const TopoDS_Face & F,
Standard_Boolean & couture, Standard_Boolean & couture,
TopoDS_Edge & edgecouture) TopoDS_Edge & edgecouture)
{ TopoDS_Edge Ecur; { TopoDS_Edge Ecur;
couture=Standard_False; couture=Standard_False;
TopTools_IndexedMapOfShape MapE1; TopTools_IndexedMapOfShape MapE1;
TopExp::MapShapes( F,TopAbs_EDGE,MapE1); TopExp::MapShapes( F,TopAbs_EDGE,MapE1);
TopLoc_Location Loc; TopLoc_Location Loc;
Handle(Geom_Surface) Surf =BRep_Tool::Surface(F,Loc); Handle(Geom_Surface) Surf =BRep_Tool::Surface(F,Loc);
for ( Standard_Integer i=1; i<= MapE1.Extent()&&!couture; i++) { for ( Standard_Integer i=1; i<= MapE1.Extent()&&!couture; i++) {
TopoDS_Shape aLocalShape = TopoDS_Shape (MapE1(i)); TopoDS_Shape aLocalShape = TopoDS_Shape (MapE1(i));
Ecur=TopoDS::Edge(aLocalShape); Ecur=TopoDS::Edge(aLocalShape);
// Ecur=TopoDS::Edge(TopoDS_Shape (MapE1(i))); // Ecur=TopoDS::Edge(TopoDS_Shape (MapE1(i)));
if (BRep_Tool::IsClosed(Ecur,Surf,Loc)) { if (BRep_Tool::IsClosed(Ecur,Surf,Loc)) {
couture=Standard_True; couture=Standard_True;
edgecouture=Ecur; edgecouture=Ecur;
} }
} }
} }
//======================================================================= //=======================================================================
@ -4638,15 +4640,15 @@ void ChFi3d_CoutureOnVertex( const TopoDS_Face & F,
Standard_Boolean & couture, Standard_Boolean & couture,
TopoDS_Edge & edgecouture) TopoDS_Edge & edgecouture)
{ TopoDS_Edge Ecur; { TopoDS_Edge Ecur;
couture = Standard_False; couture = Standard_False;
TopTools_IndexedMapOfShape MapE1; TopTools_IndexedMapOfShape MapE1;
TopExp::MapShapes( F,TopAbs_EDGE,MapE1); TopExp::MapShapes( F,TopAbs_EDGE,MapE1);
TopLoc_Location Loc; TopLoc_Location Loc;
Handle(Geom_Surface) Surf = BRep_Tool::Surface(F,Loc); Handle(Geom_Surface) Surf = BRep_Tool::Surface(F,Loc);
for ( Standard_Integer i=1; i <= MapE1.Extent(); i++) { for ( Standard_Integer i=1; i <= MapE1.Extent(); i++) {
TopoDS_Shape aLocalShape = TopoDS_Shape (MapE1(i)); TopoDS_Shape aLocalShape = TopoDS_Shape (MapE1(i));
Ecur=TopoDS::Edge(aLocalShape); Ecur=TopoDS::Edge(aLocalShape);
// Ecur=TopoDS::Edge(TopoDS_Shape (MapE1(i))); // Ecur=TopoDS::Edge(TopoDS_Shape (MapE1(i)));
if (BRep_Tool::IsClosed(Ecur,Surf,Loc)) { if (BRep_Tool::IsClosed(Ecur,Surf,Loc)) {
TopoDS_Vertex Vf, Vl; TopoDS_Vertex Vf, Vl;
TopExp::Vertices( Ecur, Vf, Vl ); TopExp::Vertices( Ecur, Vf, Vl );
@ -4657,7 +4659,7 @@ void ChFi3d_CoutureOnVertex( const TopoDS_Face & F,
break; break;
} }
} }
} }
} }
//======================================================================= //=======================================================================
//function : ChFi3d_IsPseudoSeam //function : ChFi3d_IsPseudoSeam

View File

@ -203,13 +203,14 @@ void IntCurve_ExactIntersectionPoint::MathPerform(void)
,ToleranceVector ,ToleranceVector
,BInfVector ,BInfVector
,BSupVector ,BSupVector
,50); ,60);
if(Fct.IsDone()) { if(Fct.IsDone()) {
Fct.Root(Root); nbroots = 1; Fct.Root(Root); nbroots = 1;
math_Vector XY(1,2); math_Vector XY(1,2);
FctDist.Value(Root,XY); FctDist.Value(Root,XY);
Standard_Real dist2 = ((XY(1)*XY(1)+XY(2)*XY(2))); Standard_Real dist2 = ((XY(1)*XY(1)+XY(2)*XY(2)));
if(dist2 > myTol) if(dist2 > myTol)
{ {
nbroots = 0; nbroots = 0;

View File

@ -45,6 +45,8 @@
#include <math_FunctionSetRoot.hxx> #include <math_FunctionSetRoot.hxx>
#include <math_NewtonFunctionSetRoot.hxx> #include <math_NewtonFunctionSetRoot.hxx>
#include <NCollection_Handle.hxx> #include <NCollection_Handle.hxx>
#include <Bnd_Box2d.hxx>
#include <Precision.hxx>
//====================================================================== //======================================================================
@ -58,7 +60,12 @@
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void GetIntersection(const TheCurve& theC1, const Standard_Real theT1f, const Standard_Real theT1l,
const TheCurve& theC2, const Standard_Real theT2f, const Standard_Real theT2l,
const Standard_Real theTolConf,
const Standard_Integer theMaxCount,
IntRes2d_IntersectionPoint& thePInt, Standard_Real& theDist,
Standard_Integer& theCount);
Standard_Boolean HeadOrEndPoint( const IntRes2d_Domain& D1 Standard_Boolean HeadOrEndPoint( const IntRes2d_Domain& D1
@ -787,10 +794,30 @@ Standard_Boolean IntCurve_IntPolyPolyGen::findIntersect(
//-------------------------------------------------------------------- //--------------------------------------------------------------------
//-- On verifie que le point trouve est bien une racine //-- On verifie que le point trouve est bien une racine
//-------------------------------------------------------------------- //--------------------------------------------------------------------
EIP.Roots(U,V); EIP.Roots(U,V);
TheCurveTool::D1(C1,U,P1,Tan1); TheCurveTool::D1(C1,U,P1,Tan1);
TheCurveTool::D1(C2,V,P2,Tan2); TheCurveTool::D1(C2,V,P2,Tan2);
Standard_Real Dist = P1.Distance(P2); Standard_Real Dist = P1.Distance(P2);
if(EIP.NbRoots() == 0 && Dist > TolConf)
{
IntRes2d_Transition aTrans;
IntRes2d_IntersectionPoint aPInt(P1, U, V, aTrans, aTrans, Standard_False);
Standard_Real aT1f, aT1l, aT2f, aT2l;
aT1f= thePoly1.ApproxParamOnCurve(SegIndex1, 0.0);
aT1l= thePoly1.ApproxParamOnCurve(SegIndex1, 1.0);
aT2f= thePoly2.ApproxParamOnCurve(SegIndex2, 0.0);
aT2l= thePoly2.ApproxParamOnCurve(SegIndex2, 1.0);
//
Standard_Integer aMaxCount = 16, aCount = 0;
GetIntersection(C1, aT1f, aT1l, C2, aT2f, aT2l, TolConf, aMaxCount,
aPInt, Dist, aCount);
U = aPInt.ParamOnFirst();
V = aPInt.ParamOnSecond();
TheCurveTool::D1(C1,U,P1,Tan1);
TheCurveTool::D1(C2,V,P2,Tan2);
Dist = P1.Distance(P2);
}
//----------------------------------------------------------------- //-----------------------------------------------------------------
//-- On verifie que le point (u,v) n existe pas deja //-- On verifie que le point (u,v) n existe pas deja
//-- //--
@ -1031,3 +1058,130 @@ Standard_Boolean IntCurve_IntPolyPolyGen::findIntersect(
return Standard_True; return Standard_True;
} }
//======================================================================
// GetIntersection
//======================================================================
void GetIntersection(const TheCurve& theC1, const Standard_Real theT1f, const Standard_Real theT1l,
const TheCurve& theC2, const Standard_Real theT2f, const Standard_Real theT2l,
const Standard_Real theTolConf,
const Standard_Integer theMaxCount,
IntRes2d_IntersectionPoint& thePInt, Standard_Real& theDist,
Standard_Integer& theCount)
{
theCount++;
//
Standard_Real aTol2 = theTolConf*theTolConf;
Standard_Real aPTol1 = Max(100.*Epsilon(Max(Abs(theT1f), Abs(theT1l))), Precision::PConfusion());
Standard_Real aPTol2 = Max(100.*Epsilon(Max(Abs(theT2f), Abs(theT2l))), Precision::PConfusion());
gp_Pnt2d aP1f, aP1l, aP2f, aP2l;
Bnd_Box2d aB1, aB2;
//
TheCurveTool::D0(theC1, theT1f, aP1f);
TheCurveTool::D0(theC1, theT1l, aP1l);
aB1.Add(aP1f);
aB1.Add(aP1l);
aB1.Enlarge(theTolConf);
//
TheCurveTool::D0(theC2, theT2f, aP2f);
TheCurveTool::D0(theC2, theT2l, aP2l);
aB2.Add(aP2f);
aB2.Add(aP2l);
aB2.Enlarge(theTolConf);
//
if(aB1.IsOut(aB2))
{
theCount--;
return;
}
//
Standard_Boolean isSmall1 = (theT1l - theT1f) <= aPTol1 || aP1f.SquareDistance(aP1l) / 4. <= aTol2;
Standard_Boolean isSmall2 = (theT2l - theT2f) <= aPTol2 || aP2f.SquareDistance(aP2l) / 4. <= aTol2;
if((isSmall1 && isSmall2) || (theCount > theMaxCount))
{
//Seems to be intersection
//Simple treatment of segment intersection
gp_XY aPnts1[3] = {aP1f.XY(), (aP1f.XY() + aP1l.XY()) / 2., aP1l.XY()};
gp_XY aPnts2[3] = {aP2f.XY(), (aP2f.XY() + aP2l.XY()) / 2., aP2l.XY()};
Standard_Integer i, j, imin = -1, jmin = -1;
Standard_Real dmin = RealLast(), d;
for(i = 0; i < 3; i++)
{
for(j = 0; j < 3; j++)
{
d = (aPnts1[i] - aPnts2[j]).SquareModulus();
if(d < dmin)
{
dmin=d;
imin = i;
jmin = j;
}
}
}
//
dmin = Sqrt(dmin);
if(theDist > dmin)
{
theDist = dmin;
//
Standard_Real t1;
if(imin == 0)
{
t1 = theT1f;
}
else if(imin == 1)
{
t1 = (theT1f + theT1l) / 2.;
}
else
{
t1 = theT1l;
}
//
Standard_Real t2;
if(jmin == 0)
{
t2 = theT2f;
}
else if(jmin == 1)
{
t2 = (theT2f + theT2l) / 2.;
}
else
{
t2 = theT2l;
}
//
gp_Pnt2d aPint((aPnts1[imin] + aPnts2[jmin])/2.);
//
IntRes2d_Transition aTrans1, aTrans2;
thePInt.SetValues(aPint, t1, t2, aTrans1, aTrans2, Standard_False);
}
theCount--;
return;
}
if(isSmall1)
{
Standard_Real aT2m = (theT2l + theT2f) / 2.;
GetIntersection(theC1, theT1f, theT1l, theC2, theT2f, aT2m, theTolConf, theMaxCount, thePInt, theDist, theCount);
GetIntersection(theC1, theT1f, theT1l, theC2, aT2m, theT2l, theTolConf, theMaxCount, thePInt, theDist, theCount);
}
else if(isSmall2)
{
Standard_Real aT1m = (theT1l + theT1f) / 2.;
GetIntersection(theC1, theT1f, aT1m, theC2, theT2f, theT2l, theTolConf, theMaxCount, thePInt, theDist, theCount);
GetIntersection(theC1, aT1m, theT1l, theC2, theT2f, theT2l, theTolConf, theMaxCount, thePInt, theDist, theCount);
}
else
{
Standard_Real aT1m = (theT1l + theT1f) / 2.;
Standard_Real aT2m = (theT2l + theT2f) / 2.;
GetIntersection(theC1, theT1f, aT1m, theC2, theT2f, aT2m, theTolConf, theMaxCount, thePInt, theDist, theCount);
GetIntersection(theC1, theT1f, aT1m, theC2, aT2m, theT2l, theTolConf, theMaxCount, thePInt, theDist, theCount);
GetIntersection(theC1, aT1m, theT1l, theC2, theT2f, aT2m, theTolConf, theMaxCount, thePInt, theDist, theCount);
GetIntersection(theC1, aT1m, theT1l, theC2, aT2m, theT2l, theTolConf, theMaxCount, thePInt, theDist, theCount);
}
}

View File

@ -830,10 +830,14 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
Standard_Integer parama[2]; Standard_Integer parama[2];
Standard_Integer paramb[2]; Standard_Integer paramb[2];
//
Standard_Integer aNbOfNarea1 = 0, aPrefNarea = 0, aNbMaxNarea1 = 10;
Standard_Integer aNbElts[2] = {0, 0}, aCountElts[2] = {0, 0};
Standard_Boolean isBreak = Standard_False;
// ----------------------------------------- // -----------------------------------------
// Initialisation et remise a zero des maps. // Initialisation et remise a zero des maps.
// ----------------------------------------- // -----------------------------------------
bisectoronetoremove.Clear(); bisectoronetoremove.Clear();
bisectortwotoremove.Clear(); bisectortwotoremove.Clear();
typeofbisectortoremove.Clear(); typeofbisectortoremove.Clear();
@ -843,10 +847,10 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
noofbisectors = noofedges; noofbisectors = noofedges;
beginbisector = 0; beginbisector = 0;
// -------------------------------------------------------------------- // --------------------------------------------------------------------
// Construction de <theedgelist> un edge correspond a un element simple // Construction de <theedgelist> un edge correspond a un element simple
// du contour. // du contour.
// -------------------------------------------------------------------- // --------------------------------------------------------------------
theedgelist = new MAT_ListOfEdge(); theedgelist = new MAT_ListOfEdge();
for(i=0; i<noofedges; i++) { for(i=0; i<noofedges; i++) {
@ -858,9 +862,9 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
theedgelist->Loop(); theedgelist->Loop();
//--------------------------------------------------- //---------------------------------------------------
// Initialisation des bissectrices issues du contour. // Initialisation des bissectrices issues du contour.
//--------------------------------------------------- //---------------------------------------------------
Standard_Real Dist; Standard_Real Dist;
theedgelist->First(); theedgelist->First();
@ -879,9 +883,9 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
(atool.TangentAfter(theedgelist->Current()->EdgeNumber(), myIsOpenResult)); (atool.TangentAfter(theedgelist->Current()->EdgeNumber(), myIsOpenResult));
} }
//---------------------------------------------------- //----------------------------------------------------
// Affectation a chaque edge de ses deux bissectrices. // Affectation a chaque edge de ses deux bissectrices.
//---------------------------------------------------- //----------------------------------------------------
theedgelist->First(); theedgelist->First();
for(i=0; i<theedgelist->Number(); i++) { for(i=0; i<theedgelist->Number(); i++) {
@ -892,9 +896,9 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
theedgelist->Next(); theedgelist->Next();
} }
//=========================================================================== //===========================================================================
// Boucle Principale (etape 2) // Boucle Principale (etape 2)
//=========================================================================== //===========================================================================
Standard_Integer NumberOfIte = 0; Standard_Integer NumberOfIte = 0;
while(theedgelist->Number()>1) { while(theedgelist->Number()>1) {
@ -903,7 +907,7 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Creation des geometries des bissectrices via le tool. (etape 2.1) // Creation des geometries des bissectrices via le tool. (etape 2.1)
// ------------------------------------------------------------------- // -------------------------------------------------------------------
Standard_Integer aNbBis = noofbisectors - beginbisector;
for(i=beginbisector; i<noofbisectors; i++) { for(i=beginbisector; i<noofbisectors; i++) {
atool.CreateBisector(bisectormap(i)); atool.CreateBisector(bisectormap(i));
@ -917,14 +921,54 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
#endif #endif
} }
//Patch to prevent infinit loop because of
//bad geometry
if(aNbBis == 1)
{
if(aPrefNarea == 1)
{
aNbOfNarea1++;
Standard_Integer edge1number = bisectormap(beginbisector)->FirstEdge()->EdgeNumber();
Standard_Integer edge2number = bisectormap(beginbisector)->SecondEdge()->EdgeNumber();
if(aNbElts[0] == edge1number)
{
aCountElts[0]++;
}
else
{
aCountElts[0] = 0;
aNbElts[0] = edge1number;
}
if(aNbElts[1] == edge2number)
{
aCountElts[1]++;
}
else
{
aCountElts[1] = 0;
aNbElts[1] = edge2number;
}
if(aNbOfNarea1 >= aNbMaxNarea1 && (aCountElts[0] >= aNbMaxNarea1 || aCountElts[1] >= aNbMaxNarea1))
{
isBreak = Standard_True;
}
}
else
{
aNbOfNarea1 = 0;
aCountElts[0] = 0;
aCountElts[1] = 0;
}
}
aPrefNarea = aNbBis;
// --------------------------------------------- // ---------------------------------------------
// Condition de sortie de la boucle principale. // Condition de sortie de la boucle principale.
// --------------------------------------------- // ---------------------------------------------
// Modified by Sergey KHROMOV - Fri Nov 17 10:28:28 2000 Begin // Modified by Sergey KHROMOV - Fri Nov 17 10:28:28 2000 Begin
if (theedgelist->Number() < 3) if (theedgelist->Number() < 3)
break; break;
// Modified by Sergey KHROMOV - Fri Nov 17 10:28:37 2000 End // Modified by Sergey KHROMOV - Fri Nov 17 10:28:37 2000 End
//--------------------------------------------------- //---------------------------------------------------
// boucle 2 Tant qu il y a des bisectrices a effacer. // boucle 2 Tant qu il y a des bisectrices a effacer.
@ -1230,6 +1274,13 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
// Sortie de la boucle principale si il n y a pas d edge a eliminer. // Sortie de la boucle principale si il n y a pas d edge a eliminer.
// (etape 2.6) // (etape 2.6)
//------------------------------------------------------------------ //------------------------------------------------------------------
//
//Patch to break infinite loop.
if(narea == 1 && isBreak)
{
narea = 0;
}
//
if(narea == 0) { if(narea == 0) {
interrupt = Standard_True; interrupt = Standard_True;
break; break;
@ -1379,7 +1430,7 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
theedgelist->First(); theedgelist->First();
edge = theedgelist->Current(); edge = theedgelist->Current();
if(edge->FirstBisector()->IndexNumber() == noofbisectors-1) { if(edge->FirstBisector()->IndexNumber() == noofbisectors-1) {
// Modified by skv - Tue Sep 13 12:13:28 2005 IDEM Begin // Modified by skv - Tue Sep 13 12:13:28 2005 IDEM Begin
if (atool.TrimBisector(edge->SecondBisector(), if (atool.TrimBisector(edge->SecondBisector(),
edge->FirstBisector()->IssuePoint())) { edge->FirstBisector()->IssuePoint())) {
if (edge->SecondBisector()->EndPoint() == 0) if (edge->SecondBisector()->EndPoint() == 0)
@ -1387,10 +1438,10 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
bisectormap(noofbisectors-1)->AddBisector(edge->SecondBisector()); bisectormap(noofbisectors-1)->AddBisector(edge->SecondBisector());
} else } else
semiInfinite = Standard_True; semiInfinite = Standard_True;
// Modified by skv - Tue Sep 13 12:13:28 2005 IDEM End // Modified by skv - Tue Sep 13 12:13:28 2005 IDEM End
} }
else { else {
// Modified by skv - Tue Sep 13 12:13:28 2005 IDEM Begin // Modified by skv - Tue Sep 13 12:13:28 2005 IDEM Begin
if (atool.TrimBisector(edge->FirstBisector(), if (atool.TrimBisector(edge->FirstBisector(),
edge->SecondBisector()->IssuePoint())) { edge->SecondBisector()->IssuePoint())) {
if (edge->FirstBisector()->EndPoint() == 0) if (edge->FirstBisector()->EndPoint() == 0)
@ -1398,7 +1449,7 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
bisectormap(noofbisectors-1)->AddBisector(edge->FirstBisector()); bisectormap(noofbisectors-1)->AddBisector(edge->FirstBisector());
} else } else
semiInfinite = Standard_True; semiInfinite = Standard_True;
// Modified by skv - Tue Sep 13 12:13:28 2005 IDEM End // Modified by skv - Tue Sep 13 12:13:28 2005 IDEM End
} }
if (!semiInfinite) { if (!semiInfinite) {
thenumberofbisectors--; thenumberofbisectors--;

View File

@ -15,7 +15,8 @@
// commercial license or contractual agreement. // commercial license or contractual agreement.
#define Debug(expr) cout<<" MAT2d_Tool2d.cxx : expr :"<<expr<<endl; #define Debug(expr) cout<<" MAT2d_Tool2d.cxx : expr :"<<expr<<endl;
//#define OCCT_DEBUG
//#define DRAW
#ifdef DRAW #ifdef DRAW
#include <DBRep.hxx> #include <DBRep.hxx>
#include <DrawTrSurf.hxx> #include <DrawTrSurf.hxx>
@ -68,12 +69,14 @@
#include <Precision.hxx> #include <Precision.hxx>
#ifdef DRAW #ifdef DRAW
static Handle(DrawTrSurf_Curve2d) draw; static Handle(DrawTrSurf_Curve2d) draw;
static Standard_Integer AffichBis = Standard_False;
#endif #endif
#ifdef OCCT_DEBUG #ifdef OCCT_DEBUG
static void MAT2d_DrawCurve(const Handle(Geom2d_Curve)& aCurve, static void MAT2d_DrawCurve(const Handle(Geom2d_Curve)& aCurve,
const Standard_Integer Indice); const Standard_Integer Indice);
static Standard_Boolean Store = Standard_False; static Standard_Boolean Store = Standard_False;
static Standard_Boolean AffichDist = Standard_False;
#endif #endif
//===================================================================== //=====================================================================
@ -90,6 +93,10 @@ static Standard_Boolean AreNeighbours(const Standard_Integer IEdge1,
const Standard_Integer NbEdge); const Standard_Integer NbEdge);
static void SetTrim(Bisector_Bisec& Bis , Handle(Geom2d_Curve)& Line1); static void SetTrim(Bisector_Bisec& Bis , Handle(Geom2d_Curve)& Line1);
static Standard_Boolean CheckEnds (const Handle(Geom2d_Geometry)& Elt ,
const gp_Pnt2d& PCom ,
const Standard_Real Distance,
const Standard_Real Tol);
static Standard_Real MAT2d_TOLCONF = 1.e-7; static Standard_Real MAT2d_TOLCONF = 1.e-7;
@ -333,12 +340,12 @@ void MAT2d_Tool2d::CreateBisector(const Handle(MAT_Bisector)& abisector)
cout<<" Item 1 : "<<endl; cout<<" Item 1 : "<<endl;
cout<<edge1number<<endl; cout<<edge1number<<endl;
cout<<endl; cout<<endl;
// elt1->Dump(1,1); // elt1->Dump(1,1);
cout<<endl; cout<<endl;
cout<<" Item 2 : "<<endl; cout<<" Item 2 : "<<endl;
cout<<edge2number<<endl; cout<<edge2number<<endl;
cout<<endl; cout<<endl;
// elt2->Dump(1,1); // elt2->Dump(1,1);
cout<<endl; cout<<endl;
} }
#endif #endif
@ -524,7 +531,7 @@ Standard_Boolean MAT2d_Tool2d::TrimBisector
Handle(Bisector_Curve) Bis = Handle(Bisector_Curve):: Handle(Bisector_Curve) Bis = Handle(Bisector_Curve)::
DownCast(Bisector->BasisCurve()); DownCast(Bisector->BasisCurve());
// Param = ParameterOnCurve(Bisector,theGeomPnts.Value(apoint)); // Param = ParameterOnCurve(Bisector,theGeomPnts.Value(apoint));
Param = Bis->Parameter(GeomPnt (apoint)); Param = Bis->Parameter(GeomPnt (apoint));
if (Bisector->BasisCurve()->IsPeriodic()) { if (Bisector->BasisCurve()->IsPeriodic()) {
@ -589,9 +596,9 @@ Standard_Boolean MAT2d_Tool2d::Projection (const Standard_Integer IEdge ,
GeomAbs_CurveType TypeC1 = C1.GetType(); GeomAbs_CurveType TypeC1 = C1.GetType();
if (TypeC1 == GeomAbs_Circle) { if (TypeC1 == GeomAbs_Circle) {
Standard_Real R = C1.Circle().Radius(); Standard_Real R = C1.Circle().Radius();
Standard_Real EpsCirc = Eps; Standard_Real EpsCirc = 100.*Eps;
if ( R < 1.) EpsCirc = Eps/R; if ( R < 1.) EpsCirc = Eps/R;
if (!((ParamMax - ParamMin + 2*EpsCirc) < 2*M_PI)) { if (((ParamMax - ParamMin + 2*EpsCirc) < 2*M_PI)) {
ParamMax = ParamMax + EpsCirc; ParamMin = ParamMin - EpsCirc; ParamMax = ParamMax + EpsCirc; ParamMin = ParamMin - EpsCirc;
} }
} }
@ -603,12 +610,17 @@ Standard_Boolean MAT2d_Tool2d::Projection (const Standard_Integer IEdge ,
//----------------------------------------------------- //-----------------------------------------------------
Extrema_ExtPC2d Extremas(PCom,C1,ParamMin,ParamMax); Extrema_ExtPC2d Extremas(PCom,C1,ParamMin,ParamMax);
if (Extremas.IsDone()){ if (Extremas.IsDone()){
if (Extremas.NbExt() == 0 ) return Standard_False; // Pas de solution! Distance = Precision::Infinite();
if(Extremas.NbExt() < 1)
{
return Standard_False;
}
for (Standard_Integer i = 1; i <= Extremas.NbExt(); i++) { for (Standard_Integer i = 1; i <= Extremas.NbExt(); i++) {
if (Extremas.SquareDistance(i) < Distance * Distance) { if (Extremas.SquareDistance(i) < Distance) {
Distance = sqrt (Extremas.SquareDistance(i)); Distance = Extremas.SquareDistance(i);
} }
} }
Distance = Sqrt(Distance);
} }
else { else {
if (TypeC1 == GeomAbs_Circle) { if (TypeC1 == GeomAbs_Circle) {
@ -630,6 +642,7 @@ Standard_Boolean MAT2d_Tool2d::IsSameDistance (
Standard_Real& Distance) const Standard_Real& Distance) const
{ {
TColStd_Array1OfReal Dist(1,4); TColStd_Array1OfReal Dist(1,4);
const Standard_Real eps = 1.e-7;
Standard_Integer IEdge1,IEdge2,IEdge3,IEdge4; Standard_Integer IEdge1,IEdge2,IEdge3,IEdge4;
IEdge1 = BisectorOne->FirstEdge() ->EdgeNumber(); IEdge1 = BisectorOne->FirstEdge() ->EdgeNumber();
@ -637,26 +650,76 @@ Standard_Boolean MAT2d_Tool2d::IsSameDistance (
IEdge3 = BisectorTwo->FirstEdge() ->EdgeNumber(); IEdge3 = BisectorTwo->FirstEdge() ->EdgeNumber();
IEdge4 = BisectorTwo->SecondEdge()->EdgeNumber(); IEdge4 = BisectorTwo->SecondEdge()->EdgeNumber();
Projection(IEdge1,PCom,Dist(1)); Standard_Boolean isDone1 = Projection(IEdge1,PCom,Dist(1));
Projection(IEdge2,PCom,Dist(2)); Standard_Boolean isDone2 = Projection(IEdge2,PCom,Dist(2));
if(isDone1)
{
if(!isDone2)
{
Handle(Geom2d_Geometry) Elt = theCircuit->Value(IEdge2);
Standard_Real Tol = Max(Precision::Confusion(), eps*Dist(1));
if(CheckEnds (Elt, PCom, Dist(1), Tol))
{
Dist(2) = Dist(1);
}
}
}
else
{
if(isDone2)
{
Handle(Geom2d_Geometry) Elt = theCircuit->Value(IEdge1);
Standard_Real Tol = Max(Precision::Confusion(), eps*Dist(2));
if(CheckEnds (Elt, PCom, Dist(2), Tol))
{
Dist(1) = Dist(2);
}
}
}
Standard_Boolean isDone3 = Standard_True, isDone4 = Standard_True;
if (IEdge3 == IEdge1) Dist(3) = Dist(1); if (IEdge3 == IEdge1) Dist(3) = Dist(1);
else if (IEdge3 == IEdge2) Dist(3) = Dist(2); else if (IEdge3 == IEdge2) Dist(3) = Dist(2);
else Projection(IEdge3,PCom,Dist(3)); else isDone3 = Projection(IEdge3,PCom,Dist(3));
if (IEdge4 == IEdge1) Dist(4) = Dist(1); if (IEdge4 == IEdge1) Dist(4) = Dist(1);
else if (IEdge4 == IEdge2) Dist(4) = Dist(2); else if (IEdge4 == IEdge2) Dist(4) = Dist(2);
else Projection(IEdge4,PCom,Dist(4)); else isDone4 = Projection(IEdge4,PCom,Dist(4));
//
if(isDone3)
{
if(!isDone4)
{
Handle(Geom2d_Geometry) Elt = theCircuit->Value(IEdge4);
Standard_Real Tol = Max(Precision::Confusion(), eps*Dist(3));
if(CheckEnds (Elt, PCom, Dist(3), Tol))
{
Dist(4) = Dist(3);
}
}
}
else
{
if(isDone4)
{
Handle(Geom2d_Geometry) Elt = theCircuit->Value(IEdge3);
Standard_Real Tol = Max(Precision::Confusion(), eps*Dist(4));
if(CheckEnds (Elt, PCom, Dist(4), Tol))
{
Dist(3) = Dist(4);
}
}
}
#ifdef OCCT_DEBUG #ifdef OCCT_DEBUG
Standard_Boolean Affich = Standard_False; if (AffichDist)
if (Affich)
for (Standard_Integer j = 1; j <= 4;j++){ for (Standard_Integer j = 1; j <= 4;j++){
cout <<"Distance number : "<<j<<" is :"<< Dist(j)<<endl; cout <<"Distance number : "<<j<<" is :"<< Dist(j)<<endl;
} }
#endif #endif
Standard_Real EpsDist = MAT2d_TOLCONF*100. ; Standard_Real EpsDist = MAT2d_TOLCONF*300. ;
Distance = Dist(1); Distance = Dist(1);
for (Standard_Integer i = 1; i <= 4; i++){ for (Standard_Integer i = 1; i <= 4; i++){
if (theJoinType == GeomAbs_Intersection && if (theJoinType == GeomAbs_Intersection &&
@ -737,13 +800,13 @@ Standard_Real MAT2d_Tool2d::IntersectBisector (
cout<<"INTERSECTION de "<<BisectorOne->BisectorNumber()<< cout<<"INTERSECTION de "<<BisectorOne->BisectorNumber()<<
" et de "<<BisectorTwo->BisectorNumber()<<endl; " et de "<<BisectorTwo->BisectorNumber()<<endl;
cout<<" Bisector 1 : "<<endl; cout<<" Bisector 1 : "<<endl;
// (Bisector1->BasisCurve())->Dump(-1,1); // (Bisector1->BasisCurve())->Dump(-1,1);
cout<<endl; cout<<endl;
Debug(Domain1.FirstParameter()); Debug(Domain1.FirstParameter());
Debug(Domain1.LastParameter()); Debug(Domain1.LastParameter());
cout<<"-----------------"<<endl; cout<<"-----------------"<<endl;
cout<<" Bisector 2 : "<<endl; cout<<" Bisector 2 : "<<endl;
// (Bisector2->BasisCurve())->Dump(-1,1); // (Bisector2->BasisCurve())->Dump(-1,1);
cout<<endl; cout<<endl;
Debug(Domain2.FirstParameter()); Debug(Domain2.FirstParameter());
Debug(Domain2.LastParameter()); Debug(Domain2.LastParameter());
@ -751,23 +814,23 @@ Standard_Real MAT2d_Tool2d::IntersectBisector (
} }
#endif #endif
// ------------------------- // -------------------------
// Calcul de l intersection. // Calcul de l intersection.
// ------------------------- // -------------------------
Bisector_Inter Intersect; Bisector_Inter Intersect;
Intersect.Perform (GeomBis(BisectorOne->BisectorNumber()),Domain1, Intersect.Perform (GeomBis(BisectorOne->BisectorNumber()),Domain1,
GeomBis(BisectorTwo->BisectorNumber()),Domain2, GeomBis(BisectorTwo->BisectorNumber()),Domain2,
Tolerance,Tolerance,Standard_True); Tolerance,Tolerance,Standard_True);
// Geom2dInt_GInter Intersect; // Geom2dInt_GInter Intersect;
// Intersect.Perform(Bisector1,Domain1,Bisector2,Domain2,Tolerance,Tolerance); // Intersect.Perform(Bisector1,Domain1,Bisector2,Domain2,Tolerance,Tolerance);
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Exploitation du resultat de l intersection et selection du point solution // Exploitation du resultat de l intersection et selection du point solution
// equidistant des deux edges et le plus proche en parametre de l origine // equidistant des deux edges et le plus proche en parametre de l origine
// des bissectrices. // des bissectrices.
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
if(!Intersect.IsDone()) return Precision::Infinite(); if(!Intersect.IsDone()) return Precision::Infinite();
@ -901,9 +964,9 @@ Standard_Real MAT2d_Tool2d::IntersectBisector (
} }
if (theCircuit->ConnexionOn(IndexEdge4)){ if (theCircuit->ConnexionOn(IndexEdge4)){
// -------------------------------------- //--------------------------------------
// BisectorTwo est issue d une connexion. //BisectorTwo est issue d une connexion.
// -------------------------------------- //--------------------------------------
if (AreNeighbours(IndexEdge1,IndexEdge2,NumberOfItems()) && if (AreNeighbours(IndexEdge1,IndexEdge2,NumberOfItems()) &&
AreNeighbours(IndexEdge3,IndexEdge4,NumberOfItems()) && AreNeighbours(IndexEdge3,IndexEdge4,NumberOfItems()) &&
IndexEdge2 == IndexEdge3 ){ IndexEdge2 == IndexEdge3 ){
@ -912,11 +975,40 @@ Standard_Real MAT2d_Tool2d::IntersectBisector (
} }
} }
if (ExtremiteControle) { //if (ExtremiteControle) {
if(Bisector1->StartPoint().Distance(PointSolution) < Tolerance || // if(Bisector1->StartPoint().Distance(PointSolution) < Tolerance ||
Bisector2->StartPoint().Distance(PointSolution) < Tolerance ) // Bisector2->StartPoint().Distance(PointSolution) < Tolerance )
// return Precision::Infinite();
//}
if(ExtremiteControle)
{
if(Bisector1->StartPoint().Distance(PointSolution) < Tolerance)
{
#ifdef DRAW
if(AffichBis)
{
DrawTrSurf::Set("Bis1", Bisector1);
DrawTrSurf::Set("Bis2", Bisector2);
}
#endif
return Precision::Infinite(); return Precision::Infinite();
} }
if(Bisector2->StartPoint().Distance(PointSolution) < Tolerance)
{
#ifdef DRAW
if(AffichBis)
{
DrawTrSurf::Set("Bis1", Bisector1);
DrawTrSurf::Set("Bis2", Bisector2);
}
#endif
return Precision::Infinite();
}
}
if(BisectorOne->SecondParameter() < Precision::Infinite() && if(BisectorOne->SecondParameter() < Precision::Infinite() &&
BisectorOne->SecondParameter() < Param1*(1. - Tolerance )) BisectorOne->SecondParameter() < Param1*(1. - Tolerance ))
@ -929,6 +1021,7 @@ Standard_Real MAT2d_Tool2d::IntersectBisector (
BisectorOne->SecondParameter(Param1); BisectorOne->SecondParameter(Param1);
BisectorTwo->FirstParameter (Param2); BisectorTwo->FirstParameter (Param2);
#ifdef OCCT_DEBUG #ifdef OCCT_DEBUG
if (Affich) { if (Affich) {
cout<<" coordonnees : "<<GeomPnt (IntPnt).X()<<" " cout<<" coordonnees : "<<GeomPnt (IntPnt).X()<<" "
@ -1089,11 +1182,11 @@ void MAT2d_Tool2d::BisecFusion(const Standard_Integer I1,
UF1 = UF1 - DU; UF1 = UF1 - DU;
Handle(Bisector_BisecAna) BAna = Handle(Bisector_BisecAna)::DownCast(Bisector1->BasisCurve()); Handle(Bisector_BisecAna) BAna = Handle(Bisector_BisecAna)::DownCast(Bisector1->BasisCurve());
//---------------------------- uncomment if new method Bisector_BisecAna::SetTrim(f,l) is not used //---------------------------- uncomment if new method Bisector_BisecAna::SetTrim(f,l) is not used
// Handle(Geom2d_Curve) C2d = BAna->Geom2dCurve(); // Handle(Geom2d_Curve) C2d = BAna->Geom2dCurve();
// Handle(Geom2d_TrimmedCurve) trimC2d = new Geom2d_TrimmedCurve(C2d, UF1, UL1); // Handle(Geom2d_TrimmedCurve) trimC2d = new Geom2d_TrimmedCurve(C2d, UF1, UL1);
// BAna->Init(trimC2d); // BAna->Init(trimC2d);
//--------------------------- end //--------------------------- end
BAna->SetTrim(UF1,UL1); // put comment if SetTrim(f,l) is not used BAna->SetTrim(UF1,UL1); // put comment if SetTrim(f,l) is not used
Bisector1->SetTrim(UF1,UL1); Bisector1->SetTrim(UF1,UL1);
@ -1220,6 +1313,37 @@ IntRes2d_Domain Domain(const Handle(Geom2d_TrimmedCurve)& Bisector1,
return Domain1; return Domain1;
} }
//=============================================================================
//function : CheckEnds
//purpose :
//=============================================================================
Standard_Boolean CheckEnds (const Handle(Geom2d_Geometry)& Elt ,
const gp_Pnt2d& PCom ,
const Standard_Real Distance,
const Standard_Real Tol)
{
Handle(Standard_Type) Type = Elt->DynamicType();
Handle(Geom2d_TrimmedCurve) Curve;
if (Type == STANDARD_TYPE(Geom2d_CartesianPoint)) {
return Standard_False;
}
else {
Curve = Handle(Geom2d_TrimmedCurve)::DownCast(Elt);
gp_Pnt2d aPf = Curve->StartPoint();
gp_Pnt2d aPl = Curve->EndPoint();
Standard_Real df = PCom.Distance(aPf);
Standard_Real dl = PCom.Distance(aPl);
if(Abs(df - Distance) <= Tol)
return Standard_True;
if(Abs(dl - Distance) <= Tol)
return Standard_True;
}
return Standard_False;
}
#ifdef OCCT_DEBUG #ifdef OCCT_DEBUG
//========================================================================== //==========================================================================
//function : MAT2d_DrawCurve //function : MAT2d_DrawCurve
@ -1284,6 +1408,7 @@ void MAT2d_DrawCurve(const Handle(Geom2d_Curve)& aCurve,
} }
#ifdef DRAW #ifdef DRAW
Standard_Integer Indice = 1;
if (Indice == 1) Couleur = Draw_jaune; if (Indice == 1) Couleur = Draw_jaune;
else if (Indice == 2) Couleur = Draw_bleu; else if (Indice == 2) Couleur = Draw_bleu;
else if (Indice == 3) Couleur = Draw_rouge; else if (Indice == 3) Couleur = Draw_rouge;
@ -1296,8 +1421,8 @@ void MAT2d_DrawCurve(const Handle(Geom2d_Curve)& aCurve,
else else
dr = new DrawTrSurf_Curve2d(CurveDraw,Couleur,500); dr = new DrawTrSurf_Curve2d(CurveDraw,Couleur,500);
dout << dr; //dout << dr;
dout.Flush(); //dout.Flush();
#endif #endif
} }

View File

@ -8,7 +8,7 @@ tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
mkevol result s mkevol result s
updatevol s_5 0 1*SCALE1 1 2*SCALE1 2 1*SCALE1 updatevol s_4 0 1*SCALE1 1 2*SCALE1 2 1*SCALE1
buildevol buildevol
set square 87027.5 set square 87027.5

View File

@ -8,7 +8,7 @@ tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
mkevol result s mkevol result s
updatevol s_5 0 1*SCALE1 1 2*SCALE1 2 1*SCALE1 updatevol s_6 0 1*SCALE1 1 2*SCALE1 2 1*SCALE1
buildevol buildevol
set square 81492.8 set square 81492.8

View File

@ -8,7 +8,7 @@ tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
mkevol result s mkevol result s
updatevol s_6 0 1*SCALE1 1 2*SCALE1 2 1*SCALE1 updatevol s_5 0 1*SCALE1 1 2*SCALE1 2 1*SCALE1
buildevol buildevol
set square 81299.7 set square 81299.7

View File

@ -7,6 +7,6 @@ pipe s w profile
tscale s 0 0 0 SCALE1 tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
blend result s 1*SCALE1 s_5 blend result s 1*SCALE1 s_4
set square 91635.9 set square 91635.9

View File

@ -7,6 +7,6 @@ pipe s w profile
tscale s 0 0 0 SCALE1 tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
blend result s 1*SCALE1 s_5 1*SCALE1 s_2 1*SCALE1 s_1 blend result s 1*SCALE1 s_4 1*SCALE1 s_2 1*SCALE1 s_1
set square 90904.5 set square 90904.5

View File

@ -7,6 +7,6 @@ pipe s w profile
tscale s 0 0 0 SCALE1 tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
blend result s 1*SCALE1 s_6 1*SCALE1 s_8 1*SCALE1 s_5 blend result s 1*SCALE1 s_6 1*SCALE1 s_9 1*SCALE1 s_4
set square 90939.5 set square 90939.5

View File

@ -7,6 +7,6 @@ pipe s w profile
tscale s 0 0 0 SCALE1 tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
blend result s 1*SCALE1 s_5 blend result s 1*SCALE1 s_6
set square 81863.7 set square 81863.7

View File

@ -7,6 +7,6 @@ pipe s w profile
tscale s 0 0 0 SCALE1 tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
blend result s 1*SCALE1 s_5 1*SCALE1 s_8 1*SCALE1 s_6 blend result s 1*SCALE1 s_5 1*SCALE1 s_10 1*SCALE1 s_6
set square 80209.3 set square 80209.3

View File

@ -7,6 +7,6 @@ pipe s w profile
tscale s 0 0 0 SCALE1 tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
blend result s 1*SCALE1 s_6 blend result s 1*SCALE1 s_5
set square 81743.8 set square 81743.8

View File

@ -7,6 +7,6 @@ pipe s w profile
tscale s 0 0 0 SCALE1 tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
blend result s 1*SCALE1 s_6 1*SCALE1 s_10 1*SCALE1 s_7 blend result s 1*SCALE1 s_5 1*SCALE1 s_8 1*SCALE1 s_7
set square 80586.1 set square 80586.1

View File

@ -4,6 +4,7 @@
#ttranslate s1 s2 5 5 0 #ttranslate s1 s2 5 5 0
#cut s s1 s2 #cut s s1 s2
#save s CFI_i1234fis.rle #save s CFI_i1234fis.rle
puts "TODO ?OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty_2"
restore [locate_data_file CFI_i1234fis.rle] s restore [locate_data_file CFI_i1234fis.rle] s
tscale s 0 0 0 SCALE1 tscale s 0 0 0 SCALE1

View File

@ -1,4 +1,5 @@
## buc60289 ## buc60289
puts "TODO ?OCC24255 ALL: Error : The length of the resulting shape is"
restore [locate_data_file heal-Face1.rle] a restore [locate_data_file heal-Face1.rle] a
restore [locate_data_file Plan.rle] b restore [locate_data_file Plan.rle] b

View File

@ -31,7 +31,7 @@ GetShape D $Lin2:1:2 L1
NewCommand D NewCommand D
AddDriver D Prism Box PTxyz AddDriver D Prism Box PTxyz
set Prism [AddPrism D $Lin2 300 0] set Prism [AddPrism D $Lin2 300 1]
ComputeFun D $Prism:1 ComputeFun D $Prism:1
GetShape D $Prism:1:2 Pr GetShape D $Prism:1:2 Pr

View File

@ -31,9 +31,10 @@ if { [regexp {OK} $che ] != 1} {
renamevar a result renamevar a result
} else { } else {
puts "OK BUC60782: offset is created" puts "OK BUC60782: offset is created"
tpcompound result compound result_1 a result
} }
} }
set square 0 set square 4.24716e+006
set 2dviewer 0 set 2dviewer 0

View File

@ -15,7 +15,7 @@ mkplane cont cont
nexplode cyl F nexplode cyl F
ttranslate cont 0 200 0 ttranslate cont 0 200 0
featdprism cyl cont cont 10 1 1 featdprism cyl cont cont -10 1 1
if [catch {featperformval dprism result 55 cyl_3 } catch_result] { if [catch {featperformval dprism result 55 cyl_3 } catch_result] {
puts "Faulty OCC423 (case 1): function FEATPERFORMVAL works wrongly" puts "Faulty OCC423 (case 1): function FEATPERFORMVAL works wrongly"

View File

@ -20,5 +20,5 @@ if { [regexp {WIRE} $list] == 0 } {
renamevar result_1 result renamevar result_1 result
set length 320.442 set length 307.876
set 2dviewer 1 set 2dviewer 1

View File

@ -42,6 +42,6 @@ if { [catch { mkoffset result a_1 1 5 } status] } {
} }
} }
} }
set length 0 set length 8577.24
set 2dviewer 0 set 2dviewer 0
} }

View File

@ -18,9 +18,9 @@ explode p f
mksurface ss1 p_1 mksurface ss1 p_1
mksurface ss2 p_2 mksurface ss2 p_2
mksurface ss3 p_3 mksurface ss3 p_3
offset o1 ss1 0.1 offset o1 ss1 -0.1
offset o2 ss2 0.1 offset o2 ss2 -0.1
offset o3 ss3 0.1 offset o3 ss3 -0.1
mkface res o2 mkface res o2
set info [sprops res] set info [sprops res]

View File

@ -3,6 +3,7 @@ puts "TODO ?OCC24156 MacOS: An exception was caught"
puts "TODO OCC24156 MacOS: TEST INCOMPLETE" puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
puts "TODO OCC24156 MacOS: \\*\\*\\* Abort" puts "TODO OCC24156 MacOS: \\*\\*\\* Abort"
puts "TODO OCC24156 MacOS: ... The exception is" puts "TODO OCC24156 MacOS: ... The exception is"
puts "TODO ?OCC24255 ALL: An exception"
puts "================" puts "================"
puts "OCC23952" puts "OCC23952"

View File

@ -17,17 +17,17 @@ if [catch { mkoffset resoffset pp 1 -1. i } ] {
} else { } else {
renamevar resoffset_1 result renamevar resoffset_1 result
set length 32 set length 42
set nb_v_good 5 set nb_v_good 6
set nb_e_good 5 set nb_e_good 7
set nb_w_good 1 set nb_w_good 1
set nb_f_good 0 set nb_f_good 0
set nb_sh_good 0 set nb_sh_good 0
set nb_sol_good 0 set nb_sol_good 0
set nb_compsol_good 0 set nb_compsol_good 0
set nb_compound_good 0 set nb_compound_good 0
set nb_shape_good 11 set nb_shape_good 14
display result display result
fit fit

View File

@ -15,7 +15,7 @@ if [catch { mkoffset resoffset a 1 2. } ] {
} else { } else {
renamevar resoffset_1 result renamevar resoffset_1 result
set length 50.2655 set length 75.3982
set nb_v_good 1 set nb_v_good 1
set nb_e_good 1 set nb_e_good 1

View File

@ -15,7 +15,7 @@ if [catch { mkoffset resoffset a 1 -3. } ] {
} else { } else {
renamevar resoffset_1 result renamevar resoffset_1 result
set length 81.6814 set length 43.9823
set nb_v_good 1 set nb_v_good 1
set nb_e_good 1 set nb_e_good 1

View File

@ -33,7 +33,7 @@ GetShape D $Lin2:1:2 L1;
#4 Prism (after step #1) #4 Prism (after step #1)
NewCommand D NewCommand D
AddDriver D Prism Box PTxyz AddDriver D Prism Box PTxyz
set Prism [AddPrism D $Lin2 300 0] set Prism [AddPrism D $Lin2 300 1]
ComputeFun D $Prism:1 ComputeFun D $Prism:1
GetShape D $Prism:1:2 Pr GetShape D $Prism:1:2 Pr
GetReference D $Prism; ## check is reference set GetReference D $Prism; ## check is reference set

View File

@ -33,7 +33,7 @@ GetShape D $Lin2:1:2 L1;
#4 Prism (after step #1) #4 Prism (after step #1)
NewCommand D NewCommand D
AddDriver D Prism Box PTxyz AddDriver D Prism Box PTxyz
set Prism [AddPrism D $Lin2 300 0] set Prism [AddPrism D $Lin2 300 1]
ComputeFun D $Prism:1 ComputeFun D $Prism:1
GetShape D $Prism:1:2 Pr GetShape D $Prism:1:2 Pr
GetReference D $Prism; ## check is reference set GetReference D $Prism; ## check is reference set

View File

@ -56,7 +56,7 @@ GetShape D $Lin2:1:2 L1;
#3 Prism #3 Prism
NewCommand D NewCommand D
AddDriver D Prism Box PTxyz AddDriver D Prism Box PTxyz
set Prism [AddPrism D $Lin2 300 0] set Prism [AddPrism D $Lin2 300 1]
ComputeFun D $Prism:1 ComputeFun D $Prism:1
GetShape D $Prism:1:2 Pr GetShape D $Prism:1:2 Pr
GetReference D $Prism; ## check is reference set GetReference D $Prism; ## check is reference set

View File

@ -54,7 +54,7 @@ GetShape D $Lin2:1:2 L1;
#3 Prism #3 Prism
NewCommand D NewCommand D
AddDriver D Prism Box PTxyz AddDriver D Prism Box PTxyz
set Prism [AddPrism D $Lin2 300 0] set Prism [AddPrism D $Lin2 300 1]
ComputeFun D $Prism:1 ComputeFun D $Prism:1
GetShape D $Prism:1:2 Pr GetShape D $Prism:1:2 Pr
GetReference D $Prism; ## check is reference set GetReference D $Prism; ## check is reference set

View File

@ -1,7 +1,7 @@
# Original bug : pro12877 # Original bug : pro12877
# Date : 02 Dec 98 # Date : 02 Dec 98
puts "TODO OCC22803 All:Error: The tolerance of the resulting shape is too big" puts "TODO OCC22803 All: Error: The tolerance of the resulting shape is too big"
#puts "TODO OCC23511 Debian60-64: The area of the resulting shape is 186543" #puts "TODO OCC23511 Debian60-64: The area of the resulting shape is 186543"
restore [locate_data_file CFE903_pro12ggx.rle] base restore [locate_data_file CFE903_pro12ggx.rle] base

View File

@ -3,7 +3,7 @@ restore [locate_data_file contour.rle] cont
mkplane cont cont mkplane cont cont
nexplode cyl F nexplode cyl F
featdprism cyl cont cont 10 0 1 featdprism cyl cont cont -10 0 1
featperform dprism result featperform dprism result
set square 93872.9 set square 93872.9

View File

@ -3,7 +3,7 @@ restore [locate_data_file contour.rle] cont
mkplane cont cont mkplane cont cont
nexplode cyl F nexplode cyl F
featdprism cyl cont cont 10 0 1 featdprism cyl cont cont -10 0 1
featperformval dprism result -100 featperformval dprism result -100
set square 78539.8 set square 87985.1

View File

@ -3,7 +3,7 @@ restore [locate_data_file contour.rle] cont
mkplane cont cont mkplane cont cont
nexplode cyl F nexplode cyl F
featdprism cyl cont cont 10 0 1 featdprism cyl cont cont -10 0 1
featperformval dprism result 100 cyl_3 featperformval dprism result 100 cyl_3
set square 87914.5 set square 87914.5

View File

@ -4,7 +4,7 @@ mkplane cont cont
nexplode cyl F nexplode cyl F
ttranslate cont 0 200 0 ttranslate cont 0 200 0
featdprism cyl cont cont 10 1 1 featdprism cyl cont cont -10 1 1
featperform dprism result cyl_3 featperform dprism result cyl_3
set square 93058.7 set square 93058.7

View File

@ -4,7 +4,7 @@ mkplane cont cont
nexplode cyl F nexplode cyl F
ttranslate cont 0 200 0 ttranslate cont 0 200 0
featdprism cyl cont cont 10 1 1 featdprism cyl cont cont -10 1 1
featperformval dprism result 100 featperformval dprism result 100
set square 108523 set square 93058.7

View File

@ -4,7 +4,7 @@ mkplane cont cont
nexplode cyl F nexplode cyl F
ttranslate cont 0 200 0 ttranslate cont 0 200 0
featdprism cyl cont cont 10 1 1 featdprism cyl cont cont -10 1 1
featperformval dprism result 55 cyl_3 featperformval dprism result 55 cyl_3
set square 94944.4 set square 94944.4

View File

@ -3,7 +3,7 @@ restore [locate_data_file contour.rle] cont
mkplane cont cont mkplane cont cont
nexplode cyl F nexplode cyl F
featdprism cyl cont cont 10 0 1 featdprism cyl cont cont -10 0 1
featperform dprism result cyl_3 featperform dprism result cyl_3
set square 93872.9 set square 93872.9

View File

@ -4,7 +4,7 @@ mkplane cont cont
nexplode cyl F nexplode cyl F
ttranslate cont 0 0 -100 ttranslate cont 0 0 -100
featdprism cyl cont cont 10 0 1 featdprism cyl cont cont -10 0 1
featperformval dprism result -100 featperformval dprism result -100
set square 78539.8 set square 81634.8

View File

@ -4,7 +4,7 @@ mkplane cont cont
nexplode cyl F nexplode cyl F
ttranslate cont 0 0 -100 ttranslate cont 0 0 -100
featdprism cyl cont cont 10 0 1 featdprism cyl cont cont -10 0 1
featperform dprism result featperform dprism result
set square 83382.4 set square 83382.4

View File

@ -9,7 +9,7 @@ ttranslate cont 0 0 -100
# #
mksurface surf cyl_3 mksurface surf cyl_3
mkface face surf mkface face surf
featdprism cyl cont cont 10 0 1 featdprism cyl cont cont -10 0 1
featperformval dprism result 100 face featperformval dprism result 100 face
set square 81610.6 set square 81610.6

View File

@ -3,7 +3,7 @@ restore [locate_data_file contour.rle] cont
mkplane cont cont mkplane cont cont
nexplode cyl F nexplode cyl F
featdprism cyl cont cont 10 0 1 featdprism cyl cont cont -10 0 1
featperform dprism result cyl_3 cyl_3 featperform dprism result cyl_3 cyl_3
set square 93872.9 set square 93872.9

View File

@ -5,7 +5,7 @@ nexplode cyl F
ttranslate cont 0 0 -100 ttranslate cont 0 0 -100
ttranslate cont 0 200 0 ttranslate cont 0 200 0
featdprism cyl cont cont 10 1 1 featdprism cyl cont cont -10 1 1
featperformval dprism result 100 featperformval dprism result 100
set square 108523 set square 103687

View File

@ -10,7 +10,7 @@ ttranslate cont 0 200 0
# #
mksurface surf cyl_3 mksurface surf cyl_3
mkface face surf mkface face surf
featdprism cyl cont cont 10 1 1 featdprism cyl cont cont -10 1 1
featperformval dprism result 55 face featperformval dprism result 55 face
set square 99444.8 set square 99444.8

View File

@ -7,6 +7,6 @@ polyline profile 0 0 0 10 0 0 5 0 5 0 0 0
mkplane profile profile mkplane profile profile
pipe s w profile pipe s w profile
OFFSETSHAPE -1 {s_2 s_3} $calcul $type OFFSETSHAPE -1 {s_2 s_4} $calcul $type
set volume 259.68 set volume 259.68

View File

@ -5,6 +5,6 @@ polyline profile 0 0 0 10 0 0 5 0 5 0 0 0
mkplane profile profile mkplane profile profile
pipe s w profile pipe s w profile
OFFSETSHAPE -1 {s_4 s_5} $calcul $type OFFSETSHAPE -1 {s_3 s_5} $calcul $type
set volume 445.962 set volume 445.962

View File

@ -1,3 +1,5 @@
puts "TODO OCC24255 ALL: Error : big tolerance of shape result"
restore [locate_data_file offset_wire_019.brep] s restore [locate_data_file offset_wire_019.brep] s
set length 1030.64 set length 1030.64

View File

@ -2,11 +2,12 @@ puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO ?OCC23068 ALL: Error : The offset cannot be built." puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO OCC24255 ALL: Faulty shapes in variables"
restore [locate_data_file offset_wire_059.brep] s restore [locate_data_file offset_wire_059.brep] s
set length 0 set length 322.054
set nbsh_v 0 set nbsh_v 551
set nbsh_e 0 set nbsh_e 551
set nbsh_w 0 set nbsh_w 1

View File

@ -1,7 +1,7 @@
restore [locate_data_file offset_wire_081.brep] s restore [locate_data_file offset_wire_081.brep] s
set length 376.906 set length 376.906
set nbsh_v 66 set nbsh_v 65
set nbsh_e 66 set nbsh_e 65
set nbsh_w 1 set nbsh_w 1

View File

@ -1,7 +1,7 @@
restore [locate_data_file offset_wire_089.brep] s restore [locate_data_file offset_wire_089.brep] s
set length 896.364 set length 896.364
set nbsh_v 18 set nbsh_v 19
set nbsh_e 18 set nbsh_e 19
set nbsh_w 1 set nbsh_w 1

View File

@ -1,12 +1,12 @@
puts "TODO ?OCC23068 ALL: An exception was caught" #puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" #puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." #puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO ?OCC23068 ALL: Error : The offset cannot be built." #puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
restore [locate_data_file offset_wire_003.brep] s restore [locate_data_file offset_wire_003.brep] s
set length 0 set length 787.515
set nbsh_v 0 set nbsh_v 78
set nbsh_e 0 set nbsh_e 78
set nbsh_w 0 set nbsh_w 1

View File

@ -5,8 +5,8 @@ puts "TODO ?OCC23748 ALL: Error: Offset is not done."
restore [locate_data_file offset_wire_015.brep] s restore [locate_data_file offset_wire_015.brep] s
set length 0 set length 549.222
set nbsh_v 0 set nbsh_v 55
set nbsh_e 0 set nbsh_e 55
set nbsh_w 0 set nbsh_w 1

View File

@ -1,6 +1,7 @@
cpulimit 2400 cpulimit 2400
puts "TODO OCC23068 ALL: Error : The offset cannot be built." puts "TODO OCC23068 ALL: Error : The offset cannot be built."
puts "TODO OCC23748 ALL: Error: Offset is not done." puts "TODO OCC23748 ALL: Error: Offset is not done."
#puts "TODO OCC24255 ALL: An exception was caught"
restore [locate_data_file offset_wire_041.brep] s restore [locate_data_file offset_wire_041.brep] s

View File

@ -3,11 +3,12 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Faulty shapes in variables"
restore [locate_data_file offset_wire_059.brep] s restore [locate_data_file offset_wire_059.brep] s
set length 0 set length 282.776
set nbsh_v 0 set nbsh_v 524
set nbsh_e 0 set nbsh_e 524
set nbsh_w 0 set nbsh_w 1

View File

@ -2,11 +2,12 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty_2"
restore [locate_data_file offset_wire_067.brep] s restore [locate_data_file offset_wire_067.brep] s
set length 0 set length 17.5164
set nbsh_v 0 set nbsh_v 40
set nbsh_e 0 set nbsh_e 40
set nbsh_w 0 set nbsh_w 2

View File

@ -2,11 +2,12 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty_2 "
restore [locate_data_file offset_wire_081.brep] s restore [locate_data_file offset_wire_081.brep] s
set length 0 set length 291.991
set nbsh_v 0 set nbsh_v 20
set nbsh_e 0 set nbsh_e 20
set nbsh_w 0 set nbsh_w 1

View File

@ -1,8 +1,7 @@
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_"
restore [locate_data_file offset_wire_089.brep] s restore [locate_data_file offset_wire_089.brep] s
set length 953.42 set length 746.196
set nbsh_v 20 set nbsh_v 17
set nbsh_e 20 set nbsh_e 17
set nbsh_w 1 set nbsh_w 1

View File

@ -8,5 +8,5 @@ restore [locate_data_file offset_wire_012.brep] s
set length 0 set length 0
set nbsh_v 0 set nbsh_v 0
set nbsh_e 0 set nbsh_e 0
set nbsh_w 0 set nbsh_w 1

View File

@ -1,7 +1,3 @@
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_4"
puts "TODO OCC23068 ALL: Error : The length of the resulting shape is"
puts "TODO OCC23068 ALL: Error : The resulting shape is WRONG because it must contain"
restore [locate_data_file offset_wire_038.brep] s restore [locate_data_file offset_wire_038.brep] s
set length 223.954 set length 223.954

View File

@ -3,11 +3,13 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO ?OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty_4"
puts "TODO ?OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty_17"
restore [locate_data_file offset_wire_059.brep] s restore [locate_data_file offset_wire_059.brep] s
set length 0 set length 240.01
set nbsh_v 0 set nbsh_v 434
set nbsh_e 0 set nbsh_e 434
set nbsh_w 0 set nbsh_w 2

View File

@ -2,11 +2,12 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
#puts "TODO ALL: Error : big tolerance of shape result"
restore [locate_data_file offset_wire_066.brep] s restore [locate_data_file offset_wire_066.brep] s
set length 0 set length 45.4428
set nbsh_v 0 set nbsh_v 52
set nbsh_e 0 set nbsh_e 52
set nbsh_w 0 set nbsh_w 1

View File

@ -5,8 +5,8 @@ puts "TODO ?OCC23748 ALL: Error: Offset is not done."
restore [locate_data_file offset_wire_081.brep] s restore [locate_data_file offset_wire_081.brep] s
set length 0 set length 428.734
set nbsh_v 0 set nbsh_v 18
set nbsh_e 0 set nbsh_e 18
set nbsh_w 0 set nbsh_w 2

View File

@ -1,8 +1,7 @@
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_"
restore [locate_data_file offset_wire_089.brep] s restore [locate_data_file offset_wire_089.brep] s
set length 1110.06 set length 383.716
set nbsh_v 17 set nbsh_v 4
set nbsh_e 17 set nbsh_e 4
set nbsh_w 1 set nbsh_w 1

View File

@ -1,17 +1,20 @@
puts "TODO OCC23068 ALL: Error : big tolerance of shape result" #puts "TODO OCC23068 ALL: Error : big tolerance of shape result"
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2" #puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2"
#puts "TODO OCC24255 ALL: An exception was caught"
puts "TODO OCC24255 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Error : The offset cannot be built."
set os "ALL" set os "ALL"
if {[array get env os_type] != ""} { if {[array get env os_type] != ""} {
set os $env(os_type) set os $env(os_type)
} }
if { #if {
[string compare $os "Mandriva2010" ] != 0 # [string compare $os "Mandriva2010" ] != 0
&& [string compare $os "Debian40" ] != 0 # && [string compare $os "Debian40" ] != 0
&& [string compare $os "Mandriva2008" ] != 0 # && [string compare $os "Mandriva2008" ] != 0
} { # } {
puts "TODO OCC23068 $os: Error : The resulting shape is WRONG" # puts "TODO OCC23068 $os: Error : The resulting shape is WRONG"
} #}
restore [locate_data_file offset_wire_041.brep] s restore [locate_data_file offset_wire_041.brep] s

View File

@ -8,7 +8,7 @@ puts "TODO ?OCC23748 ALL: Error: Offset is not done."
restore [locate_data_file offset_wire_059.brep] s restore [locate_data_file offset_wire_059.brep] s
set length 347.204 set length 347.204
set nbsh_v 584 set nbsh_v 583
set nbsh_e 584 set nbsh_e 583
set nbsh_w 1 set nbsh_w 1

View File

@ -1,7 +1,7 @@
restore [locate_data_file offset_wire_078.brep] s restore [locate_data_file offset_wire_078.brep] s
set length 488.408 set length 488.408
set nbsh_v 72 set nbsh_v 73
set nbsh_e 72 set nbsh_e 73
set nbsh_w 1 set nbsh_w 1

View File

@ -1,9 +1,9 @@
puts "TODO OCC23068 ALL: Error : big tolerance of shape result_1" #puts "TODO OCC23068 ALL: Error : big tolerance of shape result_1"
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2" #puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2"
restore [locate_data_file offset_wire_021.brep] s restore [locate_data_file offset_wire_021.brep] s
set length 175.927 set length 164.679
set nbsh_v 31 set nbsh_v 30
set nbsh_e 31 set nbsh_e 30
set nbsh_w 2 set nbsh_w 2

View File

@ -3,11 +3,11 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty_"
restore [locate_data_file offset_wire_059.brep] s restore [locate_data_file offset_wire_059.brep] s
set length 0 set length 406.425
set nbsh_v 0 set nbsh_v 579
set nbsh_e 0 set nbsh_e 579
set nbsh_w 0 set nbsh_w 1

View File

@ -3,11 +3,12 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty"
restore [locate_data_file offset_wire_067.brep] s restore [locate_data_file offset_wire_067.brep] s
set length 0 set length 32.4572
set nbsh_v 0 set nbsh_v 105
set nbsh_e 0 set nbsh_e 105
set nbsh_w 0 set nbsh_w 1

View File

@ -1,8 +1,8 @@
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_" #puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_"
restore [locate_data_file offset_wire_068.brep] s restore [locate_data_file offset_wire_068.brep] s
set length 1589.9 set length 1589.9
set nbsh_v 49 set nbsh_v 48
set nbsh_e 49 set nbsh_e 48
set nbsh_w 1 set nbsh_w 1

View File

@ -2,11 +2,12 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO ALL: Error : big tolerance of shape result"
restore [locate_data_file offset_wire_003.brep] s restore [locate_data_file offset_wire_003.brep] s
set length 0 set length 1613.94
set nbsh_v 0 set nbsh_v 98
set nbsh_e 0 set nbsh_e 98
set nbsh_w 0 set nbsh_w 1

View File

@ -1,9 +1,9 @@
puts "TODO OCC23068 ALL: Error : big tolerance of shape result" #puts "TODO OCC23068 ALL: Error : big tolerance of shape result"
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2" #puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2"
restore [locate_data_file offset_wire_021.brep] s restore [locate_data_file offset_wire_021.brep] s
set length 238.72 set length 200.958
set nbsh_v 27 set nbsh_v 26
set nbsh_e 27 set nbsh_e 26
set nbsh_w 1 set nbsh_w 1

View File

@ -3,11 +3,12 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty_"
restore [locate_data_file offset_wire_059.brep] s restore [locate_data_file offset_wire_059.brep] s
set length 0 set length 555.502
set nbsh_v 0 set nbsh_v 573
set nbsh_e 0 set nbsh_e 573
set nbsh_w 0 set nbsh_w 1

View File

@ -3,11 +3,13 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Faulty shapes"
puts "TODO OCC24255 ALL: Error : big tolerance"
restore [locate_data_file offset_wire_067.brep] s restore [locate_data_file offset_wire_067.brep] s
set length 0 set length 51.8506
set nbsh_v 0 set nbsh_v 61
set nbsh_e 0 set nbsh_e 61
set nbsh_w 0 set nbsh_w 1

View File

@ -3,11 +3,12 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO ALL: Faulty shapes in variables faulty_1 to faulty_10"
restore [locate_data_file offset_wire_089.brep] s restore [locate_data_file offset_wire_089.brep] s
set length 0 set length 1367.49
set nbsh_v 0 set nbsh_v 20
set nbsh_e 0 set nbsh_e 20
set nbsh_w 0 set nbsh_w 1

View File

@ -2,7 +2,7 @@ puts "TODO OCC23068 ALL: Error : big tolerance of shape result"
restore [locate_data_file offset_wire_024.brep] s restore [locate_data_file offset_wire_024.brep] s
set length 40.4005 set length 40.4005
set nbsh_v 40 set nbsh_v 44
set nbsh_e 40 set nbsh_e 44
set nbsh_w 1 set nbsh_w 1

View File

@ -3,7 +3,7 @@ puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2"
restore [locate_data_file offset_wire_071.brep] s restore [locate_data_file offset_wire_071.brep] s
set length 83216 set length 83216
set nbsh_v 205 set nbsh_v 215
set nbsh_e 205 set nbsh_e 215
set nbsh_w 1 set nbsh_w 1

View File

@ -1,5 +1,10 @@
puts "TODO OCC23068 ALL: Error : big tolerance of shape result" #puts "TODO OCC23068 ALL: Error : big tolerance of shape result"
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2" #puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2"
#puts "TODO OCC24255 ALL: An exception was caught"
puts "TODO OCC24255 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Error : The offset cannot be built."
restore [locate_data_file offset_wire_072.brep] s restore [locate_data_file offset_wire_072.brep] s
set length 116267 set length 116267

View File

@ -3,7 +3,7 @@ puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2"
restore [locate_data_file offset_wire_073.brep] s restore [locate_data_file offset_wire_073.brep] s
set length 80332.8 set length 80332.8
set nbsh_v 214 set nbsh_v 212
set nbsh_e 214 set nbsh_e 212
set nbsh_w 1 set nbsh_w 1

View File

@ -2,7 +2,7 @@
restore [locate_data_file offset_wire_075.brep] s restore [locate_data_file offset_wire_075.brep] s
set length 308.604 set length 308.604
set nbsh_v 88 set nbsh_v 84
set nbsh_e 88 set nbsh_e 84
set nbsh_w 1 set nbsh_w 1

View File

@ -5,8 +5,8 @@ puts "TODO ?OCC23748 ALL: Error: Offset is not done."
restore [locate_data_file offset_wire_001.brep] s restore [locate_data_file offset_wire_001.brep] s
set length 0 set length 9.26702
set nbsh_v 0 set nbsh_v 24
set nbsh_e 0 set nbsh_e 24
set nbsh_w 0 set nbsh_w 1

View File

@ -1,9 +1,7 @@
puts "TODO OCC23068 ALL: Error : big tolerance of shape result_2"
puts "TODO OCC23068 ALL: Error : The resulting shape is WRONG"
restore [locate_data_file offset_wire_022.brep] s restore [locate_data_file offset_wire_022.brep] s
set length 230.726 set length 224.208
set nbsh_v 50 set nbsh_v 49
set nbsh_e 50 set nbsh_e 49
set nbsh_w 2 set nbsh_w 2

View File

@ -2,7 +2,7 @@ puts "TODO OCC23068 ALL: Error : big tolerance of shape result"
restore [locate_data_file offset_wire_024.brep] s restore [locate_data_file offset_wire_024.brep] s
set length 42.8997 set length 42.8997
set nbsh_v 40 set nbsh_v 44
set nbsh_e 40 set nbsh_e 44
set nbsh_w 1 set nbsh_w 1

View File

@ -2,11 +2,13 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "TODO OCC24255 ALL: Error : big tolerance of shape result"
restore [locate_data_file offset_wire_071.brep] s restore [locate_data_file offset_wire_071.brep] s
set length 0 set length 121794
set nbsh_v 0 set nbsh_v 205
set nbsh_e 0 set nbsh_e 205
set nbsh_w 0 set nbsh_w 1

View File

@ -2,7 +2,7 @@
restore [locate_data_file offset_wire_075.brep] s restore [locate_data_file offset_wire_075.brep] s
set length 326.251 set length 326.251
set nbsh_v 104 set nbsh_v 100
set nbsh_e 104 set nbsh_e 100
set nbsh_w 1 set nbsh_w 1

View File

@ -7,8 +7,8 @@ puts "TODO OCC24156 MacOS: Error : The length of the resulting shape is"
puts "TODO OCC24156 MacOS: Error : The resulting shape is WRONG" puts "TODO OCC24156 MacOS: Error : The resulting shape is WRONG"
restore [locate_data_file offset_wire_001.brep] s restore [locate_data_file offset_wire_001.brep] s
set length 0 set length 11.6898
set nbsh_v 0 set nbsh_v 23
set nbsh_e 0 set nbsh_e 23
set nbsh_w 0 set nbsh_w 1

View File

@ -1,11 +1,8 @@
puts "TODO OCC23068 ALL: Error : big tolerance of shape result_2"
puts "TODO OCC23068 ALL: Error : The length of the resulting shape is"
puts "TODO OCC23068 ALL: Error : The resulting shape is WRONG"
restore [locate_data_file offset_wire_022.brep] s restore [locate_data_file offset_wire_022.brep] s
set length 238.448 set length 215.745
set nbsh_v 40 set nbsh_v 39
set nbsh_e 40 set nbsh_e 39
set nbsh_w 2 set nbsh_w 2

View File

@ -2,7 +2,7 @@ puts "TODO OCC23068 ALL: Error : big tolerance of shape result"
restore [locate_data_file offset_wire_024.brep] s restore [locate_data_file offset_wire_024.brep] s
set length 49.1476 set length 49.1476
set nbsh_v 40 set nbsh_v 44
set nbsh_e 40 set nbsh_e 44
set nbsh_w 1 set nbsh_w 1

View File

@ -4,6 +4,6 @@ puts "TODO ?OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_"
restore [locate_data_file offset_wire_026.brep] s restore [locate_data_file offset_wire_026.brep] s
set length 25688.3 set length 25688.3
set nbsh_v 319 set nbsh_v 315
set nbsh_e 319 set nbsh_e 315
set nbsh_w 1 set nbsh_w 1

Some files were not shown because too many files have changed in this diff Show More