1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0023178: Intersection of cylinders fails to produce results

1. Unification of trimmed and not-trimmed cylinders processing (IntPatch_Intersection::GeomGeomPerfomTrimSurf() method has been removed).
2. Interface of IntPatch_ImpImpIntersection::Perform(...) method has been changed.
3. Now, WLine purging is forbidden for Geom-Geom-Intersection.
4. Bnd_Range class has been created. See Bnd_Range.hxx for detail information.
5. Algorithm of AddBoundaryPoint function has been improved in order to obtain intersection points in both boundaries (VFirst and VLast of every surface).
6. Earlier, method Geom2dConvert::ConcatG1(...) increased resulted B-spline degree (in case of not succession of previous iteration). Now increased value has been limited by Geom2d_BSplineCurve::MaxDegree() value (max degree = 25).
7. Algorithm of B-spline closure definition has been changed in the methods Geom2dConvert::C0BSplineToC1BSplineCurve(...) and Geom2dConvert::C0BSplineToArrayOfC1BSplineCurve(...).

Creation of test case for this issue.
Adjusting test cases according to their new behavior.

Small correction in the code according to KGV's remark.
This commit is contained in:
nbv
2016-09-23 17:24:52 +03:00
committed by apn
parent fe4fc02d7b
commit d30895f5da
18 changed files with 1351 additions and 1072 deletions

37
src/Bnd/Bnd_Range.cxx Normal file
View File

@@ -0,0 +1,37 @@
// Created on: 2016-06-07
// Created by: Nikolai BUKHALOV
// Copyright (c) 2016 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 <Bnd_Range.hxx>
//=======================================================================
//function : Common
//purpose :
//=======================================================================
void Bnd_Range::Common(const Bnd_Range& theOther)
{
if(theOther.IsVoid())
{
SetVoid();
}
if(IsVoid())
{
return;
}
myFirst = Max(myFirst, theOther.myFirst);
myLast = Min(myLast, theOther.myLast);
}

124
src/Bnd/Bnd_Range.hxx Normal file
View File

@@ -0,0 +1,124 @@
// Created on: 2016-06-07
// Created by: Nikolai BUKHALOV
// Copyright (c) 2016 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.
#ifndef _Bnd_Range_HeaderFile
#define _Bnd_Range_HeaderFile
#include <Standard_Real.hxx>
#include <Standard_ConstructionError.hxx>
//! This class describes a range in 1D space restricted
//! by two real values.
//! A range can be void indicating there is no point included in the range.
class Bnd_Range
{
public:
//! Default constructor. Creates VOID range.
Bnd_Range() : myFirst(0.0), myLast(-1.0)
{
};
//! Constructor. Never creates VOID range.
Bnd_Range(const Standard_Real theMin, const Standard_Real theMax) :
myFirst(theMin), myLast(theMax)
{
if(myLast < myFirst)
Standard_ConstructionError::Raise("Last < First");
};
//! Replaces <this> with common-part of <this> and theOther
Standard_EXPORT void Common(const Bnd_Range& theOther);
//! Extends <this> to include theParameter
void Add(const Standard_Real theParameter)
{
if(IsVoid())
{
myFirst = myLast = theParameter;
return;
}
myFirst = Min(myFirst, theParameter);
myLast = Max(myLast, theParameter);
}
//! Obtain MIN boundary of <this>.
//! If <this> is VOID the method returns false.
Standard_Boolean GetMin(Standard_Real& thePar) const
{
if(IsVoid())
{
return Standard_False;
}
thePar = myFirst;
return Standard_True;
}
//! Obtain MAX boundary of <this>.
//! If <this> is VOID the method returns false.
Standard_Boolean GetMAX(Standard_Real& thePar) const
{
if(IsVoid())
{
return Standard_False;
}
thePar = myLast;
return Standard_True;
}
//! Returns range value (MAX-MIN). Returns negative value for VOID range.
Standard_Real Delta() const
{
return (myLast - myFirst);
}
//! Is <this> initialized.
Standard_Boolean IsVoid() const
{
return (myLast < myFirst);
}
//! Initializes <this> by default parameters. Makes <this> VOID.
void SetVoid()
{
myLast = -1.0;
myFirst = 0.0;
}
//! Extends this to the given value (in both side)
void Enlarge(const Standard_Real theDelta)
{
if (IsVoid())
{
return;
}
myFirst -= theDelta;
myLast += theDelta;
}
private:
//! Start of range
Standard_Real myFirst;
//! End of range
Standard_Real myLast;
};
#endif

View File

@@ -24,6 +24,8 @@ Bnd_Box2d.hxx
Bnd_HArray1OfBox.hxx
Bnd_HArray1OfBox2d.hxx
Bnd_HArray1OfSphere.hxx
Bnd_Range.cxx
Bnd_Range.hxx
Bnd_SeqOfBox.hxx
Bnd_Sphere.cxx
Bnd_Sphere.hxx