1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

Compare commits

...

23 Commits

Author SHA1 Message Date
aml
38b8654f74 0025861: Wrong result obtained by projection algorithm.
Handling of trimmed analytical surfaces added in extrema PS.

New draw-command and test case for issue CR25861

Correction of test case for issue CR25861
2015-03-10 15:22:20 +03:00
nbv
de6d39c92a 0025782: The result of intersection between two cylinders is incorrect
1. Cylinders are tangent to each other indeed. Fix processes this case.
2. Algorithm of intersection line computing (in case of cylinders with two parallel axes) has been changed.

Test cases for issue CR25782
2015-03-10 15:08:46 +03:00
kgv
49dd2f7d93 0025511: Visualization - drop redundant viewer option V3d_View::Transparency()
Visual3d_ViewManager, activate texturing by default.

Update Qt sample

Conflicts:
	src/AIS/AIS_InteractiveContext.cxx
2015-01-15 09:38:11 +03:00
kgv
147dfa6daa 0025664: Visualization - dynamic highlighting should not be discarded on re-displaying independent object
Clear list of immediate presentations in proper place - in AIS_LocalContext::manageDetected()
instead of AIS_LocalContext::Unhilight().
2015-01-14 15:03:34 +03:00
kgv
e168ba53aa Apply changes made in CR25466: code cleanup 2014-12-29 16:28:56 +03:00
jgv
35f8794fb2 0025657: Bad result of Fillet operation 2014-12-27 14:40:45 +03:00
kgv
971feb7608 0025637: Objects displayed in LocalContext are not listed in displayed objects of interactive context
Revert OCCT_DEBUG changes in method AIS_InteractiveContext::DisplayedObjects().
2014-12-24 12:45:05 +03:00
jgv
0435af7b21 0025592: Bad result of Fillet operation 2014-12-23 12:16:07 +03:00
aml
b8265cb716 0025559: SIGSEGV in TKMath when computing max tolerance of curve on surface
Fixed possible being outside the boundaries.
2014-12-08 14:13:18 +03:00
vsr
5c4a9ab709 0025559: SIGSEGV in TKMath when computing max tolerance of curve on surface 2014-12-08 11:24:49 +03:00
aba
80712f4646 0025492: the selected subshape does not have topological relationship with orginal shape in OCC680:
returned identity owner location if the selectable object has identity transformation.
2014-12-08 11:24:26 +03:00
vsr
79fb9ef82f Adjusting testing cases 2014-12-08 11:22:09 +03:00
nbv
af4b075434 0025465: Excess vertex in the result of CUT operation
1. Methods ClearVertexes(), RemoveVertex(...) and InsertVertexBefore(...) was added to the IntPatch_WLine class.
2. Function IsSame(...) for IntSurf_PntOn2S was added (see IntSurf_PntOn2S.cdl for detail information).
3. Concatenate WLine got if it is possible.

Some test cases were changed according to their new behavior.
2014-12-04 10:19:39 +03:00
san
4ece81d4a9 0025528: Visualization - Exception on removing an interactive object from a local context
AIS_LocalContext::Remove() corrected to unbind the argument from
myActiveObjects at the very end. Also some code clean up applied
(e.g. duplicated AddOrRemoveSelected() call removed, formatting corrected).
2014-12-04 09:51:06 +03:00
bugmaster
c35f2ea77d 0025494: Wrong result obtained by projection algorithm
Calculation of last parameter of projected curve was changed for the projecting of a curve to surface of revolution, if the curve is intersected with the axis of revolution

Test case for issue CR25494
2014-12-04 09:41:25 +03:00
pkv
99c01c8ae2 0025505: General Fuse produces self-intersection shape
Changes:
class BOPAlgo_BuilderSolid
method:
void BOPAlgo_BuilderSolid::PerformAreas()

The misprint has been corrected

Test case for issue CR25505
2014-12-04 09:41:10 +03:00
gka
a54ca2f54c 0025455: fixshape works at the second attempt
Added check and fix of tolerances of all vertices after performing all fixes.
It is necessary to avoid situation when point of vertex belonging a few faces was changed for current face
but edges containing this vertex belonging before fixed face are not taking into account.
Mode FixVertexTolMode to manage check tolerance of vertices was added in ShapeFix_Shape
class. (default value is equal to -1)
Method to change FixVertexTolMode mode  FixVertexTolMode() was added in ShapeFix_Shape class

Test case for CR25455
2014-12-04 09:40:40 +03:00
nbv
cb793355eb 0025488: Wrong result of two trimmed cylinders intersection
1. Function IsSame(...) for IntSurf_PntOn2S was added (see IntSurf_PntOn2S.cdl for detail information).
2. Inserting additional points is forbidden if existing WLine contains only two points coincided.

Test-case for issue #25488
2014-12-04 09:40:09 +03:00
jgv
aba7d78e18 0025480: Incorrect result of BRepOffsetAPI_MakePipe
Test case for CR25480
2014-12-04 09:39:58 +03:00
pkv
a055a8d960 0025456: BOPAlgo_CheckerSI reports an error on the given shape
Changes:
1. class IntTools_FaceFace
         method:
         void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
                                    const Handle(Adaptor3d_TopolTool)& dom1,
                                    const Handle(Adaptor3d_TopolTool)& dom2)

The value of testing parameter has been changed for the cases of infinite curves

Test case for issue CR25456
2014-12-04 09:39:38 +03:00
pkv
7c5f06ad43 0025449: Excess vertex in result of General Fuse operation.
Changes:
1. class IntTools_EdgeFace
     method:
     Standard_Boolean IntTools_EdgeFace::CheckTouchVertex
     (const IntTools_CommonPrt& aCP,
     Standard_Real& aTx)

The parametric size of the contact zone between vertex and face has been changed

Test cases for issue CR25449
2014-12-04 09:38:31 +03:00
pkv
87f9c8d218 0025450: Common operation returns wrong shape
Changes:
class BOPAlgo_PaveFiller
 method:
 void BOPAlgo_PaveFiller::PerformEF()

 The index of the face has been added in post-treatment map

Test cases for issue CR25450

Correction of test case for issue CR25450
2014-12-04 09:38:18 +03:00
pkv
1f349b3c2c 0025432: Wrong result obtained by MakerVolume operator.
Changes:
class BOPTools_AlgoTools
static function:
Standard_Boolean FindPointInFace(const TopoDS_Face& aF,
                                 const gp_Pnt& aP,
                                 gp_Dir& aDB,
                                 gp_Pnt& aPOut,
                                 Handle(IntTools_Context)& theContext,
                                 GeomAPI_ProjectPointOnSurf& aProjPL,
                                 const Standard_Real aDt,
                                 const Standard_Real aTolE)

Binormal calculation starts from the point located outside the tolerance circle of the edge

Test case for issue CR25432

Correction of test cases for issue CR25432
2014-12-04 09:37:40 +03:00
108 changed files with 4582 additions and 2530 deletions

View File

@@ -51,7 +51,6 @@ Viewer::Viewer(QWidget* parent):QWidget(parent)
myView->MustBeResized();
myView->SetSurfaceDetail(V3d_TEX_NONE);
myView->SetTransparency(Standard_True);
myView->SetSize(10000.0);
myView->SetZSize(10000.0);
myView->SetViewMappingDefault();

View File

