mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-07 18:30:55 +03:00
When fuzzy option is in force prevent increasing tolerance of input shapes. Instead pass increased by fuzzy value the tolerances of sub-shapes everywhere where it is needed by intersection algorithms. The following changes in API have been made: - The methods SetFuzzyValue and FuzzyValue have been moved from the classes BOPAlgo_ArgumentAnalyzer, BOPAlgo_Builder, and BOPAlgo_PaveFiller to the base class BOPAlgo_Algo. - The public method BOPDS_DS::VerticesOnIn has been renamed to SubShapesOnIn, and the new output parameter theCommonPB has been added. - In BOPTools_AlgoTools, a new argument "theFuzzyValue" has been added in the methods ComputeVV and AreFacesSameDomain. - In IntTools_Context, a new argument "theFuzzyValue" has been added in the methods ComputeVE and ComputeVF. - The methods SetFuzzyValue and FuzzyValue have been added in the classes IntTools_EdgeEdge, IntTools_FaceFace. - In the class IntTools_EdgeFace, the methods SetTolE, SetTolF, TolE, TolF have been removed, and the methods SetFuzzyValue, FuzzyValue have been added. - The new argument "theTol" has been added in the method IntTools_WLineTool::DecompositionOfWLine. Some improvements in algorithms have been made during fighting with regressions: - Correct initialization of pave blocks for degenerated edges. - In BOPAlgo_PaveFiller::MakeBlocks(), filter out paves on intersection curve that were put on the curve accidentally due to wide range of E-F intersection vertex. - In the method IntTools_Tools::ComputeTolerance the margin added to the computed tolerance has been increased up to 0.001%. - The method BOPAlgo_PaveFiller::PutPaveOnCurve has been corrected in order to use the original vertex tolerance instead of the value increased during putting it on other curves. - The new method BOPDS_PaveBlock::RemoveExtPave has been added. - The vertex tolerance computation in BOPTools_AlgoTools::CorrectCurveOnSurface has been improved, taking into account intersection segments between p-curves (to avoid regression on "bugs modalg_6 bug22794"). - Improve IsExistingPaveBlock to make more stable catching of coincidence of common block with section curve (against regression "bugs modalg_4 bug697_2" on Linux). Test case for the bug has been added. The following test cases have been updated as improvements: boolean gdml_private ZH2 ZI7 ZJ7 boolean volumemaker C4 The test case bugs/modalg_4/pro19653 has been corrected to make it stable. See comment inside the script for details. The test case bugs/modalg_6/bug25880 has been corrected to suppress wrong bfuse commands. The test bugs/modalg_6/bug26954_3 has been corrected to compare the result with more precise reference value. The "faulty" TODO in boolean/volumemaker/A8 has been made actual for Linux as well. //Eliminate compilation error on Linux.
233 lines
7.5 KiB
Plaintext
233 lines
7.5 KiB
Plaintext
// Created by: Eugeny MALTCHIKOV
|
|
// Copyright (c) 2013-2014 OPEN CASCADE SAS
|
|
//
|
|
// This file is part of Open CASCADE Technology software library.
|
|
//
|
|
// This library is free software; you can redistribute it and/or modify it under
|
|
// the terms of the GNU Lesser General Public License version 2.1 as published
|
|
// by the Free Software Foundation, with special exception defined in the file
|
|
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
|
// distribution for complete text of the license and disclaimer of any warranty.
|
|
//
|
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
|
// commercial license or contractual agreement.
|
|
|
|
#include <Precision.hxx>
|
|
#include <BRep_Tool.hxx>
|
|
|
|
//=======================================================================
|
|
//function : IntTools_EdgeEdge
|
|
//purpose :
|
|
//=======================================================================
|
|
inline IntTools_EdgeEdge::IntTools_EdgeEdge()
|
|
:
|
|
myTol1(0.),
|
|
myTol2(0.),
|
|
myTol(0.),
|
|
myFuzzyValue(Precision::Confusion()),
|
|
myRes1(0.),
|
|
myRes2(0.),
|
|
myResCoeff1(0.),
|
|
myResCoeff2(0.),
|
|
myPTol1(0.),
|
|
myPTol2(0.),
|
|
myRange1(0., 0.),
|
|
myRange2(0., 0.),
|
|
mySwap(Standard_False),
|
|
myErrorStatus(0),
|
|
myQuickCoincidenceCheck(Standard_False)
|
|
{
|
|
}
|
|
//=======================================================================
|
|
//function : IntTools_EdgeEdge
|
|
//purpose :
|
|
//=======================================================================
|
|
inline IntTools_EdgeEdge::IntTools_EdgeEdge(const TopoDS_Edge& theEdge1,
|
|
const TopoDS_Edge& theEdge2)
|
|
:
|
|
myEdge1(theEdge1),
|
|
myEdge2(theEdge2),
|
|
myTol1(0.),
|
|
myTol2(0.),
|
|
myTol(0.),
|
|
myFuzzyValue(Precision::Confusion()),
|
|
myRes1(0.),
|
|
myRes2(0.),
|
|
myResCoeff1(0.),
|
|
myResCoeff2(0.),
|
|
myPTol1(0.),
|
|
myPTol2(0.),
|
|
myRange1(0., 0.),
|
|
myRange2(0., 0.),
|
|
mySwap(Standard_False),
|
|
myErrorStatus(0),
|
|
myQuickCoincidenceCheck(Standard_False)
|
|
{
|
|
}
|
|
//=======================================================================
|
|
//function : IntTools_EdgeEdge
|
|
//purpose :
|
|
//=======================================================================
|
|
inline IntTools_EdgeEdge::IntTools_EdgeEdge(const TopoDS_Edge& theEdge1,
|
|
const Standard_Real aT11,
|
|
const Standard_Real aT12,
|
|
const TopoDS_Edge& theEdge2,
|
|
const Standard_Real aT21,
|
|
const Standard_Real aT22)
|
|
:
|
|
myEdge1(theEdge1),
|
|
myEdge2(theEdge2),
|
|
myTol1(0.),
|
|
myTol2(0.),
|
|
myTol(0.),
|
|
myFuzzyValue(Precision::Confusion()),
|
|
myRes1(0.),
|
|
myRes2(0.),
|
|
myResCoeff1(0.),
|
|
myResCoeff2(0.),
|
|
myPTol1(0.),
|
|
myPTol2(0.),
|
|
myRange1(aT11, aT12),
|
|
myRange2(aT21, aT22),
|
|
mySwap(Standard_False),
|
|
myErrorStatus(0),
|
|
myQuickCoincidenceCheck(Standard_False)
|
|
{
|
|
}
|
|
//=======================================================================
|
|
//function : IntTools_EdgeEdge
|
|
//purpose :
|
|
//=======================================================================
|
|
inline IntTools_EdgeEdge::~IntTools_EdgeEdge()
|
|
{
|
|
}
|
|
//=======================================================================
|
|
//function : SetEdge1
|
|
//purpose :
|
|
//=======================================================================
|
|
inline void IntTools_EdgeEdge::SetEdge1(const TopoDS_Edge& theEdge)
|
|
{
|
|
myEdge1 = theEdge;
|
|
}
|
|
//=======================================================================
|
|
//function : SetRange1
|
|
//purpose :
|
|
//=======================================================================
|
|
inline void IntTools_EdgeEdge::SetRange1(const IntTools_Range& theRange)
|
|
{
|
|
myRange1 = theRange;
|
|
}
|
|
//=======================================================================
|
|
//function : SetRange1
|
|
//purpose :
|
|
//=======================================================================
|
|
inline void IntTools_EdgeEdge::SetRange1(const Standard_Real aT1,
|
|
const Standard_Real aT2)
|
|
{
|
|
myRange1.SetFirst(aT1);
|
|
myRange1.SetLast(aT2);
|
|
}
|
|
//=======================================================================
|
|
//function : SetEdge1
|
|
//purpose :
|
|
//=======================================================================
|
|
inline void IntTools_EdgeEdge::SetEdge1(const TopoDS_Edge& theEdge,
|
|
const Standard_Real aT1,
|
|
const Standard_Real aT2)
|
|
{
|
|
SetEdge1(theEdge);
|
|
SetRange1(aT1, aT2);
|
|
}
|
|
//=======================================================================
|
|
//function : SetEdge2
|
|
//purpose :
|
|
//=======================================================================
|
|
inline void IntTools_EdgeEdge::SetEdge2(const TopoDS_Edge& theEdge)
|
|
{
|
|
myEdge2 = theEdge;
|
|
}
|
|
//=======================================================================
|
|
//function : SetRange1
|
|
//purpose :
|
|
//=======================================================================
|
|
inline void IntTools_EdgeEdge::SetRange2(const IntTools_Range& theRange)
|
|
{
|
|
myRange2 = theRange;
|
|
}
|
|
//=======================================================================
|
|
//function : SetRange1
|
|
//purpose :
|
|
//=======================================================================
|
|
inline void IntTools_EdgeEdge::SetRange2(const Standard_Real aT1,
|
|
const Standard_Real aT2)
|
|
{
|
|
myRange2.SetFirst(aT1);
|
|
myRange2.SetLast(aT2);
|
|
}
|
|
//=======================================================================
|
|
//function : SetEdge1
|
|
//purpose :
|
|
//=======================================================================
|
|
inline void IntTools_EdgeEdge::SetEdge2(const TopoDS_Edge& theEdge,
|
|
const Standard_Real aT1,
|
|
const Standard_Real aT2)
|
|
{
|
|
SetEdge2(theEdge);
|
|
SetRange2(aT1, aT2);
|
|
}
|
|
//=======================================================================
|
|
//function : SetFuzzyValue
|
|
//purpose :
|
|
//=======================================================================
|
|
inline void IntTools_EdgeEdge::SetFuzzyValue(const Standard_Real theFuzz)
|
|
{
|
|
myFuzzyValue = Max(theFuzz, Precision::Confusion());
|
|
}
|
|
//=======================================================================
|
|
//function : FuzzyValue
|
|
//purpose :
|
|
//=======================================================================
|
|
inline Standard_Real IntTools_EdgeEdge::FuzzyValue() const
|
|
{
|
|
return myFuzzyValue;
|
|
}
|
|
|
|
//=======================================================================
|
|
//function : CommonParts
|
|
//purpose :
|
|
//=======================================================================
|
|
inline const IntTools_SequenceOfCommonPrts& IntTools_EdgeEdge::CommonParts() const
|
|
{
|
|
return myCommonParts;
|
|
}
|
|
//=======================================================================
|
|
//function : IsDone
|
|
//purpose :
|
|
//=======================================================================
|
|
inline Standard_Boolean IntTools_EdgeEdge::IsDone() const
|
|
{
|
|
return (myErrorStatus == 0);
|
|
}
|
|
//=======================================================================
|
|
//function : CheckData
|
|
//purpose :
|
|
//=======================================================================
|
|
inline void IntTools_EdgeEdge::CheckData()
|
|
{
|
|
if (myEdge1.IsNull() || myEdge2.IsNull()) {
|
|
myErrorStatus = 1;
|
|
return;
|
|
}
|
|
//
|
|
if (BRep_Tool::Degenerated(myEdge1) || BRep_Tool::Degenerated(myEdge2)) {
|
|
myErrorStatus = 2;
|
|
return;
|
|
}
|
|
//
|
|
if (!BRep_Tool::IsGeometric(myEdge1) || !BRep_Tool::IsGeometric(myEdge2)) {
|
|
myErrorStatus = 3;
|
|
return;
|
|
}
|
|
}
|
|
|