@@ -268,15 +268,6 @@ is
-- inWhichLocal gives the local context in which anIObj
-- is displayed. By default, the index -1 refers to the last
-- Local Context opened.
Clear(me : mutable;
aniobj : InteractiveObject from AIS;
updateviewer : Boolean from Standard = Standard_True);
---Purpose: Removes the interactive object aniobj from all viewers.
-- If a local context is open and if updateviewer equals
-- Standard_False, the presentation of the Interactive
-- Object activates the selection mode; the object is
-- displayed but no viewer will be updated.
ClearPrs( me :mutable;
aniobj : InteractiveObject from AIS;
@@ -2046,6 +2037,16 @@ is
PurgeViewer(me:mutable;Vwr:Viewer from V3d)
returns Integer from Standard is static private;
redisplayPrsModes (me : mutable;
theIObj : InteractiveObject from AIS;
theToUpdateViewer : Boolean from Standard = Standard_True) is static private;
---Purpose: UNKNOWN
redisplayPrsRecModes (me : mutable;
theIObj : InteractiveObject from AIS;
theToUpdateViewer : Boolean from Standard = Standard_True) is static private;
---Purpose: UNKNOWN
fields
myObjects : DataMapOfIOStatus from AIS;

3286
src/AIS/AIS_InteractiveContext.cxx Normal file → Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -445,65 +445,67 @@ void AIS_LocalContext::Deactivate(const Handle(AIS_InteractiveObject)& aSelectab
Standard_Boolean AIS_LocalContext::Remove(const Handle(AIS_InteractiveObject)& aSelectable)
{
if(!myActiveObjects.IsBound(aSelectable)) return Standard_False;
if(!myActiveObjects.IsBound (aSelectable))
{
return Standard_False;
}
if (IsSelected (aSelectable))
{
AddOrRemoveSelected (aSelectable, Standard_False);
}
const Handle(AIS_LocalStatus)& Att = myActiveObjects (aSelectable);
if(IsSelected(aSelectable))
AddOrRemoveSelected(aSelectable,Standard_False);
const Handle(AIS_LocalStatus)& Att = myActiveObjects(aSelectable);
TColStd_ListIteratorOfListOfInteger It;
// it is checked which were the temporary attributes
// and they are set to 0
// desactivate standard modes
if(Att->Decomposed()){
for(It.Initialize(myListOfStandardMode);It.More();It.Next()){
mySM->Deactivate(aSelectable,It.Value(),myMainVS);
// Deactivate standard modes
if (Att->Decomposed())
{
for (It.Initialize (myListOfStandardMode); It.More(); It.Next())
{
mySM->Deactivate (aSelectable, It.Value(), myMainVS);
}
}
// if object or temporary presentations...
if(Att->IsTemporary())
{
if(Att->IsSubIntensityOn())
myMainPM->Unhighlight(aSelectable,Att->HilightMode());
// remove if bug on clear correct...
myMainPM->Erase(aSelectable,Att->DisplayMode());
myMainPM->Clear(aSelectable,Att->DisplayMode());
if(myMainPM->IsDisplayed(aSelectable,Att->HilightMode()))
myMainPM->Erase(aSelectable,Att->HilightMode());
// myMainPM->Clear(aSelectable,Att->HilightMode());
}
// if below intensity
else
{
if(Att->IsSubIntensityOn())
myCTX->SubIntensityOff(aSelectable);
}
// desactivate stored proper modes
for(It.Initialize(Att->SelectionModes());It.More();It.Next()){
mySM->Deactivate(aSelectable,It.Value(),myMainVS);
}
// pop : si je laisses cela plantes dans les elements de construction
// alors a toi de jouer ROB
// RemoveSelected(aSelectable);
if(IsSelected(aSelectable))
AddOrRemoveSelected(aSelectable);
myActiveObjects.UnBind(aSelectable);
// If object or temporary presentations
if (Att->IsTemporary())
{
if (Att->IsSubIntensityOn())
{
myMainPM->Unhighlight (aSelectable, Att->HilightMode());
}
myMainPM->Erase (aSelectable, Att->DisplayMode());
myMainPM->Clear (aSelectable, Att->DisplayMode());
if (myMainPM->IsDisplayed (aSelectable, Att->HilightMode()))
{
myMainPM->Erase (aSelectable, Att->HilightMode());
}
}
// If subintensity used
else if (Att->IsSubIntensityOn())
{
myCTX->SubIntensityOff (aSelectable);
}
// Deactivate stored selection modes
for (It.Initialize (Att->SelectionModes()); It.More(); It.Next())
{
mySM->Deactivate (aSelectable, It.Value(), myMainVS);
}
// Remove the interactive object from selection manager
if (mySM->Contains (aSelectable))
{
mySM->Remove (aSelectable);
}
UpdateSort();
ClearOutdatedSelection (aSelectable, Standard_True);
// This should be done at the very end because most methods use
// myActiveObjects even during clean-up
myActiveObjects.UnBind (aSelectable);
return Standard_True;
}

View File

@@ -153,6 +153,7 @@ AIS_StatusOfDetection AIS_LocalContext::MoveTo (const Standard_Integer theXpix,
{
if (mylastindex != 0 && mylastindex <= myMapOfOwner.Extent())
{
myMainPM->ClearImmediateDraw();
Unhilight (myMapOfOwner (mylastindex), theView);
if (theToRedrawImmediate)
{
@@ -376,6 +377,7 @@ AIS_StatusOfPick AIS_LocalContext::ShiftSelect (const Standard_Boolean toUpdateV
if(myAutoHilight)
{
myMainPM->ClearImmediateDraw();
const Handle(V3d_Viewer)& aViewer = myCTX->CurrentViewer();
for (aViewer->InitActiveViews(); aViewer->MoreActiveViews(); aViewer->NextActiveViews())
{
@@ -545,7 +547,6 @@ void AIS_LocalContext::Unhilight (const Handle(SelectMgr_EntityOwner)& theOwner,
return;
}
myMainPM->ClearImmediateDraw();
const Standard_Integer aHilightMode = GetHiMod (Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable()));
if (IsSelected (theOwner))
{
@@ -1044,6 +1045,10 @@ void AIS_LocalContext::ClearOutdatedSelection (const Handle(AIS_InteractiveObjec
myMapOfOwner.Clear();
myMapOfOwner.Assign (anOwnersToKeep);
mylastindex = myMapOfOwner.FindIndex (aLastPicked);
if (!IsValidIndex (mylastindex))
{
myMainPM->ClearImmediateDraw();
}
if (!isAISRemainsDetected)
{
@@ -1197,6 +1202,7 @@ void AIS_LocalContext::manageDetected (const Handle(SelectMgr_EntityOwner)& theP
{
if (thePickOwner.IsNull())
{
myMainPM->ClearImmediateDraw();
if (theToRedrawImmediate)
{
theView->RedrawImmediate();
@@ -1248,6 +1254,7 @@ void AIS_LocalContext::manageDetected (const Handle(SelectMgr_EntityOwner)& theP
if (aNewIndex != mylastindex
|| thePickOwner->IsForcedHilight())
{
myMainPM->ClearImmediateDraw();
if (mylastindex != 0
&& mylastindex <= myMapOfOwner.Extent())
{
@@ -1270,7 +1277,7 @@ void AIS_LocalContext::manageDetected (const Handle(SelectMgr_EntityOwner)& theP
mylastindex = aNewIndex;
}
if (mylastindex)
if (mylastindex != 0)
{
mylastgood = mylastindex;
}

View File

@@ -684,8 +684,8 @@ void BOPAlgo_BuilderSolid::PerformAreas()
}
//
if (aInOutMap.IsBound (aHole)){
const TopoDS_Shape& aHole2=aInOutMap(aHole);
if (IsInside(aHole, aHole2, myContext)) {
const TopoDS_Shape& aSolidWas=aInOutMap(aHole);
if (IsInside(aSolid, aSolidWas, myContext)) {
aInOutMap.UnBind(aHole);
aInOutMap.Bind (aHole, aSolid);
}

View File

@@ -267,7 +267,6 @@ void BOPAlgo_PaveFiller::PerformEF()
aPB->Indices(nV[0], nV[1]);
//
BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF);
////const BOPDS_IndexedMapOfPaveBlock& aMPBF=aFI.PaveBlocksOn();
const BOPCol_MapOfInteger& aMIFOn=aFI.VerticesOn();
const BOPCol_MapOfInteger& aMIFIn=aFI.VerticesIn();
//~~~
@@ -305,7 +304,9 @@ void BOPAlgo_PaveFiller::PerformEF()
aEF.SetIndices(nE, nF);
aEF.SetCommonPart(aCP);
myDS->AddInterf(nE, nF);
// 3
//
aMIEFC.Add(nF);
//
BOPAlgo_Tools::FillMap(aPB, nF, aMPBLI, aAllocator);
break;
}

View File

@@ -99,7 +99,8 @@ static
gp_Pnt& aPOut,
Handle(IntTools_Context)& theContext,
GeomAPI_ProjectPointOnSurf& aProjPL,
const Standard_Real aDt);
const Standard_Real aDt,
const Standard_Real aTolE);
static
Standard_Real MinStep3D(const TopoDS_Edge& theE1,
const TopoDS_Face& theF1,
@@ -1825,14 +1826,18 @@ void GetFaceDir(const TopoDS_Edge& aE,
GeomAPI_ProjectPointOnSurf& aProjPL,
const Standard_Real aDt)
{
Standard_Real aTolE;
gp_Pnt aPx;
//
BOPTools_AlgoTools3D::GetNormalToFaceOnEdge(aE, aF, aT, aDN);
if (aF.Orientation()==TopAbs_REVERSED){
aDN.Reverse();
}
//
aTolE=BRep_Tool::Tolerance(aE);
aDB = aDN^aDTgt;
//
gp_Pnt aPx;
if (!FindPointInFace(aF, aP, aDB, aPx, theContext, aProjPL, aDt)) {
if (!FindPointInFace(aF, aP, aDB, aPx, theContext, aProjPL, aDt, aTolE)) {
BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge(aE, aF, aT, aPx,
aDN, theContext);
aProjPL.Perform(aPx);
@@ -1841,7 +1846,6 @@ void GetFaceDir(const TopoDS_Edge& aE,
aDB.SetXYZ(aVec.XYZ());
}
}
//=======================================================================
//function : FindPointInFace
//purpose : Find a point in the face in direction of <aDB>
@@ -1852,12 +1856,13 @@ Standard_Boolean FindPointInFace(const TopoDS_Face& aF,
gp_Pnt& aPOut,
Handle(IntTools_Context)& theContext,
GeomAPI_ProjectPointOnSurf& aProjPL,
const Standard_Real aDt)
const Standard_Real aDt,
const Standard_Real aTolE)
{
Standard_Integer aNbItMax;
Standard_Real aDist, aDTol, aPM;
Standard_Boolean bRet;
gp_Pnt aP1;
gp_Pnt aP1, aPS;
//
aDTol = Precision::Angular();
aPM = aP.XYZ().Modulus();
@@ -1869,10 +1874,27 @@ Standard_Boolean FindPointInFace(const TopoDS_Face& aF,
//
GeomAPI_ProjectPointOnSurf& aProj=theContext->ProjPS(aF);
//
aPS=aP;
aProj.Perform(aPS);
if (!aProj.IsDone()) {
return bRet;
}
aPS=aProj.NearestPoint();
aProjPL.Perform(aPS);
aPS=aProjPL.NearestPoint();
//
aPS.SetXYZ(aPS.XYZ()+2.*aTolE*aDB.XYZ());
aProj.Perform(aPS);
if (!aProj.IsDone()) {
return bRet;
}
aPS=aProj.NearestPoint();
aProjPL.Perform(aPS);
aPS=aProjPL.NearestPoint();
//
//
do {
aP1.SetCoord(aP.X()+aDt*aDB.X(),
aP.Y()+aDt*aDB.Y(),
aP.Z()+aDt*aDB.Z());
aP1.SetXYZ(aPS.XYZ()+aDt*aDB.XYZ());
//
aProj.Perform(aP1);
if (!aProj.IsDone()) {
@@ -1884,7 +1906,7 @@ Standard_Boolean FindPointInFace(const TopoDS_Face& aF,
aProjPL.Perform(aPOut);
aPOut = aProjPL.NearestPoint();
//
gp_Vec aV(aP, aPOut);
gp_Vec aV(aPS, aPOut);
aDB.SetXYZ(aV.XYZ());
} while (aDist > aDTol && --aNbItMax);
//
@@ -2006,8 +2028,8 @@ Standard_Boolean BOPTools_AlgoTools::IsOpenShell(const TopoDS_Shell& aSh)
//function : IsInvertedSolid
//purpose :
//=======================================================================
Standard_Boolean
BOPTools_AlgoTools::IsInvertedSolid(const TopoDS_Solid& aSolid)
Standard_Boolean BOPTools_AlgoTools::IsInvertedSolid
(const TopoDS_Solid& aSolid)
{
Standard_Real aTolS;
TopAbs_State aState;

View File

@@ -344,6 +344,8 @@ class BOPTools_CheckCurveOnSurface :
Standard_Real& theFVal) {
try {
const Standard_Real aPar = theX(1);
if (!CheckParameter(aPar))
return Standard_False;
gp_Pnt aP1, aP2;
gp_Pnt2d aP2d;
my3DCurve->D0(aPar, aP1);
@@ -367,7 +369,8 @@ class BOPTools_CheckCurveOnSurface :
math_Vector& theGrad) {
try {
const Standard_Real aPar = theX(1);
if (!CheckParameter(aPar))
return Standard_False;
gp_Pnt aP1, aP2;
gp_Vec aDC3D, aDSU, aDSV;
gp_Pnt2d aP2d;
@@ -417,6 +420,19 @@ class BOPTools_CheckCurveOnSurface :
}
//
private:
Standard_Boolean CheckParameter(const Standard_Real theParam)
{
if (theParam < my3DCurve->FirstParameter() ||
theParam > my3DCurve->LastParameter() ||
theParam < my2DCurve->FirstParameter() ||
theParam > my2DCurve->LastParameter() )
{
return Standard_False;
}
return Standard_True;
}
Handle(Geom_Curve) my3DCurve;
Handle(Geom2d_Curve) my2DCurve;
Handle(Geom_Surface) mySurf;

View File

@@ -274,18 +274,9 @@ void BRepFill_Pipe::Perform(const TopoDS_Wire& Spine,
}
ShapeUpgrade_RemoveLocations RemLoc;
RemLoc.SetRemoveLevel(TopAbs_COMPOUND);
RemLoc.Remove(myFirst);
myFirst = RemLoc.GetResult();
TopLoc_Location theLoc = myFirst.Location();
if (!theLoc.IsIdentity())
{
TopoDS_Shape NewMyFirst = BRepBuilderAPI_Copy(myFirst);
RemLoc.Remove(NewMyFirst);
NewMyFirst = RemLoc.GetResult();
TopLoc_Location theIdentity;
NewMyFirst.Location(theIdentity);
myFirst = BRepBuilderAPI_Transform(NewMyFirst, theLoc.Transformation(), Standard_True);
}
myLoc->Law(myLoc->NbLaw())->GetDomain(first, last);
myLoc->Law(myLoc->NbLaw())->D0(last,M, V);
@@ -308,16 +299,6 @@ void BRepFill_Pipe::Perform(const TopoDS_Wire& Spine,
RemLoc.Remove(myLast);
myLast = RemLoc.GetResult();
theLoc = myLast.Location();
if (!theLoc.IsIdentity())
{
TopoDS_Shape NewMyLast = BRepBuilderAPI_Copy(myLast);
RemLoc.Remove(NewMyLast);
NewMyLast = RemLoc.GetResult();
TopLoc_Location theIdentity;
NewMyLast.Location(theIdentity);
myLast = BRepBuilderAPI_Transform(NewMyLast, theLoc.Transformation(), Standard_True);
}
#if DRAW
if (Affich) {

View File

@@ -45,6 +45,7 @@ uses Point from Blend,
Transition from IntSurf,
Function from Blend,
FuncInv from Blend,
HElSpine from ChFiDS,
State from TopAbs
@@ -66,6 +67,7 @@ is
Perform(me: in out; F : in out Function from Blend;
FInv : in out FuncInv from Blend;
HGuide : HElSpine from ChFiDS;
Pdep : Real from Standard;
Pmax : Real from Standard;
MaxStep : Real from Standard;
@@ -164,6 +166,7 @@ is
InternalPerform (me: in out;F : in out Function from Blend;
FInv : in out FuncInv from Blend;
HGuide : HElSpine from ChFiDS;
Bound : Real from Standard)
is static private;

View File

@@ -56,6 +56,7 @@ void Blend_Walking::AddSingularPoint(const Blend_Point& P)
void Blend_Walking::Perform(Blend_Function& Func,
Blend_FuncInv& FuncInv,
const Handle(ChFiDS_HElSpine)& HGuide,
const Standard_Real Pdep,
const Standard_Real Pmax,
const Standard_Real MaxStep,
@@ -154,7 +155,7 @@ void Blend_Walking::Perform(Blend_Function& Func,
}
}
InternalPerform(Func,FuncInv,Pmax);
InternalPerform(Func,FuncInv,HGuide,Pmax);
done = Standard_True;
}
@@ -461,7 +462,8 @@ Standard_Boolean Blend_Walking::Continu(Blend_Function& Func,
previousP.ParametersOnS1(sol(1),sol(2));
previousP.ParametersOnS2(sol(3),sol(4));
InternalPerform(Func,FuncInv,P);
Handle(ChFiDS_HElSpine) anHGuide;
InternalPerform(Func,FuncInv,anHGuide,P);
return Standard_True;
}
@@ -502,7 +504,8 @@ Standard_Boolean Blend_Walking::Continu(Blend_Function& Func,
if(OnS1) clasonS1 = Standard_False;
else clasonS2 = Standard_False;
InternalPerform(Func,FuncInv,P);
Handle(ChFiDS_HElSpine) anHGuide;
InternalPerform(Func,FuncInv,anHGuide,P);
clasonS1 = Standard_True;
clasonS2 = Standard_True;
@@ -548,7 +551,8 @@ Standard_Boolean Blend_Walking::Complete(Blend_Function& Func,
previousP.ParametersOnS1(sol(1),sol(2));
previousP.ParametersOnS2(sol(3),sol(4));
InternalPerform(Func,FuncInv,Pmin);
Handle(ChFiDS_HElSpine) anHGuide;
InternalPerform(Func,FuncInv,anHGuide,Pmin);
iscomplete = Standard_True;
return Standard_True;

View File

@@ -12,6 +12,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <gce_MakePln.hxx>
static void evalpinit(math_Vector& parinit,
const Blend_Point& previousP,
const Standard_Real parprec,
@@ -65,6 +67,7 @@ static void evalpinit(math_Vector& parinit,
void Blend_Walking::InternalPerform(Blend_Function& Func,
Blend_FuncInv& FuncInv,
const Handle(ChFiDS_HElSpine)& HGuide,
const Standard_Real Bound)
{
@@ -251,12 +254,64 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
// avec les surfaces periodiques.
State = Blend_OnRst12;
param = (w1+w2)/2;
gp_Pnt Pnt1, Pnt2;
p2d = TheArcTool::Value(recdomain1->Value(),solrst1(1));
sol(1) = p2d.X();
sol(2) = p2d.Y();
Pnt1 = TheSurfaceTool::Value(surf1,sol(1),sol(2));
p2d = TheArcTool::Value(recdomain2->Value(),solrst2(1));
sol(3) = p2d.X();
sol(4) = p2d.Y();
Pnt2 = TheSurfaceTool::Value(surf2,sol(3),sol(4));
if (!HGuide.IsNull())
{
const Standard_Real TolProd = 1.e-5;
Standard_Real SavedParams [2];
Standard_Boolean SameDirs [2] = {Standard_False, Standard_False};
ChFiDS_ElSpine& theElSpine = HGuide->ChangeCurve();
SavedParams[0] = theElSpine.GetSavedFirstParameter();
SavedParams[1] = theElSpine.GetSavedLastParameter();
for (Standard_Integer ind = 0; ind < 2; ind++)
{
if (!Precision::IsInfinite(SavedParams[ind]))
{
//Check the original first and last parameters of guide curve
//for equality to found parameter <param>:
//check equality of tangent to guide curve and
//normal to plane built on 3 points:
//point on guide curve and points on restrictions of adjacent
//surfaces.
gp_Pnt Pnt0;
gp_Vec Dir0;
HGuide->D1(SavedParams[ind], Pnt0, Dir0);
Standard_Real Length = Dir0.Magnitude();
if (Length <= gp::Resolution())
continue;
Dir0 /= Length;
gce_MakePln PlaneBuilder(Pnt0, Pnt1, Pnt2);
if (!PlaneBuilder.IsDone())
continue;
gp_Pln thePlane = PlaneBuilder.Value();
gp_Dir DirPlane = thePlane.Axis().Direction();
gp_Vec theProd = Dir0 ^ DirPlane;
Standard_Real ProdMod = theProd.Magnitude();
if (ProdMod <= TolProd)
SameDirs[ind] = Standard_True;
}
}
Standard_Real theParam = Precision::Infinite();
//Choose the closest parameter
if (SameDirs[0] && SameDirs[1])
theParam = (Abs(param - SavedParams[0]) < Abs(param - SavedParams[1]))?
SavedParams[0] : SavedParams[1];
else if (SameDirs[0])
theParam = SavedParams[0];
else if (SameDirs[1])
theParam = SavedParams[1];
if (!Precision::IsInfinite(theParam))
param = theParam;
}
}
else if (recad1) {
// sol sur 1

View File

@@ -1862,10 +1862,13 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
Standard_Real wl = Guide.LastParameter();
Standard_Real locfleche = (wl - wf) * fleche;
Standard_Real wfsav = wf, wlsav = wl;
//Now the ElSpine is artificially extended to help rsnld.
Standard_Real prab = 0.01;
Guide.FirstParameter(wf-prab*(wl-wf));
Guide.LastParameter (wl+prab*(wl-wf));
if (!Guide.IsPeriodic())
{
//Now the ElSpine is artificially extended to help rsnld.
Standard_Real prab = 0.01;
Guide.FirstParameter(wf-prab*(wl-wf));
Guide.LastParameter (wl+prab*(wl-wf));
}
Handle(ChFiDS_Spine)& Spine = Stripe->ChangeSpine();
Standard_Integer ii, nbed = Spine->NbEdges();
Standard_Real lastedlastp = Spine->LastParameter(nbed);
@@ -1920,7 +1923,9 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
Last = wf;
if(Guide.IsPeriodic()) {
Last = First - Guide.Period();
Guide.SaveFirstParameter();
Guide.FirstParameter(Last);
Guide.SaveLastParameter();
Guide.LastParameter (First * 1.1);//Extension to help rsnld.
}
}

View File

@@ -1573,7 +1573,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
if (5*TolGuide > MS) TolGuide = MS/5;
if (5*TolEsp > MS) TolEsp = MS/5;
}
TheWalk.Perform(Func,FInv,NewFirst,Target,MS,TolGuide,
TheWalk.Perform(Func,FInv,HGuide,NewFirst,Target,MS,TolGuide,
ParSol,TolEsp,Fleche,Appro);
if (!TheWalk.IsDone()) {
#ifdef OCCT_DEBUG
@@ -2113,7 +2113,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
if (5*TolEsp > MS) TolEsp = MS/5;
}
TheWalk.Perform(Func,FInv,NewFirst,Target,MS,TolGuide,
TheWalk.Perform(Func,FInv,HGuide,NewFirst,Target,MS,TolGuide,
ParSol,TolEsp,Fleche,Appro);
if (!TheWalk.IsDone()) {

View File

@@ -371,8 +371,7 @@ static Standard_Boolean Update(Handle(Adaptor3d_HSurface)& face,
pared = ponc1.Parameter();
parltg = ponc2.Parameter();
if ((parltg > f) && (parltg < l)) {
#ifdef OCC23139
////modified by jgv, 10.05.2012 for the bug 23139////
////modified by jgv, 10.05.2012 for the bug 23139, 25657////
Handle(Geom2d_Curve) PConF = fi.PCurveOnFace();
if (!PConF.IsNull())
{
@@ -393,7 +392,6 @@ static Standard_Boolean Update(Handle(Adaptor3d_HSurface)& face,
}
}
/////////////////////////////////////////////////////
#endif
fi.SetParameter(parltg,isfirst);
cp.SetArc(cp.Tolerance(),cp.Arc(),pared,cp.TransitionOnArc());
return Standard_True;

View File

@@ -50,6 +50,10 @@ is
LastParameter(me) returns Real from Standard
is redefined;
GetSavedFirstParameter(me) returns Real from Standard;
GetSavedLastParameter(me) returns Real from Standard;
Continuity(me) returns Shape from GeomAbs
is redefined static;
@@ -102,6 +106,10 @@ is
LastParameter(me : in out; P : Real from Standard);
SaveFirstParameter(me : in out);
SaveLastParameter(me : in out);
SetOrigin(me : in out; O : Real from Standard);
FirstPointAndTgt(me; P : out Pnt from gp; T : out Vec from gp);
@@ -188,5 +196,7 @@ plast : Real from Standard;
period : Real from Standard;
periodic : Boolean from Standard;
pfirstsav : Real from Standard;
plastsav : Real from Standard;
end ElSpine;

View File

@@ -27,6 +27,8 @@
ChFiDS_ElSpine::ChFiDS_ElSpine():periodic(0)
{
pfirstsav = Precision::Infinite();
plastsav = Precision::Infinite();
}
@@ -51,6 +53,26 @@ Standard_Real ChFiDS_ElSpine::LastParameter() const
return plast;
}
//=======================================================================
//function : GetSavedFirstParameter
//purpose :
//=======================================================================
Standard_Real ChFiDS_ElSpine::GetSavedFirstParameter() const
{
return pfirstsav;
}
//=======================================================================
//function : GetSavedLastParameter
//purpose :
//=======================================================================
Standard_Real ChFiDS_ElSpine::GetSavedLastParameter() const
{
return plastsav;
}
//=======================================================================
//function : Continuity
//purpose :
@@ -229,6 +251,26 @@ void ChFiDS_ElSpine::LastParameter(const Standard_Real P)
plast = P;
}
//=======================================================================
//function : SaveFirstParameter
//purpose :
//=======================================================================
void ChFiDS_ElSpine::SaveFirstParameter()
{
pfirstsav = pfirst;
}
//=======================================================================
//function : SaveLastParameter
//purpose :
//=======================================================================
void ChFiDS_ElSpine::SaveLastParameter()
{
plastsav = plast;
}
//=======================================================================
//function : SetOrigin

View File

@@ -110,10 +110,22 @@ void Extrema_ExtPS::TreatSolution (const Extrema_POnSurf& PS,
Standard_Real U, V;
PS.Parameter(U, V);
if (myS->IsUPeriodic()) {
U = ElCLib::InPeriod(U, myuinf, myuinf+myS->UPeriod());
U = ElCLib::InPeriod(U, myuinf, myuinf + myS->UPeriod());
// Handle trimmed surfaces.
if (U > myusup + mytolu)
U -= myS->UPeriod();
if (U < myuinf - mytolu)
U += myS->UPeriod();
}
if (myS->IsVPeriodic()) {
V = ElCLib::InPeriod(V, myvinf, myvinf+myS->VPeriod());
V = ElCLib::InPeriod(V, myvinf, myvinf + myS->VPeriod());
// Handle trimmed surfaces.
if (V > myvsup + mytolv)
V -= myS->VPeriod();
if (V < myvinf - mytolv)
V += myS->VPeriod();
}
if ((myuinf-U) <= mytolu && (U-myusup) <= mytolu &&
(myvinf-V) <= mytolv && (V-myvsup) <= mytolv) {

View File

@@ -261,12 +261,6 @@ is
is deferred;
---Purpose: call_togl_setvisualisation
Transparency ( me : mutable;
ACView : CView from Graphic3d;
AFlag : Boolean from Standard )
is deferred;
---Purpose: call_togl_transparency
View ( me : mutable;
ACView : in out CView from Graphic3d )
returns Boolean from Standard

View File

@@ -977,6 +977,8 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cylinder& Cyl1,
gp_Dir DirCyl = Cyl1.Position().Direction();
Standard_Real ProjP2OnDirCyl1=gp_Vec(DirCyl).Dot(gp_Vec(P1,P2t));
//P2 is a projection the location of the 2nd cylinder on the base
//of the 1st cylinder
P2.SetCoord(P2t.X() - ProjP2OnDirCyl1*DirCyl.X(),
P2t.Y() - ProjP2OnDirCyl1*DirCyl.Y(),
P2t.Z() - ProjP2OnDirCyl1*DirCyl.Z());
@@ -987,7 +989,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cylinder& Cyl1,
typeres=IntAna_Empty;
nbint=0;
}
else if(DistA1A2>(R1pR2))
else if((R1pR2 - DistA1A2) <= RealSmall())
{
//-- 1 Tangent line -------------------------------------OK
typeres=IntAna_Line;
@@ -1005,32 +1007,85 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cylinder& Cyl1,
typeres=IntAna_Line;
nbint=2;
dir1=DirCyl;
gp_Vec P1P2(P1,P2);
gp_Dir DirA1A2=gp_Dir(P1P2);
gp_Dir Ortho_dir1_P1P2 = dir1.Crossed(DirA1A2);
dir2=dir1;
Standard_Real Alpha=0.5*(R1*R1-R2*R2+DistA1A2*DistA1A2)/(DistA1A2);
//Standard_Real Beta = Sqrt(R1*R1-Alpha*Alpha);
Standard_Real anSqrtArg = R1*R1-Alpha*Alpha;
Standard_Real Beta = (anSqrtArg > 0.) ? Sqrt(anSqrtArg) : 0.;
const Standard_Real aR1R1 = R1*R1;
/*
P1
o
* | *
* O1| *
A o-----o-----o B
* | *
* | *
o
P2
Two cylinders have axes collinear. Therefore, problem can be reformulated as
to find intersection point of two circles (the bases of the cylinders) on
the plane: 1st circle has center P1 and radius R1 (the radius of the
1st cylinder) and 2nd circle has center P2 and radius R2 (the radius of the
2nd cylinder). The plane is the base of the 1st cylinder. Points A and B
are intersection point of these circles. Distance P1P2 is equal to DistA1A2.
O1 is the intersection point of P1P2 and AB segments.
At that, if distance AB < Tol we consider that the circles are tangent and
has only one intersection point.
AB = 2*R1*sin(angle AP1P2).
Accordingly,
AB^2 < Tol^2 => 4*R1*R1*sin(angle AP1P2)^2 < Tol*Tol.
*/
if((Beta+Beta)<Tol)
//Cosine and Square of Sine of the A-P1-P2 angle
const Standard_Real aCos = 0.5*(aR1R1-R2*R2+DistA1A2*DistA1A2)/(R1*DistA1A2);
const Standard_Real aSin2 = 1-aCos*aCos;
const Standard_Boolean isTangent =((4.0*aR1R1*aSin2) < Tol*Tol);
//Normalized vector P1P2
const gp_Vec DirA1A2((P2.XYZ() - P1.XYZ())/DistA1A2);
if(isTangent)
{
//Intercept the segment from P1 point along P1P2 direction
//and having |P1O1| length
nbint=1;
pt1.SetCoord( P1.X() + Alpha*DirA1A2.X()
,P1.Y() + Alpha*DirA1A2.Y()
,P1.Z() + Alpha*DirA1A2.Z());
pt1.SetXYZ(P1.XYZ() + DirA1A2.XYZ()*R1*aCos);
}
else
{
pt1.SetCoord( P1.X() + Alpha*DirA1A2.X() + Beta*Ortho_dir1_P1P2.X(),
P1.Y() + Alpha*DirA1A2.Y() + Beta*Ortho_dir1_P1P2.Y(),
P1.Z() + Alpha*DirA1A2.Z() + Beta*Ortho_dir1_P1P2.Z());
pt2.SetCoord( P1.X() + Alpha*DirA1A2.X() - Beta*Ortho_dir1_P1P2.X(),
P1.Y() + Alpha*DirA1A2.Y() - Beta*Ortho_dir1_P1P2.Y(),
P1.Z() + Alpha*DirA1A2.Z() - Beta*Ortho_dir1_P1P2.Z());
{
//Sine of the A-P1-P2 angle (if aSin2 < 0 then isTangent == TRUE =>
//go to another branch)
const Standard_Real aSin = sqrt(aSin2);
//1. Rotate P1P2 to the angle A-P1-P2 relative to P1
//(clockwise and anticlockwise for getting
//two intersection points).
//2. Intercept the segment from P1 along direction,
//determined in the preview paragraph and having R1 length
const gp_Dir &aXDir = Cyl1.Position().XDirection(),
&aYDir = Cyl1.Position().YDirection();
const gp_Vec aR1Xdir = R1*aXDir.XYZ(),
aR1Ydir = R1*aYDir.XYZ();
//Source 2D-coordinates of the P1P2 vector normalized
//in coordinate system, based on the X- and Y-directions
//of the 1st cylinder in the plane of the 1st cylinder base
//(P1 is the origin of the coordinate system).
const Standard_Real aDx = DirA1A2.Dot(aXDir),
aDy = DirA1A2.Dot(aYDir);
//New coordinate (after rotation) of the P1P2 vector normalized.
Standard_Real aNewDx = aDx*aCos - aDy*aSin,
aNewDy = aDy*aCos + aDx*aSin;
pt1.SetXYZ(P1.XYZ() + aNewDx*aR1Xdir.XYZ() + aNewDy*aR1Ydir.XYZ());
aNewDx = aDx*aCos + aDy*aSin;
aNewDy = aDy*aCos - aDx*aSin;
pt2.SetXYZ(P1.XYZ() + aNewDx*aR1Xdir.XYZ() + aNewDy*aR1Ydir.XYZ());
}
}
else if(DistA1A2>(RmR-Tol))

View File

@@ -1151,6 +1151,7 @@ static Standard_Boolean AddPointIntoWL( const IntSurf_Quadric& theQuad1,
const Standard_Real theUlSurf1,
const Standard_Real thePeriodOfSurf1,
const Handle(IntSurf_LineOn2S)& theLine,
const Standard_Real theTol3D,
const Standard_Real theTol2D,
const Standard_Boolean theFlForce)
{
@@ -1177,6 +1178,32 @@ static Standard_Boolean AddPointIntoWL( const IntSurf_Quadric& theQuad1,
thePntOnSurf2.X(), thePntOnSurf2.Y());
}
const Standard_Integer aNbPnts = theLine->NbPoints();
if(aNbPnts > 0)
{
Standard_Real aUl = 0.0, aVl = 0.0;
const IntSurf_PntOn2S aPlast = theLine->Value(aNbPnts);
if(isTheReverse)
aPlast.ParametersOnS2(aUl, aVl);
else
aPlast.ParametersOnS1(aUl, aVl);
if(anUpar <= aUl)
{//Parameter value will be always increased.
return Standard_False;
}
//theTol2D is minimal step along parameter changed.
//Therefore, if we apply this minimal step two
//neighbour points will be always "same". Consequently,
//we should reduce tolerance for IsSame checking.
const Standard_Real aDTol = 1.0-Epsilon(1.0);
if(aPnt.IsSame(aPlast, theTol3D*aDTol, theTol2D*aDTol))
{
theLine->RemovePoint(aNbPnts);
}
}
theLine->Add(aPnt);
return Standard_True;
}
@@ -1191,6 +1218,7 @@ static Standard_Boolean AddBoundaryPoint( const IntSurf_Quadric& theQuad1,
const stCoeffsValue& theCoeffs,
const Bnd_Box2d& theUVSurf1,
const Bnd_Box2d& theUVSurf2,
const Standard_Real theTol3D,
const Standard_Real theTol2D,
const Standard_Real thePeriod,
const Standard_Real theNulValue,
@@ -1281,7 +1309,7 @@ static Standard_Boolean AddBoundaryPoint( const IntSurf_Quadric& theQuad1,
AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
gp_Pnt2d(anUpar1, aV1), gp_Pnt2d(aU2, aV2),
aUSurf1f, aUSurf1l, thePeriod,
theWL->Curve(), theTol2D, theFlForce);
theWL->Curve(), theTol3D, theTol2D, theFlForce);
}
else
{
@@ -1313,7 +1341,7 @@ static Standard_Boolean AddBoundaryPoint( const IntSurf_Quadric& theQuad1,
AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
gp_Pnt2d(anUpar2, aV1), gp_Pnt2d(aU2, aV2),
aUSurf1f, aUSurf1l, thePeriod,
theWL->Curve(), theTol2D, theFlForce);
theWL->Curve(),theTol3D, theTol2D, theFlForce);
}
else
{
@@ -1346,7 +1374,7 @@ static Standard_Boolean AddBoundaryPoint( const IntSurf_Quadric& theQuad1,
AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
gp_Pnt2d(anUpar2, aV1), gp_Pnt2d(aU2, aV2),
aUSurf1f, aUSurf1l, thePeriod,
theWL->Curve(), theTol2D, theFlForce);
theWL->Curve(), theTol3D, theTol2D, theFlForce);
}
else
{
@@ -1376,7 +1404,7 @@ static Standard_Boolean AddBoundaryPoint( const IntSurf_Quadric& theQuad1,
AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
gp_Pnt2d(anUpar1, aV1), gp_Pnt2d(aU2, aV2),
aUSurf1f, aUSurf1l, thePeriod,
theWL->Curve(), theTol2D, theFlForce);
theWL->Curve(), theTol3D, theTol2D, theFlForce);
}
else
{
@@ -1545,7 +1573,8 @@ static void CriticalPointsComputing(const stCoeffsValue& theCoeffs,
{
Standard_Real &a = theU1crit[i],
&b = theU1crit[i-1];
if(Abs(a - b) < theTol2D)
const Standard_Real aRemain = fmod(Abs(a - b), thePeriod); // >= 0, because Abs(a - b) >= 0
if((Abs(a - b) < theTol2D) || (aRemain < theTol2D) || (Abs(aRemain - thePeriod) < theTol2D))
{
a = (a + b)/2.0;
b = Precision::Infinite();
@@ -1817,6 +1846,7 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
Standard_Boolean isAddedIntoWL1 = Standard_False, isAddedIntoWL2 = Standard_False;
Standard_Real anUf = aU1f[aCurInterval], anUl = aU1l[aCurInterval];
const Standard_Boolean isDeltaPeriod = IsEqual(anUl-anUf, aPeriod);
//Inscribe and sort critical points
InscribeAndSortArray(anU1crit, aNbCritPointsMax, anUf, anUl, theTol2D, aPeriod);
@@ -1830,6 +1860,8 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
Handle(IntPatch_WLine) aWLine2 = new IntPatch_WLine(aL2S2, Standard_False);
Standard_Integer aWL1FindStatus = 0, aWL2FindStatus = 0;
Standard_Boolean isAddingWL1Enabled = Standard_True,
isAddingWL2Enabled = Standard_True;
Standard_Real anU1 = anUf;
@@ -1845,6 +1877,23 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
while(anU1 <= anUl)
{
if(isDeltaPeriod)
{
if(IsEqual(anU1, anUl))
{
//if isAddedIntoWL* == TRUE WLine contains only one point
//(which was end point of previous WLine). If we will
//add point found on the current step WLine will contain only
//two points. At that both these points will be equal to the
//points found earlier. Therefore, new WLine will repeat
//already existing WLine. Consequently, it is necessary
//to forbid building new line in this case.
isAddingWL1Enabled = !isAddedIntoWL1;
isAddingWL2Enabled = !isAddedIntoWL2;
}
}
for(Standard_Integer i = 0; i < aNbCritPointsMax; i++)
{
if((anU1 - anU1crit[i])*aCriticalDelta[i] < 0.0)
@@ -1995,123 +2044,129 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
isFirst = Standard_False;
}
if( ((aUSurf2f-aU21) <= theTol2D) &&
((aU21-aUSurf2l) <= theTol2D) &&
((aVSurf1f - aV11) <= theTol2D) &&
((aV11 - aVSurf1l) <= theTol2D) &&
((aVSurf2f - aV21) <= theTol2D) && ((aV21 - aVSurf2l) <= theTol2D))
if(isAddingWL1Enabled)
{
Standard_Boolean isForce = Standard_False;
if(!aWL1FindStatus)
if( ((aUSurf2f-aU21) <= theTol2D) &&
((aU21-aUSurf2l) <= theTol2D) &&
((aVSurf1f - aV11) <= theTol2D) &&
((aV11 - aVSurf1l) <= theTol2D) &&
((aVSurf2f - aV21) <= theTol2D) && ((aV21 - aVSurf2l) <= theTol2D))
{
Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D))
Standard_Boolean isForce = Standard_False;
if(!aWL1FindStatus)
{
isForce = Standard_True;
}
Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs,
theUVSurf1, theUVSurf2, theTol2D, aPeriod,
aNulValue, anU1, aU21, aV11, aV11Prev,
aV21, aV21Prev, isTheReverse,
1.0, isForce, isFound1, isFound2);
if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D))
{
isForce = Standard_True;
}
AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs,
theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod,
aNulValue, anU1, aU21, aV11, aV11Prev,
aV21, aV21Prev, isTheReverse,
1.0, isForce, isFound1, isFound2);
if(isFound1 || isFound2)
{
aWL1FindStatus = 1;
}
}
if((aWL1FindStatus != 2) || (aWLine1->NbPnts() >= 1))
{
if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
gp_Pnt2d(anU1, aV11), gp_Pnt2d(aU21, aV21),
aUSurf1f, aUSurf1l, aPeriod,
aWLine1->Curve(), theTol2D, isForce))
{
if(!aWL1FindStatus)
if(isFound1 || isFound2)
{
aWL1FindStatus = 1;
}
}
}
}
else
{
if(aWL1FindStatus == 1)
{
Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs,
theUVSurf1, theUVSurf2, theTol2D, aPeriod,
aNulValue, anU1, aU21, aV11, aV11Prev,
aV21, aV21Prev, isTheReverse,
1.0, Standard_False, isFound1, isFound2);
if(isFound1 || isFound2)
aWL1FindStatus = 2; //start a new line
}
}
if( ((aUSurf2f-aU22) <= theTol2D) &&
((aU22-aUSurf2l) <= theTol2D) &&
((aVSurf1f - aV12) <= theTol2D) &&
((aV12 - aVSurf1l) <= theTol2D) &&
((aVSurf2f - aV22) <= theTol2D) &&
((aV22 - aVSurf2l) <= theTol2D))
{
Standard_Boolean isForce = Standard_False;
if(!aWL2FindStatus)
{
Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D))
if((aWL1FindStatus != 2) || (aWLine1->NbPnts() >= 1))
{
isForce = Standard_True;
if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
gp_Pnt2d(anU1, aV11), gp_Pnt2d(aU21, aV21),
aUSurf1f, aUSurf1l, aPeriod,
aWLine1->Curve(), theTol3D, theTol2D, isForce))
{
if(!aWL1FindStatus)
{
aWL1FindStatus = 1;
}
}
}
}
else
{
if(aWL1FindStatus == 1)
{
Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs,
theUVSurf1, theUVSurf2, theTol2D, aPeriod,
aNulValue, anU1, aU22, aV12, aV12Prev,
aV22, aV22Prev, isTheReverse,
-1.0, isForce, isFound1, isFound2);
AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs,
theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod,
aNulValue, anU1, aU21, aV11, aV11Prev,
aV21, aV21Prev, isTheReverse,
1.0, Standard_False, isFound1, isFound2);
if(isFound1 || isFound2)
aWL1FindStatus = 2; //start a new line
}
}
}
if(isAddingWL2Enabled)
{
if( ((aUSurf2f-aU22) <= theTol2D) &&
((aU22-aUSurf2l) <= theTol2D) &&
((aVSurf1f - aV12) <= theTol2D) &&
((aV12 - aVSurf1l) <= theTol2D) &&
((aVSurf2f - aV22) <= theTol2D) &&
((aV22 - aVSurf2l) <= theTol2D))
{
Standard_Boolean isForce = Standard_False;
if(!aWL2FindStatus)
{
Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D))
{
isForce = Standard_True;
}
AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs,
theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod,
aNulValue, anU1, aU22, aV12, aV12Prev,
aV22, aV22Prev, isTheReverse,
-1.0, isForce, isFound1, isFound2);
if(isFound1 || isFound2)
{
aWL2FindStatus = 1;
}
}
if((aWL2FindStatus != 2) || (aWLine2->NbPnts() >= 1))
{
if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
gp_Pnt2d(anU1, aV12), gp_Pnt2d(aU22, aV22),
aUSurf1f, aUSurf1l, aPeriod,
aWLine2->Curve(), theTol2D, isForce))
{
if(!aWL2FindStatus)
if(isFound1 || isFound2)
{
aWL2FindStatus = 1;
}
}
if((aWL2FindStatus != 2) || (aWLine2->NbPnts() >= 1))
{
if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
gp_Pnt2d(anU1, aV12), gp_Pnt2d(aU22, aV22),
aUSurf1f, aUSurf1l, aPeriod,
aWLine2->Curve(), theTol3D, theTol2D, isForce))
{
if(!aWL2FindStatus)
{
aWL2FindStatus = 1;
}
}
}
}
}
else
{
if(aWL2FindStatus == 1)
else
{
Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
if(aWL2FindStatus == 1)
{
Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs,
theUVSurf1, theUVSurf2, theTol2D, aPeriod,
aNulValue, anU1, aU22, aV12, aV12Prev,
aV22, aV22Prev, isTheReverse,
-1.0, Standard_False, isFound1, isFound2);
AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs,
theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod,
aNulValue, anU1, aU22, aV12, aV12Prev,
aV22, aV22Prev, isTheReverse,
-1.0, Standard_False, isFound1, isFound2);
if(isFound1 || isFound2)
aWL2FindStatus = 2; //start a new line
if(isFound1 || isFound2)
aWL2FindStatus = 2; //start a new line
}
}
}
@@ -2237,15 +2292,29 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
}
else if(aWLine1->NbPnts() > 1)
{
isTheEmpty = Standard_False;
isAddedIntoWL1 = Standard_True;
Standard_Boolean isGood = Standard_True;
SeekAdditionalPoints(theQuad1, theQuad2, aWLine1->Curve(),
anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
theTol2D, aPeriod, 1.0, isTheReverse);
if(aWLine1->NbPnts() == 2)
{
const IntSurf_PntOn2S& aPf = aWLine1->Point(1);
const IntSurf_PntOn2S& aPl = aWLine1->Point(2);
aWLine1->ComputeVertexParameters(theTol3D);
theSlin.Append(aWLine1);
if(aPf.IsSame(aPl, Precision::Confusion()))
isGood = Standard_False;
}
if(isGood)
{
isTheEmpty = Standard_False;
isAddedIntoWL1 = Standard_True;
SeekAdditionalPoints( theQuad1, theQuad2, aWLine1->Curve(),
anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
theTol2D, aPeriod, 1.0, isTheReverse);
aWLine1->ComputeVertexParameters(theTol3D);
theSlin.Append(aWLine1);
}
}
else
{
@@ -2267,15 +2336,28 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
}
else if(aWLine2->NbPnts() > 1)
{
isTheEmpty = Standard_False;
isAddedIntoWL2 = Standard_True;
Standard_Boolean isGood = Standard_True;
if(aWLine2->NbPnts() == 2)
{
const IntSurf_PntOn2S& aPf = aWLine2->Point(1);
const IntSurf_PntOn2S& aPl = aWLine2->Point(2);
SeekAdditionalPoints(theQuad1, theQuad2, aWLine2->Curve(),
anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
theTol2D, aPeriod, -1.0, isTheReverse);
if(aPf.IsSame(aPl, Precision::Confusion()))
isGood = Standard_False;
}
aWLine2->ComputeVertexParameters(theTol3D);
theSlin.Append(aWLine2);
if(isGood)
{
isTheEmpty = Standard_False;
isAddedIntoWL2 = Standard_True;
SeekAdditionalPoints(theQuad1, theQuad2, aWLine2->Curve(),
anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
theTol2D, aPeriod, -1.0, isTheReverse);
aWLine2->ComputeVertexParameters(theTol3D);
theSlin.Append(aWLine2);
}
}
else
{
@@ -2284,6 +2366,203 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
}
}
if(theSlin.Length() > 0)
{
for(Standard_Integer aNumOfLine = 2; aNumOfLine <= theSlin.Length(); aNumOfLine++)
{
const Handle(IntPatch_WLine)& aWLine = Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNumOfLine));
const IntSurf_PntOn2S& aPntFWL = aWLine->Point(1);
Standard_Real aU1 = 0.0, aU2 = 0.0, aV1 = 0.0, aV2 = 0.0;
aPntFWL.Parameters(aU1, aV1, aU2, aV2);
if( IsEqual(aU1, 0.0) || IsEqual(aU1, aPeriod))
{
theSlin.Exchange(1, aNumOfLine);
break;
}
}
for(Standard_Integer aNumOfLine1 = 1; aNumOfLine1 <= theSlin.Length(); aNumOfLine1++)
{
const Handle(IntPatch_WLine)& aWLine1 = Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNumOfLine1));
const Standard_Integer aNbPntsWL1 = aWLine1->NbPnts();
const IntSurf_PntOn2S& aPntFWL1 = aWLine1->Point(1);
const IntSurf_PntOn2S& aPntLWL1 = aWLine1->Point(aNbPntsWL1);
for(Standard_Integer aNPt = 1; aNPt <= theSPnt.Length(); aNPt++)
{
const IntSurf_PntOn2S aPntCur = theSPnt.Value(aNPt).PntOn2S();
if( aPntCur.IsSame(aPntFWL1, Precision::Confusion()) ||
aPntCur.IsSame(aPntLWL1, Precision::Confusion()))
{
theSPnt.Remove(aNPt);
aNPt--;
}
}
Standard_Boolean hasBeenRemoved = Standard_False;
for(Standard_Integer aNumOfLine2 = aNumOfLine1 + 1; aNumOfLine2 <= theSlin.Length(); aNumOfLine2++)
{
const Handle(IntPatch_WLine)& aWLine2 = Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNumOfLine2));
const Standard_Integer aNbPntsWL1 = aWLine1->NbPnts();
const Standard_Integer aNbPntsWL2 = aWLine2->NbPnts();
const IntSurf_PntOn2S& aPntFWL1 = aWLine1->Point(1);
const IntSurf_PntOn2S& aPntLWL1 = aWLine1->Point(aNbPntsWL1);
const IntSurf_PntOn2S& aPntFWL2 = aWLine2->Point(1);
const IntSurf_PntOn2S& aPntLWL2 = aWLine2->Point(aNbPntsWL2);
if(aPntFWL1.IsSame(aPntFWL2, Precision::Confusion()))
{
Standard_Real aU11 = 0.0, aU12 = 0.0, aV11 = 0.0, aV12 = 0.0;
Standard_Real aU21 = 0.0, aU22 = 0.0, aV21 = 0.0, aV22 = 0.0;
aPntFWL1.Parameters(aU11, aV11, aU12, aV12);
aPntFWL2.Parameters(aU21, aV21, aU22, aV22);
if( !(IsEqual(fmod(aU11, aPeriod), 0.0) ||
IsEqual(fmod(aU12, aPeriod), 0.0) ||
IsEqual(fmod(aU21, aPeriod), 0.0) ||
IsEqual(fmod(aU22, aPeriod), 0.0) ||
IsEqual(aU11, aUSurf1f) || IsEqual(aU11, aUSurf1l) ||
IsEqual(aU21, aUSurf1f) || IsEqual(aU21, aUSurf1l) ||
IsEqual(aU12, aUSurf2f) || IsEqual(aU12, aUSurf2l) ||
IsEqual(aU22, aUSurf2f) || IsEqual(aU22, aUSurf2l)))
{
aWLine1->ClearVertexes();
for(Standard_Integer aNPt = 1; aNPt <= aNbPntsWL2; aNPt++)
{
const IntSurf_PntOn2S& aPt = aWLine2->Point(aNPt);
aWLine1->Curve()->InsertBefore(1, aPt);
}
aWLine1->ComputeVertexParameters(theTol3D);
theSlin.Remove(aNumOfLine2);
aNumOfLine2--;
hasBeenRemoved = Standard_True;
continue;
}
}
if(aPntFWL1.IsSame(aPntLWL2, Precision::Confusion()))
{
Standard_Real aU11 = 0.0, aU12 = 0.0, aV11 = 0.0, aV12 = 0.0;
Standard_Real aU21 = 0.0, aU22 = 0.0, aV21 = 0.0, aV22 = 0.0;
aPntFWL1.Parameters(aU11, aV11, aU12, aV12);
aPntLWL2.Parameters(aU21, aV21, aU22, aV22);
if( !(IsEqual(fmod(aU11, aPeriod), 0.0) ||
IsEqual(fmod(aU12, aPeriod), 0.0) ||
IsEqual(fmod(aU21, aPeriod), 0.0) ||
IsEqual(fmod(aU22, aPeriod), 0.0) ||
IsEqual(aU11, aUSurf1f) || IsEqual(aU11, aUSurf1l) ||
IsEqual(aU21, aUSurf1f) || IsEqual(aU21, aUSurf1l) ||
IsEqual(aU12, aUSurf2f) || IsEqual(aU12, aUSurf2l) ||
IsEqual(aU22, aUSurf2f) || IsEqual(aU22, aUSurf2l)))
{
aWLine1->ClearVertexes();
for(Standard_Integer aNPt = aNbPntsWL2; aNPt >= 1; aNPt--)
{
const IntSurf_PntOn2S& aPt = aWLine2->Point(aNPt);
aWLine1->Curve()->InsertBefore(1, aPt);
}
aWLine1->ComputeVertexParameters(theTol3D);
theSlin.Remove(aNumOfLine2);
aNumOfLine2--;
hasBeenRemoved = Standard_True;
continue;
}
}
if(aPntLWL1.IsSame(aPntFWL2, Precision::Confusion()))
{
Standard_Real aU11 = 0.0, aU12 = 0.0, aV11 = 0.0, aV12 = 0.0;
Standard_Real aU21 = 0.0, aU22 = 0.0, aV21 = 0.0, aV22 = 0.0;
aPntLWL1.Parameters(aU11, aV11, aU12, aV12);
aPntFWL2.Parameters(aU21, aV21, aU22, aV22);
if( !(IsEqual(fmod(aU11, aPeriod), 0.0) ||
IsEqual(fmod(aU12, aPeriod), 0.0) ||
IsEqual(fmod(aU21, aPeriod), 0.0) ||
IsEqual(fmod(aU22, aPeriod), 0.0) ||
IsEqual(aU11, aUSurf1f) || IsEqual(aU11, aUSurf1l) ||
IsEqual(aU21, aUSurf1f) || IsEqual(aU21, aUSurf1l) ||
IsEqual(aU12, aUSurf2f) || IsEqual(aU12, aUSurf2l) ||
IsEqual(aU22, aUSurf2f) || IsEqual(aU22, aUSurf2l)))
{
aWLine1->ClearVertexes();
for(Standard_Integer aNPt = 1; aNPt <= aNbPntsWL2; aNPt++)
{
const IntSurf_PntOn2S& aPt = aWLine2->Point(aNPt);
aWLine1->Curve()->Add(aPt);
}
aWLine1->ComputeVertexParameters(theTol3D);
theSlin.Remove(aNumOfLine2);
aNumOfLine2--;
hasBeenRemoved = Standard_True;
continue;
}
}
if(aPntLWL1.IsSame(aPntLWL2, Precision::Confusion()))
{
Standard_Real aU11 = 0.0, aU12 = 0.0, aV11 = 0.0, aV12 = 0.0;
Standard_Real aU21 = 0.0, aU22 = 0.0, aV21 = 0.0, aV22 = 0.0;
aPntLWL1.Parameters(aU11, aV11, aU12, aV12);
aPntLWL2.Parameters(aU21, aV21, aU22, aV22);
if( !(IsEqual(fmod(aU11, aPeriod), 0.0) ||
IsEqual(fmod(aU12, aPeriod), 0.0) ||
IsEqual(fmod(aU21, aPeriod), 0.0) ||
IsEqual(fmod(aU22, aPeriod), 0.0) ||
IsEqual(aU11, aUSurf1f) || IsEqual(aU11, aUSurf1l) ||
IsEqual(aU21, aUSurf1f) || IsEqual(aU21, aUSurf1l) ||
IsEqual(aU12, aUSurf2f) || IsEqual(aU12, aUSurf2l) ||
IsEqual(aU22, aUSurf2f) || IsEqual(aU22, aUSurf2l)))
{
aWLine1->ClearVertexes();
for(Standard_Integer aNPt = aNbPntsWL2; aNPt >= 1; aNPt--)
{
const IntSurf_PntOn2S& aPt = aWLine2->Point(aNPt);
aWLine1->Curve()->Add(aPt);
}
aWLine1->ComputeVertexParameters(theTol3D);
theSlin.Remove(aNumOfLine2);
aNumOfLine2--;
hasBeenRemoved = Standard_True;
continue;
}
}
}
if(hasBeenRemoved)
aNumOfLine1--;
//aWLine1->ComputeVertexParameters(theTol3D);
}
}//if(theSlin.Length() > 0)
return Standard_True;
}

View File

@@ -309,9 +309,21 @@ is
---C++: return const&
returns HCurve2d from Adaptor2d;
Dump(me)
ClearVertexes(me: mutable)
is static;
is static;
RemoveVertex(me: mutable;
theIndex : Integer from Standard)
is static;
InsertVertexBefore(me: mutable;
theIndex : Integer from Standard;
thePnt : Point from IntPatch)
is static;
Dump(me)
is static;
fields

View File

@@ -97,3 +97,27 @@ inline const IntPatch_Point& IntPatch_WLine::Vertex (const Standard_Integer Inde
{
return svtx(Index);
}
inline void IntPatch_WLine::ClearVertexes()
{
svtx.Clear();
}
inline void IntPatch_WLine::RemoveVertex(const Standard_Integer theIndex)
{
if((theIndex < 1) || (theIndex > NbVertex()))
Standard_OutOfRange::Raise("Cannot delete not existing vertex");
svtx.Remove(theIndex);
}
inline void IntPatch_WLine::InsertVertexBefore( const Standard_Integer theIndex,
const IntPatch_Point& thePnt)
{
const Standard_Integer aNbVertexes = NbVertex();
Standard_Integer anIndex = Max(theIndex, 1);
if(anIndex > aNbVertexes)
svtx.Append(thePnt);
else
svtx.InsertBefore(theIndex, thePnt);
}

View File

@@ -119,6 +119,15 @@ is
is static;
IsSame(me; theOterPoint : PntOn2S from IntSurf;
theTol3D, theTol2D: Real from Standard = 0.0)
---Purpose: Returns TRUE if 2D- and 3D-coordinates of theOterPoint are equal to
-- corresponding coordinates of me (with given tolerance).
-- If theTol2D == 0.0 we will compare 3D-points only.
returns Boolean from Standard;
fields

View File

@@ -49,4 +49,31 @@ void IntSurf_PntOn2S::SetValue (const Standard_Boolean OnFirst,
}
Standard_Boolean IntSurf_PntOn2S::IsSame( const IntSurf_PntOn2S& theOterPoint,
const Standard_Real theTol3D,
const Standard_Real theTol2D) const
{
if(pt.SquareDistance(theOterPoint.Value()) > theTol3D*theTol3D)
return Standard_False;
if(IsEqual(theTol2D, 0.0))
{//We need not compare 2D-coordinates of the points
return Standard_True;
}
Standard_Real aU1 = 0.0, aV1 = 0.0, aU2 = 0.0, aV2 = 0.0;
theOterPoint.Parameters(aU1, aV1, aU2, aV2);
gp_Pnt2d aP1(u1, v1), aP2(aU1, aV1);
if(!aP1.IsEqual(aP2, theTol2D))
return Standard_False;
aP1.SetCoord(u2, v2);
aP2.SetCoord(aU2, aV2);
if(!aP1.IsEqual(aP2, theTol2D))
return Standard_False;
return Standard_True;
}

View File

@@ -1365,20 +1365,27 @@ Standard_Boolean IntTools_EdgeFace::CheckTouchVertex
(const IntTools_CommonPrt& aCP,
Standard_Real& aTx)
{
Standard_Real aTF, aTL, Tol, U1f,U1l,V1f,V1l, af, al,aDist2, aMinDist2, aTm, aDist2New;
Standard_Real aEpsT;
Standard_Real aTF, aTL, Tol, U1f,U1l,V1f,V1l;
Standard_Real aEpsT, af, al,aDist2, aMinDist2, aTm, aDist2New;
Standard_Boolean theflag=Standard_False;
Standard_Integer aNbExt, i, iLower ;
GeomAbs_CurveType aType;
//
aCP.Range1(aTF, aTL);
aType=myC.GetType();
//
aEpsT=8.e-5;
if (aType==GeomAbs_Line) {
aEpsT=9.e-5;
}
//
aTm=0.5*(aTF+aTL);
aDist2=DistanceFunction(aTm);
aDist2 *= aDist2;
Tol = Precision::PConfusion();
const Handle(Geom_Curve)& Curve =BRep_Tool::Curve (myC.Edge(), af, al);
const Handle(Geom_Curve)& Curve =BRep_Tool::Curve (myC.Edge(), af, al);
const Handle(Geom_Surface)& Surface=BRep_Tool::Surface(myS.Face());
Surface->Bounds(U1f,U1l,V1f,V1l);

View File

@@ -1243,10 +1243,9 @@ static Standard_Boolean isTreatAnalityc(const TopoDS_Face& theF1,
return;
}
}
//
// Do the Curve
typl=L->ArcType();
//
switch (typl) {
//########################################
// Line, Parabola, Hyperbola
@@ -1276,10 +1275,14 @@ static Standard_Boolean isTreatAnalityc(const TopoDS_Face& theF1,
//
aNbParts=myLConstruct.NbParts();
for (i=1; i<=aNbParts; i++) {
Standard_Boolean bFNIt, bLPIt;
//
myLConstruct.Part(i, fprm, lprm);
if (!Precision::IsNegativeInfinite(fprm) &&
!Precision::IsPositiveInfinite(lprm)) {
//
bFNIt=Precision::IsNegativeInfinite(fprm);
bLPIt=Precision::IsPositiveInfinite(lprm);
//
if (!bFNIt && !bLPIt) {
//
IntTools_Curve aCurve;
//
@@ -1309,7 +1312,7 @@ static Standard_Boolean isTreatAnalityc(const TopoDS_Face& theF1,
//
aCurve.SetFirstCurve2d(H1);
}
//
if(myApprox2) {
Handle (Geom2d_Curve) C2d;
BuildPCurves(fprm,lprm,Tolpc,myHS2->ChangeSurface().Surface(),newc,C2d);
@@ -1325,25 +1328,24 @@ static Standard_Boolean isTreatAnalityc(const TopoDS_Face& theF1,
aCurve.SetSecondCurve2d(H1);
}
mySeqOfCurve.Append(aCurve);
} // end of if (!Precision::IsNegativeInfinite(fprm) && !Precision::IsPositiveInfinite(lprm))
} //if (!bFNIt && !bLPIt) {
else {
// on regarde si on garde
//
Standard_Boolean bFNIt, bLPIt;
Standard_Real aTestPrm, dT=100.;
bFNIt=Precision::IsNegativeInfinite(fprm);
bLPIt=Precision::IsPositiveInfinite(lprm);
//
aTestPrm=0.;
if (bFNIt && !bLPIt) {
aTestPrm=lprm-dT;
}
else if (!bFNIt && bLPIt) {
aTestPrm=fprm+dT;
}
else {
// i.e, if (bFNIt && bLPIt)
aTestPrm=IntTools_Tools::IntermediatePoint(-dT, dT);
}
//
gp_Pnt ptref(newc->Value(aTestPrm));
//
GeomAbs_SurfaceType typS1 = myHS1->GetType();
@@ -1353,8 +1355,7 @@ static Standard_Boolean isTreatAnalityc(const TopoDS_Face& theF1,
typS1 == GeomAbs_SurfaceOfRevolution ||
typS2 == GeomAbs_SurfaceOfExtrusion ||
typS2 == GeomAbs_OffsetSurface ||
typS2 == GeomAbs_SurfaceOfRevolution)
{
typS2 == GeomAbs_SurfaceOfRevolution) {
Handle(Geom2d_BSplineCurve) H1;
mySeqOfCurve.Append(IntTools_Curve(newc, H1, H1));
continue;
@@ -1373,7 +1374,7 @@ static Standard_Boolean isTreatAnalityc(const TopoDS_Face& theF1,
mySeqOfCurve.Append(IntTools_Curve(newc, H1, H1));
}
}
}// end of for (i=1; i<=myLConstruct.NbParts(); i++)
}// for (i=1; i<=aNbParts; i++) {
}// case IntPatch_Lin: case IntPatch_Parabola: case IntPatch_Hyperbola:
break;

View File

@@ -167,7 +167,6 @@ public:
Standard_EXPORT void SetClipPlanes (const Graphic3d_CView& theCView);
Standard_EXPORT void SetCamera (const Graphic3d_CView& theCView);
Standard_EXPORT void SetVisualisation (const Graphic3d_CView& ACView);
Standard_EXPORT void Transparency (const Graphic3d_CView& ACView, const Standard_Boolean AFlag);
Standard_EXPORT Standard_Boolean View (Graphic3d_CView& ACView);
Standard_EXPORT void Environment (const Graphic3d_CView& ACView);
Standard_EXPORT void ZBufferTriedronSetup (const Quantity_NameOfColor XColor = Quantity_NOC_RED, const Quantity_NameOfColor YColor = Quantity_NOC_GREEN, const Quantity_NameOfColor ZColor = Quantity_NOC_BLUE1, const Standard_Real SizeRatio = 0.8, const Standard_Real AxisDiametr = 0.05, const Standard_Integer NbFacettes = 12);

View File

@@ -470,13 +470,6 @@ void OpenGl_GraphicDriver::SetVisualisation (const Graphic3d_CView& ACView)
}
}
void OpenGl_GraphicDriver::Transparency (const Graphic3d_CView& ACView, const Standard_Boolean AFlag)
{
const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
if (aCView)
aCView->WS->UseTransparency(AFlag);
}
// =======================================================================
// function : InvalidateBVHData
// purpose :

View File

@@ -54,7 +54,7 @@ static const GLdouble THE_IDENTITY_MATRIX[4][4] =
OpenGl_View::OpenGl_View (const CALL_DEF_VIEWCONTEXT &AContext,
OpenGl_StateCounter* theCounter)
: mySurfaceDetail(Visual3d_TOD_NONE),
: mySurfaceDetail(Visual3d_TOD_ALL),
myBackfacing(0),
myBgTexture(myDefaultBgTexture),
myBgGradient(myDefaultBgGradient),

View File

@@ -156,7 +156,6 @@ OpenGl_Workspace::OpenGl_Workspace (const Handle(OpenGl_GraphicDriver)& theDrive
myTransientDrawToFront (Standard_True),
myBackBufferRestored (Standard_False),
myIsImmediateDrawn (Standard_False),
myUseTransparency (Standard_False),
myUseZBuffer (Standard_False),
myUseDepthTest (Standard_True),
myUseGLLight (Standard_True),
@@ -255,15 +254,6 @@ Standard_Boolean OpenGl_Workspace::Activate()
return Standard_True;
}
// =======================================================================
// function : UseTransparency
// purpose : call_togl_transparency
// =======================================================================
void OpenGl_Workspace::UseTransparency (const Standard_Boolean theFlag)
{
myUseTransparency = theFlag;
}
//=======================================================================
//function : ResetAppliedAspect
//purpose : Sets default values of GL parameters in accordance with default aspects

View File

@@ -184,7 +184,6 @@ public:
Image_PixMap& theImage,
const Graphic3d_BufferType& theBufferType);
void UseTransparency (const Standard_Boolean theFlag);
Standard_Boolean& UseZBuffer() { return myUseZBuffer; }
Standard_Boolean& UseDepthTest() { return myUseDepthTest; }
Standard_Boolean& UseGLLight() { return myUseGLLight; }
@@ -671,7 +670,6 @@ protected: //! @name protected fields
Standard_Boolean myTransientDrawToFront; //!< optimization flag for immediate mode (to render directly to the front buffer)
Standard_Boolean myBackBufferRestored;
Standard_Boolean myIsImmediateDrawn; //!< flag indicates that immediate mode buffer contains some data
Standard_Boolean myUseTransparency;
Standard_Boolean myUseZBuffer;
Standard_Boolean myUseDepthTest;
Standard_Boolean myUseGLLight;

View File

@@ -119,7 +119,7 @@ void OpenGl_Workspace::updateMaterial (const int theFlag)
NamedStatus |= OPENGL_NS_2NDPASSNEED;
}
if (myUseTransparency && aProps->trans != 1.0f)
if (aProps->trans != 1.0f)
{
// render transparent
myMatTmp.Diffuse.a() = aProps->trans;
@@ -349,7 +349,7 @@ const OpenGl_AspectFace* OpenGl_Workspace::AspectFace (const Standard_Boolean th
? TelCullNone
: (TelCullMode )AspectFace_set->CullingMode();
if (aCullingMode != TelCullNone
&& myUseTransparency && !(NamedStatus & OPENGL_NS_2NDPASSDO))
&& !(NamedStatus & OPENGL_NS_2NDPASSDO))
{
// disable culling in case of translucent shading aspect
if (AspectFace_set->IntFront().trans != 1.0f)

View File

@@ -53,6 +53,7 @@
#include <Geom2d_TrimmedCurve.hxx>
#include <ElCLib.hxx>
#include <GeomLib.hxx>
#include <Extrema_ExtPC.hxx>
//=======================================================================
//function : IsoIsDeg
@@ -482,7 +483,16 @@ void ProjLib_ProjectedCurve::Load(const Handle(Adaptor3d_HCurve)& C)
IsTrimmed[0] = Standard_True;
f = f + dt;
myCurve = myCurve->Trim(f, l, Precision::Confusion());
Vsingular[0] = ElCLib::Parameter(L, P);
// Searching the parameter on the basis curve for surface of revolution
Extrema_ExtPC anExtr(P, mySurface->BasisCurve()->Curve(), myTolerance);
if (anExtr.IsDone())
{
Standard_Integer anIndex = 1;
while (!anExtr.IsMin(anIndex) && anIndex < anExtr.NbExt()) anIndex++;
Vsingular[0] = anExtr.Point(anIndex).Parameter();
}
else
Vsingular[0] = ElCLib::Parameter(L, P);
//SingularCase[0] = 3;
}
@@ -492,7 +502,16 @@ void ProjLib_ProjectedCurve::Load(const Handle(Adaptor3d_HCurve)& C)
IsTrimmed[1] = Standard_True;
l = l - dt;
myCurve = myCurve->Trim(f, l, Precision::Confusion());
Vsingular[1] = ElCLib::Parameter(L, P);
// Searching the parameter on the basis curve for surface of revolution
Extrema_ExtPC anExtr(P, mySurface->BasisCurve()->Curve(), myTolerance);
if (anExtr.IsDone())
{
Standard_Integer anIndex = 1;
while (!anExtr.IsMin(anIndex) && anIndex < anExtr.NbExt()) anIndex++;
Vsingular[1] = anExtr.Point(anIndex).Parameter();
}
else
Vsingular[1] = ElCLib::Parameter(L, P);
//SingularCase[1] = 4;
}
}

View File

@@ -236,10 +236,10 @@ static Standard_Integer OCC136 (Draw_Interpretor& di, Standard_Integer argc, con
anAISCtx->AddOrRemoveCurrentObject(aSh4);
//remove all this objects from context
anAISCtx->Clear(aSh1, Standard_False);
anAISCtx->Clear(aSh2, Standard_False);
anAISCtx->Clear(aSh3, Standard_False);
anAISCtx->Clear(aSh4, Standard_False);
anAISCtx->Remove (aSh1, Standard_False);
anAISCtx->Remove (aSh2, Standard_False);
anAISCtx->Remove (aSh3, Standard_False);
anAISCtx->Remove (aSh4, Standard_False);
return 0;
}

View File

@@ -3126,6 +3126,57 @@ static Standard_Integer OCC25446 (Draw_Interpretor& theDI,
return 0;
}
#include <IntTools_Context.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
//=======================================================================
//function : xprojponf
//purpose :
//=======================================================================
Standard_Integer xprojponf (Draw_Interpretor& di,
Standard_Integer n,
const char** a)
{
if (n!=3) {
di<<" use xprojponf p f \n";
return 0;
}
//
gp_Pnt aP, aPS;
TopoDS_Shape aS;
TopoDS_Face aF;
Handle(IntTools_Context) aCtx;
//
DrawTrSurf::GetPoint(a[1], aP);
aS=DBRep::Get(a[2]);
//
if (aS.IsNull()) {
di<<" null shape is not allowed\n";
return 0;
}
//
if (aS.ShapeType()!=TopAbs_FACE) {
di << a[2] << " not a face\n";
return 0;
}
//
aCtx=new IntTools_Context;
//
aF=TopoDS::Face(aS);
GeomAPI_ProjectPointOnSurf& aPPS=aCtx->ProjPS(aF);
//
aPPS.Perform(aP);
if (!aPPS.IsDone()) {
di<<" projection failed\n";
return 0;
}
//
aPS=aPPS.NearestPoint();
di<< " point px " << aPS.X() << " " << aPS.Y() << " " << aPS.Z() << "\n";
//
return 0;
}
void QABugs::Commands_19(Draw_Interpretor& theCommands) {
const char *group = "QABugs";
@@ -3187,5 +3238,6 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
theCommands.Add ("OCC25348", "OCC25348", __FILE__, OCC25348, group);
theCommands.Add ("OCC25413", "OCC25413 shape", __FILE__, OCC25413, group);
theCommands.Add ("OCC25446", "OCC25446 res b1 b2 op", __FILE__, OCC25446, group);
theCommands.Add ("xprojponf", "xprojponf p f", __FILE__, xprojponf, group);
return;
}

View File

@@ -129,7 +129,7 @@ void SelectMgr_EntityOwner::SetLocation(const TopLoc_Location&)
TopLoc_Location SelectMgr_EntityOwner::Location() const
{
return !HasSelectable() ? TopLoc_Location() : TopLoc_Location(mySelectable->Transformation());
return !HasLocation() ? TopLoc_Location() : TopLoc_Location(mySelectable->Transformation());
}
void SelectMgr_EntityOwner::ResetLocation()

View File

@@ -135,6 +135,12 @@ is
---C++: inline
---Purpose: Returns (modifiable) the mode for applying
-- ShapeFix::FixVertexPosition before all fixes, by default False.
FixVertexTolMode (me: mutable) returns Integer;
---C++: return &
---C++: inline
---Purpose: Returns (modifiable) the mode for fixing tolerances of vertices on whole shape
-- after performing all fixes
fields
myResult : Shape from TopoDS is protected;
@@ -147,6 +153,7 @@ fields
myFixWireMode : Integer is protected;
myFixSameParameterMode : Integer is protected;
myFixVertexPositionMode : Integer is protected;
myFixVertexTolMode : Integer is protected;
myStatus : Integer is protected;
end Shape;

View File

@@ -53,6 +53,7 @@ ShapeFix_Shape::ShapeFix_Shape()
myFixWireMode = -1;
myFixSameParameterMode = -1;
myFixVertexPositionMode =0;
myFixVertexTolMode = -1;
myFixSolid = new ShapeFix_Solid;
}
@@ -71,6 +72,7 @@ ShapeFix_Shape::ShapeFix_Shape(const TopoDS_Shape& shape)
myFixSameParameterMode = -1;
myFixSolid = new ShapeFix_Solid;
myFixVertexPositionMode =0;
myFixVertexTolMode = -1;
Init(shape);
}
@@ -97,7 +99,7 @@ void ShapeFix_Shape::Init(const TopoDS_Shape& shape)
Standard_Boolean ShapeFix_Shape::Perform(const Handle(Message_ProgressIndicator)& theProgress)
{
Standard_Integer savFixSmallAreaWireMode = 0;
Standard_Integer savFixVertexTolMode = myFixVertexTolMode;
Handle(ShapeFix_Face) fft = Handle(ShapeFix_Face)::DownCast( FixFaceTool() );
if ( !fft.IsNull() ) {
savFixSmallAreaWireMode = fft->FixSmallAreaWireMode();
@@ -142,7 +144,7 @@ Standard_Boolean ShapeFix_Shape::Perform(const Handle(Message_ProgressIndicator)
TopoDS_Shape shape = myShape;
Standard_Boolean savFixSameParameterMode = myFixSameParameterMode;
myFixSameParameterMode = Standard_False;
myFixVertexTolMode = Standard_False;
Standard_Integer aShapesNb = 0;
for ( TopoDS_Iterator anIter(S); anIter.More(); anIter.Next() )
++aShapesNb;
@@ -159,6 +161,7 @@ Standard_Boolean ShapeFix_Shape::Perform(const Handle(Message_ProgressIndicator)
return Standard_False; // aborted execution
myFixSameParameterMode = savFixSameParameterMode;
myFixVertexTolMode = savFixVertexTolMode;
myShape = shape;
break;
}
@@ -242,6 +245,26 @@ Standard_Boolean ShapeFix_Shape::Perform(const Handle(Message_ProgressIndicator)
{
SameParameter(myResult, Standard_False, theProgress);
}
if( NeedFix( myFixVertexTolMode))
{
Standard_Integer nbF = 0;
TopExp_Explorer anExpF(myResult, TopAbs_FACE);
for( ; anExpF.More() && nbF <= 1; anExpF.Next())
nbF++;
if( nbF > 1)
{
//fix for bug 0025455
// for case when vertex belong to the different faces it is necessary to check vertices tolerances
//after all fixes.
//This fix it should be performed for example for case when cutting edge was performed.
Handle(ShapeFix_Edge) sfe = FixEdgeTool();
TopExp_Explorer anExpE (myResult, TopAbs_EDGE);
for ( ; anExpE.More(); anExpE.Next())
sfe->FixVertexTolerance( TopoDS::Edge (anExpE.Current()));
}
}
if ( !fft.IsNull() )
fft->FixSmallAreaWireMode() = savFixSmallAreaWireMode;

View File

@@ -122,3 +122,13 @@ inline Standard_Integer& ShapeFix_Shape::FixVertexPositionMode()
{
return myFixVertexPositionMode;
}
//=======================================================================
//function : FixVertexTolMode
//purpose :
//=======================================================================
inline Standard_Integer& ShapeFix_Shape::FixVertexTolMode()
{
return myFixVertexTolMode;
}

View File

@@ -70,7 +70,6 @@ void V3d_Plane::Display (const Handle(V3d_View)& theView,
Graphic3d_MaterialAspect aPlastic (Graphic3d_NOM_PLASTIC);
aPlastic.SetColor (theColor);
aPlastic.SetTransparency (0.5);
theView->SetTransparency (Standard_True);
anAsp->SetFrontMaterial (aPlastic);
anAsp->SetInteriorStyle (Aspect_IS_HATCH);
anAsp->SetHatchStyle (Aspect_HS_GRID_DIAGONAL_WIDE);

View File

@@ -35,8 +35,6 @@
-- -> Add SetProjModel() method.
-- VKH - 15/11/99 : G004
-- -> Add method Dump()
-- GG - IMP210200
-- -> Add Transparency() method
-- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
-- -> Add Print method (works only under Windows).
-- GG - IMP231100
@@ -415,10 +413,6 @@ is
---Level: Public
---Purpose: Returns TRUE when the light is active in this view.
SetTransparency( me : mutable ; AnActivity : Boolean = Standard_False);
---Level: Public
---Purpose: Activate/Deactivate the transparency in this view.
SetImmediateUpdate(me: mutable; theImmediateUpdate: Boolean from Standard)
returns Boolean from Standard;
---Purpose: sets the immediate update mode and returns the previous one.
@@ -1141,10 +1135,6 @@ is
---Level: Public
-- purpose: return the current environment texture used
Transparency(me) returns Boolean from Standard;
---Level: Public
---Purpose: Returns the transparency activity.
Visualization ( me ) returns TypeOfVisualization from V3d;
---Level: Public
---Purpose: Returns the current visualisation mode.
@@ -1638,7 +1628,6 @@ fields
MyGridEchoStructure : Structure from Graphic3d;
MyGridEchoGroup : Group from Graphic3d;
MyTransparencyFlag : Boolean from Standard;
myImmediateUpdate: Boolean from Standard is protected;
myXscreenAxis : Vector from Graphic3d;

View File

@@ -251,8 +251,6 @@ V3d_View::V3d_View(const Handle(V3d_Viewer)& VM, const V3d_TypeOfView Type ) :
aCamera->SetProjectionType ((Type == V3d_ORTHOGRAPHIC)
? Graphic3d_Camera::Projection_Orthographic
: Graphic3d_Camera::Projection_Perspective);
MyTransparencyFlag = Standard_False;
}
//=============================================================================

View File

@@ -21,7 +21,6 @@
--------------------------------
00-09-92 : GG ; Creation.
24-12-97 : FMN ; Suppression de GEOMLITE
21-02-00 : GG ; Add Transparency() method
23-11-00 : GG ; Add IsActiveLight() and IsActivePlane() methods
************************************************************************/
@@ -102,18 +101,6 @@ void V3d_View::SetLightOff( ) {
}
void V3d_View::SetTransparency(const Standard_Boolean AnActivity) {
MyTransparencyFlag = AnActivity;
MyView->SetTransparency(AnActivity);
}
Standard_Boolean V3d_View::Transparency() const {
return MyTransparencyFlag;
}
void V3d_View::InitActiveLights() {
myActiveLightsIterator.Initialize(MyActiveLights);
}

View File

@@ -241,7 +241,7 @@ Standard_EXPORT Standard_Boolean VDisplayAISObject (const TCollection_AsciiStrin
Handle(AIS_InteractiveObject)::DownCast (aMap.Find2 (theName));
if (!anOldObj.IsNull())
aContextAIS->Clear (anOldObj, Standard_True);
aContextAIS->Remove (anOldObj, Standard_True);
// remove name and old object from map
aMap.UnBind2 (theName);
@@ -2751,7 +2751,7 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb,
}
else
{
anAISContext->Clear (anIO, Standard_False);
anAISContext->Remove (anIO, Standard_False);
aTexturedIO = new AIS_TexturedShape (DBRep::Get (theArgv[1]));
GetMapOfAIS().UnBind1 (anIO);
GetMapOfAIS().UnBind2 (aShapeName);

View File

@@ -57,7 +57,7 @@ MyModel (Visual3d_TOM_NONE),
MyVisual (Visual3d_TOV_WIREFRAME),
MyLights (),
MyTextureEnv(),
MySurfaceDetail(Visual3d_TOD_NONE),
MySurfaceDetail(Visual3d_TOD_ALL),
myClipPlanes()
{
}

View File

@@ -1045,15 +1045,6 @@ is
-- or insufficient memory.
-- Warning: Works only under Windows.
SetTransparency ( me : mutable;
AFlag : Boolean from Standard )
is static;
---Level: Advanced
---Purpose: if <AFlag> is Standard_True then the transparency
-- is managed in the view <me>.
-- Default Standard_False
---Category: Internal methods
ZBufferIsActivated ( me )
returns Boolean from Standard
is static;

View File

@@ -805,7 +805,6 @@ void Visual3d_View::Activate()
{
myGraphicDriver->ActivateView (MyCView);
myGraphicDriver->Background (MyCView);
myGraphicDriver->Transparency (MyCView, myViewManager->Transparency());
MyCView.Active = 1;
@@ -1800,22 +1799,6 @@ Standard_Boolean Visual3d_View::ZBufferIsActivated() const
return MyCView.Context.ZBufferActivity != 0; // 0 or 1 => forced by the programmer
}
// =======================================================================
// function : SetTransparency
// purpose :
// =======================================================================
void Visual3d_View::SetTransparency (const Standard_Boolean theActivity)
{
if (IsDeleted()
|| !IsDefined()
|| !IsActive())
{
return;
}
myGraphicDriver->Transparency (MyCView, theActivity);
}
// =======================================================================
// function : SetZBufferActivity
// purpose :

View File

@@ -411,24 +411,6 @@ is
-- if <AStructure> is displayed in <AProjector> and TOS_COMPUTED.
---Category: Private methods
Transparency ( me )
returns Boolean from Standard
is static;
---Level: Advanced
---Purpose: Returns Standard_True if the transparency
-- is activated in all activated views.
-- Default Standard_False
---Category: Internal methods
SetTransparency ( me : mutable;
AFlag : Boolean from Standard )
is static;
---Level: Advanced
---Purpose: if <AFlag> is Standard_True then the transparency
-- is managed.
-- Default Standard_False
---Category: Internal methods
ZBufferAuto ( me )
returns Boolean from Standard
is static;
@@ -473,7 +455,6 @@ fields
-- advanced
MyZBufferAuto : Boolean from Standard;
MyTransparency : Boolean from Standard;
-- Z layer indexes
myLayerIds : MapOfInteger from TColStd;

View File

@@ -83,8 +83,7 @@ Visual3d_ViewManager::Visual3d_ViewManager (const Handle(Graphic3d_GraphicDriver
Graphic3d_StructureManager (theDriver),
MyDefinedView (),
MyViewGenId (View_IDMIN+((View_IDMIN+View_IDMAX)/(Visual3d_ViewManager::Limit ()))*(Visual3d_ViewManager::CurrentId ()-1),View_IDMIN+((View_IDMIN+View_IDMAX)/(Visual3d_ViewManager::Limit ()))*Visual3d_ViewManager::CurrentId ()-1),
MyZBufferAuto (Standard_False),
MyTransparency (Standard_False)
MyZBufferAuto (Standard_False)
{
// default layer is always presented in display layer sequence
// it can not be removed
@@ -558,24 +557,6 @@ void Visual3d_ViewManager::UnIdentification (const Standard_Integer aViewId)
MyViewGenId.Free(aViewId);
}
void Visual3d_ViewManager::SetTransparency (const Standard_Boolean AFlag)
{
if (MyTransparency && AFlag) return;
if (! MyTransparency && ! AFlag) return;
for(int i=1; i<=MyDefinedView.Length(); i++)
{
(MyDefinedView.Value(i))->SetTransparency(AFlag);
}
MyTransparency = AFlag;
}
Standard_Boolean Visual3d_ViewManager::Transparency () const
{
return (MyTransparency);
}
void Visual3d_ViewManager::SetZBufferAuto (const Standard_Boolean AFlag)
{
if (MyZBufferAuto && AFlag) return;

View File

@@ -177,7 +177,7 @@ Standard_Integer LU_Decompose(math_Matrix& a,
math_Vector& vv,
Standard_Real TINY) {
Standard_Integer i, imax=0, j, k;
Standard_Integer i, imax=1, j, k;
Standard_Real big, dum, sum, temp;
Standard_Integer n = a.RowNumber();

View File

@@ -1,8 +1,8 @@
# Original bug : pro14942
# Date : 26Aout98
#CR23958 puts "TODO #22911 ALL: Faulty shapes in variables faulty_1 to faulty_"
#CR23958 puts "TODO #22911 ALL: Error : The area of the resulting shape is"
puts "TODO #22911 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "TODO #22911 ALL: Error : The area of the resulting shape is"
restore [locate_data_file CTO904_pro14942a.rle] a
restore [locate_data_file pro14942b.rle] b

View File

@@ -1,4 +1,5 @@
puts "TODO ?OCC24157 ALL: Error : The area of the resulting shape is"
puts "TODO #22911 ALL: Faulty shapes in variables faulty_1 to faulty_"
# cts17861
restore [locate_data_file CTO900_cts17861a.rle] a

3
tests/boolean/bopcommon_complex/J1 Normal file → Executable file
View File

@@ -1,3 +1,6 @@
puts "TODO #22911 ALL: Error : The bopcommon is not valid. The area is"
puts "TODO #22911 ALL: Error : The area of the resulting shape is"
restore [locate_data_file a158] a
restore [locate_data_file b148] b

View File

@@ -253,7 +253,7 @@ proc CheckTriArea {shape {eps 0}} {
}
# Check if list of xdistcs-command is valid
proc checkList {List Tolerance D_good} {
proc checkList {List Tolerance D_good Limit_Tol} {
set L1 [llength ${List}]
set L2 10
set L3 5
@@ -266,7 +266,14 @@ proc checkList {List Tolerance D_good} {
set D [lindex ${List} ${j2}]
#puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}"
if { [expr abs(${D} - ${D_good})] > ${Tolerance} } {
puts "Error: i=${i} T=${T} D=${D}"
puts "Error : T=${T} D=${D}"
}
if { ${Tolerance} > ${Limit_Tol} } {
if { [expr abs(${D} - ${D_good})] > ${Limit_Tol}
&& [expr abs(${D} - ${D_good})] <= ${Tolerance} } {
puts "Attention (critical value of tolerance) : T=${T} D=${D}"
}
}
}
}

21
tests/bugs/heal/bug25455 Normal file
View File

@@ -0,0 +1,21 @@
puts "============"
puts "OCC25455"
puts "============"
puts ""
######################################################
# fixshape works at the second attempt
######################################################
restore [locate_data_file bug25455_rx.brep] rx
fixshape rx rx
set info [checkshape rx]
# Resume
puts ""
if { [regexp {This shape seems to be valid} ${info}] } {
puts "OK: fixshape works properly"
} else {
puts "Error: fixshape works bad"
}

View File

@@ -22,16 +22,16 @@ if { ${Result_Numbers} != 2 } {
renamevar p_1 result
set status 0
set length 110.161
set nb_v_good 4
set nb_e_good 4
set length 110.167
set nb_v_good 1
set nb_e_good 1
set nb_w_good 1
set nb_f_good 0
set nb_sh_good 0
set nb_sol_good 0
set nb_compsol_good 0
set nb_compound_good 0
set nb_shape_good 9
set nb_shape_good 3
}
if { ${mistake} != 0 } {

View File

@@ -22,16 +22,16 @@ if { ${Result_Numbers} != 2 } {
renamevar p_2 result
set status 0
set length 110.171
set nb_v_good 4
set nb_e_good 4
set length 110.167
set nb_v_good 1
set nb_e_good 1
set nb_w_good 1
set nb_f_good 0
set nb_sh_good 0
set nb_sol_good 0
set nb_compsol_good 0
set nb_compound_good 0
set nb_shape_good 9
set nb_shape_good 3
}
# Resume

View File

@@ -18,15 +18,15 @@ add f2 aShape
#
set status 0
#
set nb_v_good 8
set nb_e_good 12
set nb_w_good 4
set nb_f_good 4
set nb_v_good 2
set nb_e_good 3
set nb_w_good 1
set nb_f_good 1
set nb_sh_good 0
set nb_sol_good 0
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 29
set nb_shape_good 8
#
set Numbers 11
#
@@ -95,7 +95,7 @@ if {${status} == 0} {
puts "Faulty ${BugNumber}"
}
set square 8444.76
set square 6606.88
set 2dviewer 0

View File

@@ -7,7 +7,7 @@ puts ""
###########################################################################################################
set BugNumber OCC22967
set check_value 3.46945e-006
set check_value 8.46459e-006
restore [locate_data_file bug22967_Cylinder_1.brep] b1
restore [locate_data_file bug22967_Scale_1.brep] b2
@@ -54,6 +54,6 @@ if {${status} > 0} {
puts "OK ${BugNumber}"
}
set square 669221
set square 668843
set 2dviewer 0

View File

@@ -19,7 +19,7 @@ set result [bopcurves b1 b2]
puts $result
puts "Finish project operation ..."
set GoodToleranceReached 2.4950140688989345e-006
set GoodToleranceReached 6.3315853638232248e-007
regexp {Tolerance Reached=([-0-9.+eE]+)} $result full ToleranceReached
proc GetPercent {Value GoodValue} {

View File

@@ -1,7 +1,7 @@
#puts "TODO OCC12345 ALL: Faulty shapes in variables faulty_1 to faulty_"
#puts "TODO OCC12345 ALL: Error : The square of result shape is"
puts "TODO OCC12345 ALL: Error : The command is not valid"
puts "TODO OCC12345 ALL: Error : Result shape is WRONG because it must contains"
#puts "TODO OCC12345 ALL: Error : The command is not valid"
#puts "TODO OCC12345 ALL: Error : Result shape is WRONG because it must contains"
puts "========================"
puts " OCC472 "
@@ -20,8 +20,8 @@ checkshape b2
bfuse result b1 b2
set nb_v_good 5
set nb_e_edge 7
set square 0
set nb_v_good 66
set nb_e_edge 107
set square 31657.5
set 2dviewer 0

View File

@@ -15,5 +15,5 @@ checkshape a_2
bcut result a_1 a_2
set square 1773.6
set square 2471.48
set 2dviewer 0

View File

@@ -12,18 +12,19 @@ restore [locate_data_file bug24154_b.brep] b2
bop b1 b2
bopcut result
set square 2.68434e+06
#set square 2.68434e+06
set square 5.21269e+06
set volume 7.35468e+07
# Analysis of "nbshapes res"
set nb_v_good 18
set nb_e_good 27
set nb_w_good 11
set nb_f_good 11
set nb_e_good 36
set nb_w_good 18
set nb_f_good 18
set nb_sh_good 1
set nb_sol_good 1
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 70
set nb_shape_good 93
set 2dviewer 1

View File

@@ -12,17 +12,17 @@ restore [locate_data_file bug24798_rectBranch.brep] b2
bop b1 b2
bopcut result
set square 1826.15
set square 1826.16
# Analysis of "nbshapes res"
set nb_v_good 49
set nb_e_good 72
set nb_v_good 44
set nb_e_good 67
set nb_w_good 29
set nb_f_good 22
set nb_sh_good 1
set nb_sol_good 1
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 175
set nb_shape_good 165
set 2dviewer 1

View File

@@ -43,16 +43,16 @@ baddctools b7
bfillds
bbop result 0
set square 10008.5
set square 10008.9
set nb_v_good 260
set nb_e_good 306
set nb_v_good 140
set nb_e_good 186
set nb_w_good 126
set nb_f_good 126
set nb_sh_good 40
set nb_sol_good 40
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 899
set nb_shape_good 659
set 2dviewer 1

View File

@@ -45,14 +45,14 @@ bbop result 2
set square 103838
set nb_v_good 280
set nb_e_good 338
set nb_v_good 160
set nb_e_good 218
set nb_w_good 142
set nb_f_good 80
set nb_sh_good 3
set nb_sol_good 3
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 847
set nb_shape_good 607
set 2dviewer 1

View File

@@ -46,14 +46,14 @@ bbop result 1
set square 157211
set nb_v_good 280
set nb_e_good 338
set nb_v_good 160
set nb_e_good 218
set nb_w_good 142
set nb_f_good 80
set nb_sh_good 1
set nb_sol_good 1
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 843
set nb_shape_good 603
set 2dviewer 1

View File

@@ -20,14 +20,14 @@ baddtools b_1 b_2 b_3 b_4 b_5 b_6 b_7 b_8 b_9 b_10 b_11 b_12 b_13 b_14 b_15 b_16
bfillds
bbuild result
set nb_v_good 268
set nb_e_good 366
set nb_v_good 170
set nb_e_good 268
set nb_w_good 243
set nb_f_good 195
set nb_sh_good 75
set nb_sol_good 75
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 1223
set nb_shape_good 1027
set 2dviewer 1

View File

@@ -6,6 +6,12 @@ puts ""
# Face/Face intersection algorithm gives different results for different order of the arguments
#######################################################################
puts "##############################"
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
puts "##############################"
puts ""
puts ""
# bopcurves command
restore [locate_data_file bug25292_Input_0.brep] b1
@@ -21,11 +27,17 @@ set log [bopcurves f1 f2 -2d]
#############################
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
#This value must be equal to the analogical value in bug25292_11 and bug25292_12 of "bugs modalg_5" testgrid.
set MaxTol 1.e-7
#This value must be equal to the analogical value in bug25292_11, bug25292_12, bug25292_15 and bug25292_16 of "bugs modalg_5" testgrid.
set GoodNbCurv 4
if {${Toler} > ${MaxTol}} {
puts "Error: Tolerance is too big!"
}
set GoodNbCurv 7
if {${NbCurv} != ${GoodNbCurv}} {
puts "Error: Curve Number is bad!"
}
@@ -34,105 +46,54 @@ if {${NbCurv} != ${GoodNbCurv}} {
# 1
puts ""
puts "First curve"
mksurface s1 f1
mksurface s2 f2
dlog reset
dlog on
xdistcs c_1 s1 0 1 10
set Log1 [dlog get]
for {set i 1} {$i <= ${NbCurv}} {incr i} {
set log [dump c_$i]
regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
puts "Degree=${Degree}"
puts "Poles=${Poles}"
puts "KnotsPoles=${KnotsPoles}"
puts ""
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good}
set Knot 1
set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U1 Mult1
# 2
puts ""
puts "Second curve"
set Knot ${KnotsPoles}
set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U2 Mult2
dlog reset
dlog on
xdistcs c_2 s1 0 1 10
set Log2 [dlog get]
puts "U1=${U1}"
puts "U2=${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good}
# 3
puts ""
puts "Third curve"
dlog reset
dlog on
xdistcs c_3 s1 0 1 10
set Log3 [dlog get]
set List3 [split ${Log3} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List3} ${Tolerance} ${D_good}
# 4
puts ""
puts "Fourth curve"
dlog reset
dlog on
xdistcs c_4 s1 0 1 10
set Log4 [dlog get]
set List4 [split ${Log4} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List4} ${Tolerance} ${D_good}
# 5
puts ""
puts "Fifth curve"
dlog reset
dlog on
xdistcs c_5 s1 0 1 10
set Log5 [dlog get]
set List5 [split ${Log5} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List5} ${Tolerance} ${D_good}
# 6
puts ""
puts "Sixth curve"
dlog reset
dlog on
xdistcs c_6 s1 0 1 10
set Log6 [dlog get]
set List6 [split ${Log6} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List6} ${Tolerance} ${D_good}
# 7
puts ""
puts "Seventh curve"
dlog reset
dlog on
xdistcs c_7 s1 0 1 10
set Log7 [dlog get]
set List7 [split ${Log7} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List7} ${Tolerance} ${D_good}
dlog reset
dlog on
xdistcs c_$i s1 ${U1} ${U2} 10
set Log2 [dlog get]
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance 1.0e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs c_$i s2 ${U1} ${U2} 10
set Log2 [dlog get]
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance 1.0e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
}
v2d
2dfit

View File

@@ -1,5 +1,3 @@
puts "TODO OCC225404 Debian60-64 Windows: Error: Curve Number is bad!"
puts "================"
puts "OCC25292"
puts "================"
@@ -8,6 +6,12 @@ puts ""
# Face/Face intersection algorithm gives different results for different order of the arguments
#######################################################################
puts "##############################"
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
puts "##############################"
puts ""
puts ""
# bopcurves command
restore [locate_data_file bug25292_Input_0.brep] b1
@@ -23,11 +27,17 @@ set log [bopcurves f2 f1 -2d]
#############################
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
#This value must be equal to the analogical value in bug25292_11 and bug25292_12 of "bugs modalg_5" testgrid.
set MaxTol 1.e-7
#This value must be equal to the analogical value in bug25292_11, bug25292_12, bug25292_15 and bug25292_16 of "bugs modalg_5" testgrid.
set GoodNbCurv 4
if {${Toler} > ${MaxTol}} {
puts "Error: Tolerance is too big!"
}
set GoodNbCurv 7
if {${NbCurv} != ${GoodNbCurv}} {
puts "Error: Curve Number is bad!"
}
@@ -36,112 +46,55 @@ if {${NbCurv} != ${GoodNbCurv}} {
# 1
puts ""
puts "First curve"
mksurface s1 f1
mksurface s2 f2
dlog reset
dlog on
xdistcs c_1 s1 0 1 10
set Log1 [dlog get]
for {set i 1} {$i <= ${NbCurv}} {incr i} {
set log [dump c_$i]
regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
puts "Degree=${Degree}"
puts "Poles=${Poles}"
puts "KnotsPoles=${KnotsPoles}"
puts ""
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good}
set Knot 1
set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U1 Mult1
# 2
puts ""
puts "Second curve"
set Knot ${KnotsPoles}
set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U2 Mult2
dlog reset
dlog on
xdistcs c_2 s1 0 1 10
set Log2 [dlog get]
puts "U1=${U1}"
puts "U2=${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good}
dlog reset
dlog on
xdistcs c_$i s1 ${U1} ${U2} 10
set Log2 [dlog get]
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance 1.0e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
# 3
puts ""
puts "Third curve"
dlog reset
dlog on
xdistcs c_3 s1 0 1 10
set Log3 [dlog get]
set List3 [split ${Log3} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List3} ${Tolerance} ${D_good}
# 4
puts ""
puts "Fourth curve"
dlog reset
dlog on
xdistcs c_4 s1 0 1 10
set Log4 [dlog get]
set List4 [split ${Log4} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List4} ${Tolerance} ${D_good}
# 5
if { [info exist c_5] } {
puts ""
puts "Fifth curve"
dlog reset
dlog on
xdistcs c_5 s1 0 1 10
set Log5 [dlog get]
set List5 [split ${Log5} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List5} ${Tolerance} ${D_good}
dlog reset
dlog on
xdistcs c_$i s2 ${U1} ${U2} 10
set Log2 [dlog get]
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance 1.0e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
}
# 6
if { [info exist c_6] } {
puts ""
puts "Sixth curve"
dlog reset
dlog on
xdistcs c_6 s1 0 1 10
set Log6 [dlog get]
set List6 [split ${Log6} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List6} ${Tolerance} ${D_good}
}
# 7
if { [info exist c_7] } {
puts ""
puts "Seventh curve"
dlog reset
dlog on
xdistcs c_7 s1 0 1 10
set Log7 [dlog get]
set List7 [split ${Log7} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List7} ${Tolerance} ${D_good}
}
v2d
2dfit
set only_screen_axo 1

View File

@@ -23,14 +23,14 @@ bbuild result
set square 289.348
set nb_v_good 12
set nb_e_good 18
set nb_v_good 9
set nb_e_good 15
set nb_w_good 10
set nb_f_good 10
set nb_sh_good 3
set nb_sol_good 3
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 57
set nb_shape_good 51
set 3dviewer 1

View File

@@ -1,7 +1,3 @@
puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 12 vertices instead of 9"
puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 18 edges instead of 15"
puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 57 shapes instead of 51"
puts "================"
puts "OCC25292"
puts "================"
@@ -27,14 +23,14 @@ bbuild result
set square 289.348
set nb_v_good 12
set nb_e_good 18
set nb_v_good 9
set nb_e_good 15
set nb_w_good 10
set nb_f_good 10
set nb_sh_good 3
set nb_sol_good 3
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 57
set nb_shape_good 51
set 3dviewer 1

View File

@@ -6,8 +6,37 @@ puts ""
# Face/Face intersection algorithm gives different results for different order of the arguments
#######################################################################
proc GetRange { curve } {
global U1
global U2
set log [uplevel dump $curve]
regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
puts "Degree=${Degree}"
puts "Poles=${Poles}"
puts "KnotsPoles=${KnotsPoles}"
puts ""
set Knot 1
set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U1 Mult1
set Knot ${KnotsPoles}
set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U2 Mult2
}
puts "##############################"
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
puts "##############################"
puts ""
# intersect command
#This value must be equal to the analogical value in bug25292_11, bug25292_12, bug25292_15 and bug25292_16 of "bugs modalg_5" testgrid.
set GoodNbCurv 4
restore [locate_data_file bug25292_Input_0.brep] b1
restore [locate_data_file bug25292_Input_1.brep] b2
@@ -20,11 +49,98 @@ mksurface s1 f1
mksurface s2 f2
#################
intersect i s1 s2
intersect res s1 s2
#################
set che [whatis res]
set ind [string first "3d curve" $che]
if {${ind} >= 0} {
#Only variable "res" exists
if { $GoodNbCurv == 1 } {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
set U1 0.0
set U2 0.0
GetRange res
if { [info exist i_7] } {
puts "OK: Curve Number is good!"
puts "U1 = ${U1}"
puts "U2 = ${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
dlog reset
dlog on
xdistcs res s1 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 3.0e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs res s2 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 3.0e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
} else {
puts "Error: Curve Number is bad!"
set ic 1
set AllowRepeate 1
while { $AllowRepeate != 0 } {
set che [whatis res_$ic]
set ind [string first "3d curve" $che]
if {${ind} < 0} {
set AllowRepeate 0
} else {
set U1 0.0
set U2 0.0
GetRange res_$ic
puts "U1 = ${U1}"
puts "U2 = ${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
dlog reset
dlog on
xdistcs res_$ic s1 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 3.0e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs res_$ic s2 0 1 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 3.0e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
incr ic
}
}
if {[expr {$ic - 1}] == $GoodNbCurv} {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
}

View File

@@ -1,5 +1,3 @@
puts "TODO OCC225404 Debian60-64 Windows: Error: Curve Number is bad!"
puts "================"
puts "OCC25292"
puts "================"
@@ -8,8 +6,37 @@ puts ""
# Face/Face intersection algorithm gives different results for different order of the arguments
#######################################################################
proc GetRange { curve } {
global U1
global U2
set log [uplevel dump $curve]
regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
puts "Degree=${Degree}"
puts "Poles=${Poles}"
puts "KnotsPoles=${KnotsPoles}"
puts ""
set Knot 1
set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U1 Mult1
set Knot ${KnotsPoles}
set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U2 Mult2
}
puts "##############################"
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
puts "##############################"
puts ""
# intersect command
#This value must be equal to the analogical value in bug25292_11, bug25292_12, bug25292_15 and bug25292_16 of "bugs modalg_5" testgrid.
set GoodNbCurv 4
restore [locate_data_file bug25292_Input_0.brep] b1
restore [locate_data_file bug25292_Input_1.brep] b2
@@ -22,11 +49,99 @@ mksurface s1 f1
mksurface s2 f2
#################
intersect i s2 s1
intersect res s2 s1
#################
if { [info exist i_7] } {
puts "OK: Curve Number is good!"
set che [whatis res]
set ind [string first "3d curve" $che]
if {${ind} >= 0} {
#Only variable "res" exists
if { $GoodNbCurv == 1 } {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
set U1 0.0
set U2 0.0
GetRange res
puts "U1 = ${U1}"
puts "U2 = ${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
dlog reset
dlog on
xdistcs res s1 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 3.0e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs res s2 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 3.0e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
} else {
puts "Error: Curve Number is bad!"
set ic 1
set AllowRepeate 1
while { $AllowRepeate != 0 } {
set che [whatis res_$ic]
set ind [string first "3d curve" $che]
if {${ind} < 0} {
set AllowRepeate 0
} else {
set U1 0.0
set U2 0.0
GetRange res_$ic
puts "U1 = ${U1}"
puts "U2 = ${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
dlog reset
dlog on
xdistcs res_$ic s1 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 3.0e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs res_$ic s2 0 1 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 3.0e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
incr ic
}
}
if {[expr {$ic - 1}] == $GoodNbCurv} {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
}

View File

@@ -6,6 +6,12 @@ puts ""
# Face/Face intersection algorithm gives different results for different order of the arguments
#######################################################################
puts "##############################"
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
puts "##############################"
puts ""
puts ""
# bopcurves command
restore [locate_data_file bug25292_Input_3.brep] b1
@@ -17,66 +23,74 @@ explode b2 f
copy b2_1 f2
#########################
set log [bopcurves f1 f2]
set log [bopcurves f1 f2 -2d]
#########################
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
#This value must be equal to the analogical value in bug25292_21 and bug25292_22 of "bugs modalg_5" testgrid.
set MaxTol 1.e-7
#This value must be equal to the analogical value in bug25292_21, bug25292_22, bug25292_25 and bug25292_26 of "bugs modalg_5" testgrid.
set GoodNbCurv 2
if {${Toler} > ${MaxTol}} {
puts "Error: Tolerance is too big!"
}
set GoodNbCurv 3
if {${NbCurv} != ${GoodNbCurv}} {
puts "Error: Curve Number is bad!"
}
#-------------
# 1
puts ""
puts "First curve"
mksurface s1 f1
mksurface s2 f2
dlog reset
dlog on
xdistcs c_1 s1 0 1 10
set Log1 [dlog get]
for {set i 1} {$i <= ${NbCurv}} {incr i} {
set log [dump c_$i]
regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
puts "Degree=${Degree}"
puts "Poles=${Poles}"
puts "KnotsPoles=${KnotsPoles}"
puts ""
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good}
set Knot 1
set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U1 Mult1
# 2
puts ""
puts "Second curve"
set Knot ${KnotsPoles}
set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U2 Mult2
dlog reset
dlog on
xdistcs c_2 s1 0 1 10
set Log2 [dlog get]
puts "U1=${U1}"
puts "U2=${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good}
# 3
puts ""
puts "Third curve"
dlog reset
dlog on
xdistcs c_3 s1 0 1 10
set Log3 [dlog get]
set List3 [split ${Log3} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List3} ${Tolerance} ${D_good}
dlog reset
dlog on
xdistcs c_$i s1 ${U1} ${U2} 10
set Log2 [dlog get]
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance 1.0e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs c_$i s2 ${U1} ${U2} 10
set Log2 [dlog get]
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance 1.0e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
}
smallview
fit

View File

@@ -1,5 +1,3 @@
puts "TODO OCC225404 Debian60-64 Windows: Error: Curve Number is bad!"
puts "================"
puts "OCC25292"
puts "================"
@@ -8,6 +6,12 @@ puts ""
# Face/Face intersection algorithm gives different results for different order of the arguments
#######################################################################
puts "##############################"
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
puts "##############################"
puts ""
puts ""
# bopcurves command
restore [locate_data_file bug25292_Input_3.brep] b1
@@ -19,69 +23,75 @@ explode b2 f
copy b2_1 f2
#########################
set log [bopcurves f2 f1]
set log [bopcurves f2 f1 -2d]
#########################
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
#This value must be equal to the analogical value in bug25292_21 and bug25292_22 of "bugs modalg_5" testgrid.
set MaxTol 1.e-7
#This value must be equal to the analogical value in bug25292_21, bug25292_22, bug25292_25 and bug25292_26 of "bugs modalg_5" testgrid.
set GoodNbCurv 2
if {${Toler} > ${MaxTol}} {
puts "Error: Tolerance is too big!"
}
set GoodNbCurv 3
if {${NbCurv} != ${GoodNbCurv}} {
puts "Error: Curve Number is bad!"
}
#-------------
# 1
puts ""
puts "First curve"
mksurface s1 f1
mksurface s2 f2
dlog reset
dlog on
xdistcs c_1 s1 0 1 10
set Log1 [dlog get]
for {set i 1} {$i <= ${NbCurv}} {incr i} {
set log [dump c_$i]
regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
puts "Degree=${Degree}"
puts "Poles=${Poles}"
puts "KnotsPoles=${KnotsPoles}"
puts ""
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good}
set Knot 1
set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U1 Mult1
# 2
puts ""
puts "Second curve"
set Knot ${KnotsPoles}
set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U2 Mult2
dlog reset
dlog on
xdistcs c_2 s1 0 1 10
set Log2 [dlog get]
puts "U1=${U1}"
puts "U2=${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good}
dlog reset
dlog on
xdistcs c_$i s1 ${U1} ${U2} 10
set Log2 [dlog get]
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance 1.0e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
# 3
if { [info exist c_3] } {
puts ""
puts "Third curve"
dlog reset
dlog on
xdistcs c_3 s1 0 1 10
set Log3 [dlog get]
set List3 [split ${Log3} {TD= \t\n}]
set Tolerance 1.0e-7
set D_good 0.
checkList ${List3} ${Tolerance} ${D_good}
dlog reset
dlog on
xdistcs c_$i s2 ${U1} ${U2} 10
set Log2 [dlog get]
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance 1.0e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
}
smallview
fit
set only_screen_axo 1

View File

@@ -21,16 +21,17 @@ baddobjects b1 b2
bfillds
bbuild result
#These values must be equal to the analogical values in bug25292_23 and bug25292_24 of "bugs modalg_5" testgrid.
set square 31.6797
set nb_v_good 11
set nb_e_good 20
set nb_v_good 10
set nb_e_good 19
set nb_w_good 13
set nb_f_good 13
set nb_sh_good 3
set nb_sol_good 3
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 64
set nb_shape_good 62
set 3dviewer 1

View File

@@ -1,8 +1,3 @@
puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 11 vertices instead of 10"
puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 20 edges instead of 19"
puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 64 shapes instead of 62"
puts "================"
puts "OCC25292"
puts "================"
@@ -26,16 +21,17 @@ baddobjects b2 b1
bfillds
bbuild result
#These values must be equal to the analogical values in bug25292_23 and bug25292_24 of "bugs modalg_5" testgrid.
set square 31.6797
set nb_v_good 11
set nb_e_good 20
set nb_v_good 10
set nb_e_good 19
set nb_w_good 13
set nb_f_good 13
set nb_sh_good 3
set nb_sol_good 3
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 64
set nb_shape_good 62
set 3dviewer 1

View File

@@ -6,8 +6,37 @@ puts ""
# Face/Face intersection algorithm gives different results for different order of the arguments
#######################################################################
proc GetRange { curve } {
global U1
global U2
set log [uplevel dump $curve]
regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
puts "Degree=${Degree}"
puts "Poles=${Poles}"
puts "KnotsPoles=${KnotsPoles}"
puts ""
set Knot 1
set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U1 Mult1
set Knot ${KnotsPoles}
set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U2 Mult2
}
puts "##############################"
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
puts "##############################"
puts ""
# intersect command
#This value must be equal to the analogical value in bug25292_21, bug25292_22, bug25292_25 and bug25292_26 of "bugs modalg_5" testgrid.
set GoodNbCurv 2
restore [locate_data_file bug25292_Input_3.brep] b1
restore [locate_data_file bug25292_Input_11.brep] b2
@@ -20,11 +49,100 @@ mksurface s1 f1
mksurface s2 f2
#################
intersect i s1 s2
intersect res s1 s2
#################
if { [info exist i_3] } {
puts "OK: Curve Number is good!"
set che [whatis res]
set ind [string first "3d curve" $che]
if {${ind} >= 0} {
#Only variable "res" exists
if { $GoodNbCurv == 1 } {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
set U1 0.0
set U2 0.0
GetRange res
puts "U1 = ${U1}"
puts "U2 = ${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
dlog reset
dlog on
xdistcs res s1 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.1e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs res s2 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.1e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
} else {
puts "Error: Curve Number is bad!"
set ic 1
set AllowRepeate 1
while { $AllowRepeate != 0 } {
set che [whatis res_$ic]
set ind [string first "3d curve" $che]
if {${ind} < 0} {
set AllowRepeate 0
} else {
set U1 0.0
set U2 0.0
GetRange res_$ic
puts "U1 = ${U1}"
puts "U2 = ${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
dlog reset
dlog on
xdistcs res_$ic s1 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.1e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs res_$ic s2 0 1 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.1e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
incr ic
}
}
if {[expr {$ic - 1}] == $GoodNbCurv} {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
}

View File

@@ -1,5 +1,3 @@
puts "TODO OCC225404 Debian60-64 Windows: Error: Curve Number is bad!"
puts "================"
puts "OCC25292"
puts "================"
@@ -8,8 +6,37 @@ puts ""
# Face/Face intersection algorithm gives different results for different order of the arguments
#######################################################################
proc GetRange { curve } {
global U1
global U2
set log [uplevel dump $curve]
regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
puts "Degree=${Degree}"
puts "Poles=${Poles}"
puts "KnotsPoles=${KnotsPoles}"
puts ""
set Knot 1
set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U1 Mult1
set Knot ${KnotsPoles}
set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U2 Mult2
}
puts "##############################"
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
puts "##############################"
puts ""
# intersect command
#This value must be equal to the analogical value in bug25292_21, bug25292_22, bug25292_25 and bug25292_26 of "bugs modalg_5" testgrid.
set GoodNbCurv 2
restore [locate_data_file bug25292_Input_3.brep] b1
restore [locate_data_file bug25292_Input_11.brep] b2
@@ -22,12 +49,99 @@ mksurface s1 f1
mksurface s2 f2
#################
intersect i s2 s1
intersect res s2 s1
#################
if { [info exist i_3] } {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
set che [whatis res]
set ind [string first "3d curve" $che]
if {${ind} >= 0} {
#Only variable "res" exists
if { $GoodNbCurv == 1 } {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
set U1 0.0
set U2 0.0
GetRange res
puts "U1 = ${U1}"
puts "U2 = ${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
dlog reset
dlog on
xdistcs res s1 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.1e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs res s2 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.1e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
} else {
set ic 1
set AllowRepeate 1
while { $AllowRepeate != 0 } {
set che [whatis res_$ic]
set ind [string first "3d curve" $che]
if {${ind} < 0} {
set AllowRepeate 0
} else {
set U1 0.0
set U2 0.0
GetRange res_$ic
puts "U1 = ${U1}"
puts "U2 = ${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
dlog reset
dlog on
xdistcs res_$ic s1 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.1e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs res_$ic s2 0 1 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.1e-7
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
incr ic
}
}
if {[expr {$ic - 1}] == $GoodNbCurv} {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
}

View File

@@ -6,6 +6,12 @@ puts ""
# Face/Face intersection algorithm gives different results for different order of the arguments
#######################################################################
puts "##############################"
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
puts "##############################"
puts ""
puts ""
# bopcurves command
restore [locate_data_file bug25292_f1.brep] f1
@@ -16,48 +22,69 @@ set log [bopcurves f1 f2 -2d]
#############################
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
set MaxTol 1.e-3
#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid.
set MaxTol 3.e-4
#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid.
set GoodNbCurv 1
if {${Toler} > ${MaxTol}} {
puts "Error: Tolerance is too big!"
}
set GoodNbCurv 2
if {${NbCurv} != ${GoodNbCurv}} {
puts "Error: Curve Number is bad!!"
}
#-------------
# 1
puts ""
puts "First curve"
mksurface s1 f1
mksurface s2 f2
dlog reset
dlog on
xdistcs c_1 s1 0 1 10
set Log1 [dlog get]
for {set i 1} {$i <= ${NbCurv}} {incr i} {
set log [dump c_$i]
regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
puts "Degree=${Degree}"
puts "Poles=${Poles}"
puts "KnotsPoles=${KnotsPoles}"
puts ""
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.0e-4
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good}
set Knot 1
set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U1 Mult1
# 2
puts ""
puts "Second curve"
set Knot ${KnotsPoles}
set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U2 Mult2
dlog reset
dlog on
xdistcs c_2 s1 0 1 10
set Log2 [dlog get]
puts "U1=${U1}"
puts "U2=${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance 1.0e-4
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good}
dlog reset
dlog on
xdistcs c_$i s1 ${U1} ${U2} 10
set Log2 [dlog get]
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance MaxTol
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs c_$i s2 ${U1} ${U2} 10
set Log2 [dlog get]
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance MaxTol
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
}
smallview
fit

View File

@@ -1,3 +1,5 @@
puts "TODO OCC25331 Debian60-64: Error: Tolerance is too big!"
puts "================"
puts "OCC25292"
puts "================"
@@ -6,6 +8,12 @@ puts ""
# Face/Face intersection algorithm gives different results for different order of the arguments
#######################################################################
puts "##############################"
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
puts "##############################"
puts ""
puts ""
# bopcurves command
restore [locate_data_file bug25292_f1.brep] f1
@@ -16,48 +24,69 @@ set log [bopcurves f2 f1 -2d]
#############################
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
set MaxTol 1.e-3
#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid.
set MaxTol 3.e-4
#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid.
set GoodNbCurv 1
if {${Toler} > ${MaxTol}} {
puts "Error: Tolerance is too big!"
}
set GoodNbCurv 2
if {${NbCurv} != ${GoodNbCurv}} {
puts "Error: Curve Number is bad!!"
}
#-------------
# 1
puts ""
puts "First curve"
mksurface s1 f1
mksurface s2 f2
dlog reset
dlog on
xdistcs c_1 s1 0 1 10
set Log1 [dlog get]
for {set i 1} {$i <= ${NbCurv}} {incr i} {
set log [dump c_$i]
regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
puts "Degree=${Degree}"
puts "Poles=${Poles}"
puts "KnotsPoles=${KnotsPoles}"
puts ""
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.0e-4
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good}
set Knot 1
set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U1 Mult1
# 2
puts ""
puts "Second curve"
set Knot ${KnotsPoles}
set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U2 Mult2
dlog reset
dlog on
xdistcs c_2 s1 0 1 10
set Log2 [dlog get]
puts "U1=${U1}"
puts "U2=${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance 1.0e-4
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good}
dlog reset
dlog on
xdistcs c_$i s1 ${U1} ${U2} 10
set Log2 [dlog get]
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance MaxTol
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs c_$i s2 ${U1} ${U2} 10
set Log2 [dlog get]
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance MaxTol
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
}
smallview
fit

View File

@@ -6,8 +6,37 @@ puts ""
# Face/Face intersection algorithm gives different results for different order of the arguments
#######################################################################
proc GetRange { curve } {
global U1
global U2
set log [uplevel dump $curve]
regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
puts "Degree=${Degree}"
puts "Poles=${Poles}"
puts "KnotsPoles=${KnotsPoles}"
puts ""
set Knot 1
set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U1 Mult1
set Knot ${KnotsPoles}
set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U2 Mult2
}
puts "##############################"
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
puts "##############################"
puts ""
# intersect command
#This value must be equal to the analogical value in bug25292_33 and bug25292_34 of "bugs modalg_5" testgrid.
set GoodNbCurv 1
restore [locate_data_file bug25292_f1.brep] f1
restore [locate_data_file bug25292_f2.brep] f2
@@ -15,11 +44,99 @@ mksurface s1 f1
mksurface s2 f2
#################
intersect i s1 s2
intersect res s1 s2
#################
if { [info exist i] } {
puts "OK: Curve Number is good!"
set che [whatis res]
set ind [string first "3d curve" $che]
if {${ind} >= 0} {
#Only variable "res" exists
if { $GoodNbCurv == 1 } {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
set U1 0.0
set U2 0.0
GetRange res
puts "U1 = ${U1}"
puts "U2 = ${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
dlog reset
dlog on
xdistcs res s1 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.0e-6
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs res s2 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.0e-6
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
} else {
puts "Error: Curve Number is bad!"
set ic 1
set AllowRepeate 1
while { $AllowRepeate != 0 } {
set che [whatis res_$ic]
set ind [string first "3d curve" $che]
if {${ind} < 0} {
set AllowRepeate 0
} else {
set U1 0.0
set U2 0.0
GetRange res_$ic
puts "U1 = ${U1}"
puts "U2 = ${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
dlog reset
dlog on
xdistcs res_$ic s1 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.0e-6
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs res_$ic s2 0 1 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.0e-6
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
incr ic
}
}
if {[expr {$ic - 1}] == $GoodNbCurv} {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
}

View File

@@ -6,8 +6,37 @@ puts ""
# Face/Face intersection algorithm gives different results for different order of the arguments
#######################################################################
proc GetRange { curve } {
global U1
global U2
set log [uplevel dump $curve]
regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
puts "Degree=${Degree}"
puts "Poles=${Poles}"
puts "KnotsPoles=${KnotsPoles}"
puts ""
set Knot 1
set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U1 Mult1
set Knot ${KnotsPoles}
set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U2 Mult2
}
puts "##############################"
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
puts "##############################"
puts ""
# intersect command
#This value must be equal to the analogical value in bug25292_33 and bug25292_34 of "bugs modalg_5" testgrid.
set GoodNbCurv 1
restore [locate_data_file bug25292_f1.brep] f1
restore [locate_data_file bug25292_f2.brep] f2
@@ -15,11 +44,99 @@ mksurface s1 f1
mksurface s2 f2
#################
intersect i s2 s1
intersect res s2 s1
#################
if { [info exist i] } {
puts "OK: Curve Number is good!"
set che [whatis res]
set ind [string first "3d curve" $che]
if {${ind} >= 0} {
#Only variable "res" exists
if { $GoodNbCurv == 1 } {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
set U1 0.0
set U2 0.0
GetRange res
puts "U1 = ${U1}"
puts "U2 = ${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
dlog reset
dlog on
xdistcs res s1 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.0e-6
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs res s2 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.0e-6
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
} else {
puts "Error: Curve Number is bad!"
set ic 1
set AllowRepeate 1
while { $AllowRepeate != 0 } {
set che [whatis res_$ic]
set ind [string first "3d curve" $che]
if {${ind} < 0} {
set AllowRepeate 0
} else {
set U1 0.0
set U2 0.0
GetRange res_$ic
puts "U1 = ${U1}"
puts "U2 = ${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
dlog reset
dlog on
xdistcs res_$ic s1 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.0e-6
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs res_$ic s2 0 1 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.0e-6
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
incr ic
}
}
if {[expr {$ic - 1}] == $GoodNbCurv} {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
}

View File

@@ -6,8 +6,38 @@ puts ""
# Face/Face intersection algorithm gives different results for different order of the arguments
#######################################################################
proc GetRange { curve } {
global U1
global U2
set log [uplevel dump $curve]
regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
puts "Degree=${Degree}"
puts "Poles=${Poles}"
puts "KnotsPoles=${KnotsPoles}"
puts ""
set Knot 1
set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U1 Mult1
set Knot ${KnotsPoles}
set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U2 Mult2
}
puts "##############################"
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
puts "##############################"
puts ""
puts ""
# intersect command for trimmed surfaces
#This value must be equal to the analogical value in bug25292_35 and bug25292_36 of "bugs modalg_5" testgrid.
set GoodNbCurv 2
restore [locate_data_file bug25292_f1.brep] f1
restore [locate_data_file bug25292_f2.brep] f2
@@ -21,11 +51,99 @@ trimv s1t s1 19.1600000005 19.6600000005
trim s2t s2 0. 1.570796326795 -275 275
###################
intersect k s1t s2t
intersect res s1t s2t
###################
if { [info exist k_2] } {
puts "OK: Curve Number is good!"
set che [whatis res]
set ind [string first "3d curve" $che]
if {${ind} >= 0} {
#Only variable "res" exists
if { $GoodNbCurv == 1 } {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
set U1 0.0
set U2 0.0
GetRange res
puts "U1 = ${U1}"
puts "U2 = ${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
dlog reset
dlog on
xdistcs res s1 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 3.0e-4
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs res s2 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 3.0e-4
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
} else {
puts "Error: Curve Number is bad!"
set ic 1
set AllowRepeate 1
while { $AllowRepeate != 0 } {
set che [whatis res_$ic]
set ind [string first "3d curve" $che]
if {${ind} < 0} {
set AllowRepeate 0
} else {
set U1 0.0
set U2 0.0
GetRange res_$ic
puts "U1 = ${U1}"
puts "U2 = ${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
dlog reset
dlog on
xdistcs res_$ic s1 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 3.0e-4
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs res_$ic s2 0 1 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 3.0e-4
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
incr ic
}
}
if {[expr {$ic - 1}] == $GoodNbCurv} {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
}

View File

@@ -6,8 +6,38 @@ puts ""
# Face/Face intersection algorithm gives different results for different order of the arguments
#######################################################################
proc GetRange { curve } {
global U1
global U2
set log [uplevel dump $curve]
regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
puts "Degree=${Degree}"
puts "Poles=${Poles}"
puts "KnotsPoles=${KnotsPoles}"
puts ""
set Knot 1
set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U1 Mult1
set Knot ${KnotsPoles}
set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
regexp ${exp_string} ${log} full U2 Mult2
}
puts "##############################"
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
puts "##############################"
puts ""
puts ""
# intersect command for trimmed surfaces
#This value must be equal to the analogical value in bug25292_35 and bug25292_36 of "bugs modalg_5" testgrid.
set GoodNbCurv 2
restore [locate_data_file bug25292_f1.brep] f1
restore [locate_data_file bug25292_f2.brep] f2
@@ -21,11 +51,99 @@ trimv s1t s1 19.1600000005 19.6600000005
trim s2t s2 0. 1.570796326795 -275 275
###################
intersect k s2t s1t
intersect res s2t s1t
###################
if { [info exist k_2] } {
puts "OK: Curve Number is good!"
set che [whatis res]
set ind [string first "3d curve" $che]
if {${ind} >= 0} {
#Only variable "res" exists
if { $GoodNbCurv == 1 } {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
set U1 0.0
set U2 0.0
GetRange res
puts "U1 = ${U1}"
puts "U2 = ${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
dlog reset
dlog on
xdistcs res s1 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 3.0e-4
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs res s2 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 3.0e-4
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
} else {
puts "Error: Curve Number is bad!"
set ic 1
set AllowRepeate 1
while { $AllowRepeate != 0 } {
set che [whatis res_$ic]
set ind [string first "3d curve" $che]
if {${ind} < 0} {
set AllowRepeate 0
} else {
set U1 0.0
set U2 0.0
GetRange res_$ic
puts "U1 = ${U1}"
puts "U2 = ${U2}"
if {[expr {$U2 - $U1}] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
dlog reset
dlog on
xdistcs res_$ic s1 ${U1} ${U2} 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 3.0e-4
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs res_$ic s2 0 1 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 3.0e-4
set Limit_Tol 1.0e-7
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
incr ic
}
}
if {[expr {$ic - 1}] == $GoodNbCurv} {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
}

View File

@@ -0,0 +1,33 @@
puts "============"
puts "OCC25432"
puts "============"
puts ""
#########################################################################
# Wrong result obtained by MakerVolume operator.
#########################################################################
restore [locate_data_file bug25432_qz.brep] q
explode q f
mkvolume result q_1 q_2 q_3 q_4 q_5 q_6 q_7 q_8 q_9 q_10 q_11 -ni
regexp {Mass +: +([-0-9.+eE]+)} [vprops result] full volume
set expected_volume 0.26776
set tol_abs_volume 1.0e-4
set tol_rel_volume 0.0001
checkreal "Volume" ${volume} ${expected_volume} ${tol_abs_volume} ${tol_rel_volume}
set square 3.59972
set nb_v_good 12
set nb_e_good 20
set nb_w_good 11
set nb_f_good 11
set nb_sh_good 2
set nb_sol_good 2
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 59
set 2dviewer 1

31
tests/bugs/modalg_5/bug25449 Executable file
View File

@@ -0,0 +1,31 @@
puts "================"
puts "OCC25449"
puts "================"
puts ""
#######################################################################
# Excess vertex in result of General Fuse operation.
#######################################################################
restore [locate_data_file bug25449_fz351.brep] b1
restore [locate_data_file bug25449_ez679.brep] b2
bclearobjects
bcleartools
baddobjects b1 b2
bfillds -t
bbuild result
set square 21.1115
set nb_v_good 4
set nb_e_good 4
set nb_w_good 1
set nb_f_good 1
set nb_sh_good 0
set nb_sol_good 0
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 11
set 3dviewer 1

View File

@@ -0,0 +1,26 @@
puts "================"
puts "OCC25450"
puts "================"
puts ""
####################################
# Common operation returns wrong shape
####################################
restore [locate_data_file bug25450_Shape.brep] a
explode a
bcommon result a_1 a_2
set square 142153
set nb_v_good 8
set nb_e_good 12
set nb_w_good 4
set nb_f_good 4
set nb_sh_good 1
set nb_sol_good 0
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 30
set 3dviewer 1

View File

@@ -0,0 +1,27 @@
puts "================"
puts "OCC25450"
puts "================"
puts ""
####################################
# Common operation returns wrong shape
####################################
restore [locate_data_file bug25450_b1.brep] b1
restore [locate_data_file bug25450_b2.brep] b2
bop b1 b2
bopcommon result
set square 35538.3
set nb_v_good 4
set nb_e_good 4
set nb_w_good 1
set nb_f_good 1
set nb_sh_good 1
set nb_sol_good 0
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 12
set 3dviewer 1

17
tests/bugs/modalg_5/bug25456 Executable file
View File

@@ -0,0 +1,17 @@
puts "============"
puts "OCC25456"
puts "============"
puts ""
###############################
## BOPAlgo_CheckerSI reports an error on the given shape
###############################
restore [locate_data_file bug25456_shape.brep] a
set info [bopcheck a]
if {[string compare ${info} " This shape seems to be OK.\n"] == 0} {
puts "OK: BOPAlgo_CheckerSI report is good"
} else {
puts "Error : BOPAlgo_CheckerSI report is wrong"
}

View File

@@ -0,0 +1,31 @@
puts "========"
puts "OCC25465"
puts "========"
puts ""
################################################
# Excess vertex in the result of CUT operation
################################################
restore [locate_data_file OCC25465_Gorivo.brep] b1
restore [locate_data_file OCC25465_Translation_1.brep] b2
explode b1 f
explode b2 f
set bug_info [bopcurves b1_3 b2_4]
bop b1 b2
bopcut result
# It is strictly forbidden to change nb_v_good and nb_e_good values (see OCC25465)
set nb_v_good 11
set nb_e_good 17
set nb_w_good 8
set nb_f_good 8
set nb_sh_good 1
set nb_sol_good 1
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 47
if {[lindex $bug_info 2] != 3} {
puts "ERROR: OCC25465 is reproduced."
}

View File

@@ -0,0 +1,31 @@
puts "========"
puts "OCC25465"
puts "========"
puts ""
################################################
# Excess vertex in the result of CUT operation
################################################
restore [locate_data_file OCC25465_t_boite1.brep] b1
restore [locate_data_file OCC25465_c_cyl.brep] b2
explode b1 f
explode b2 f
set bug_info [bopcurves b1_6 b2_1]
bop b1 b2
bopcut result
# It is strictly forbidden to change nb_v_good and nb_e_good values (see OCC25465)
set nb_v_good 13
set nb_e_good 20
set nb_w_good 11
set nb_f_good 8
set nb_sh_good 1
set nb_sol_good 1
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 55
if {[lindex $bug_info 2] != 2} {
puts "ERROR: OCC25465 is reproduced."
}

View File

@@ -0,0 +1,26 @@
puts "============"
puts "OCC25480"
puts "============"
puts ""
#######################################################################
# Incorrect result of BRepOffsetAPI_MakePipe
#######################################################################
restore [locate_data_file bug25480_part1.brep] a
restore [locate_data_file bug25480_part2.brep] b
pipe result b a 1
set square 48441
set nb_v_good 224
set nb_e_good 392
set nb_w_good 196
set nb_f_good 196
set nb_sh_good 14
set nb_sol_good 14
set nb_compsol_good 0
set nb_compound_good 8
set nb_shape_good 1044
set 2dviewer 1

View File

@@ -0,0 +1,34 @@
puts "========"
puts "OCC25488"
puts "========"
puts ""
######################################################
# Wrong result of two trimmed cylinders intersection
######################################################
set Tolerance 3.0e-7
set D_good 0.
set Limit_Tol 1.0e-7
restore [locate_data_file OCC25488_sb1_1t.draw] sb1
restore [locate_data_file OCC25488_sb2_1t.draw] sb2
set bug_info [intersect res sb1 sb2]
set i 0
while {$i != [llength $bug_info]} {
set res_i [lindex $bug_info $i]
dlog reset
dlog on
xdistcs ${res_i} sb1 0 1 10
set BugLog [dlog get]
set BugList [split ${BugLog} {TD= \t\n}]
checkList ${BugList} ${Tolerance} ${D_good} ${Limit_Tol}
dlog reset
dlog on
xdistcs ${res_i} sb2 0 1 10
set BugLog [dlog get]
set BugList [split ${BugLog} {TD= \t\n}]
checkList ${BugList} ${Tolerance} ${D_good} ${Limit_Tol}
set i [expr {$i + 1}]
}

39
tests/bugs/modalg_5/bug25505 Executable file
View File

@@ -0,0 +1,39 @@
puts "============"
puts "OCC25505"
puts "============"
puts ""
###############################
## General Fuse produces self-intersection shape
###############################
restore [locate_data_file bug25505_q.brep] q
explode q
bclearobjects
bcleartools
baddobjects q_1 q_2 q_3 q_4
bfillds
bbuild result
set info [bopcheck result]
if {[string compare ${info} " This shape seems to be OK.\n"] == 0} {
puts "OK: General Fuse produces good shape"
} else {
puts "Error : General Fuse produces self-intersection shape"
}
set square 68796.4
set nb_v_good 14
set nb_e_good 21
set nb_w_good 9
set nb_f_good 9
set nb_sh_good 7
set nb_sol_good 4
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 65
set 3dviewer 1

50
tests/bugs/modalg_5/bug25592 Executable file
View File

@@ -0,0 +1,50 @@
puts "============"
puts "OCC25592"
puts "============"
puts ""
######################################################
# Bad result of Fillet operation
######################################################
restore [locate_data_file bug25592_tshape.brep] t
explode t e
shape c c
add t_4 c
add t_6 c
fillet r t 30 c
explode r f
set info1 [bopargcheck r_2 #f]
if { [regexp "to be valid for BOP" ${info1}] == 1 } {
puts "1. OK : Good result of Fillet operation\n"
} else {
puts "1. Error : Bad result of Fillet operation\n"
}
set info2 [bopargcheck r_1 #f]
if { [regexp "to be valid for BOP" ${info2}] == 1 } {
puts "2. OK : Good result of Fillet operation\n"
} else {
puts "2. Error : Bad result of Fillet operation\n"
}
set info3 [bopargcheck r_6 #f]
if { [regexp "to be valid for BOP" ${info3}] == 1 } {
puts "3. OK : Good result of Fillet operation\n"
} else {
puts "3. Error : Bad result of Fillet operation\n"
}
set info4 [bopargcheck r_7 #f]
if { [regexp "to be valid for BOP" ${info4}] == 1 } {
puts "4. OK : Good result of Fillet operation\n"
} else {
puts "4. Error : Bad result of Fillet operation\n"
}
set info5 [bopargcheck r_9 #f]
if { [regexp "to be valid for BOP" ${info5}] == 1 } {
puts "5. OK : Good result of Fillet operation\n"
} else {
puts "5. Error : Bad result of Fillet operation\n"
}

View File

@@ -0,0 +1,25 @@
puts "========"
puts "OCC25657"
puts "========"
puts ""
###########################################################################################
# Bad result of Fillet operation
###########################################################################################
restore [locate_data_file bug25657_r4.brep] r4
explode r4 e
shape c c
add r4_15 c
fillet res r4 20 c
explode res f
pcurve res_2
# exception
pcurve res_5
# exception
smallview
fit
set only_screen_axo 1

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