1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00
occt/src/IntPatch/IntPatch_ALineToWLine.hxx
nbv d3ee56eafc 0029807: [Regression to 7.0.0] Impossible to cut cone from prism
The algorithm has been improved for the cases when the intersection line goes through the cone apex.

<!break>

1. All special points are put to the ALine forcefully (if they are true intersection point). Currently this step has not been implemented yet.

2. Now the tolerance of IntPatch_Point (put into ALine) is computed in order to cover the distance between it and the correspond ALine.

3. Test cases have been created.

4. Procedure of trimming IntAna_Curve has been improved.

5. Criterion when the discriminant of IntAna_Curve can be considered to be equal to 0 has been improved.

6. Methods IntAna_Curve::FindParameter(...) (and IntPatch_ALine::FindParameter(...)) currently returns list of all parameters corresponding the given point (IntAna_Curve can be self-interfered curve). Before the fix, this method always returned only one (randomly chosen) parameter.

7. Interfaces of the following methods have been changed: IntAna_Curve::FindParameter(...), IntPatch_ALine::FindParameter(...), IntPatch_ALine::ChangeVertex(...), IntPatch_SpecialPoints::AddPointOnUorVIso(...), IntPatch_SpecialPoints::AddSingularPole(...), IntPatch_WLineTool::ExtendTwoWLines().

8. Following methods have been added: IntAna_Quadric::SpecialPoints(...), IntPatch_ALineToWLine::GetSectionRadius(...), IntPatch_SpecialPoints::ProcessSphere(...), IntPatch_SpecialPoints::ProcessCone(...), IntPatch_SpecialPoints::GetTangentToIntLineForCone(...).

------------------
1) tests/boolean/volumemaker/C5
   tests/boolean/volumemaker/C6
   tests/boolean/volumemaker/E7

They are real IMPROVEMENTS. In the FIX (in compare with MASTER), section result between pairs of faces f2&f6 (C5), f3&f7 (C6) and f1&f5 (E7) is closed. Separated test cases have been created in order to focus on the problem with section. Bug #28503 has been fixed.

Correction in test cases.
2018-09-24 14:38:17 +03:00

114 lines
4.7 KiB
C++

// Created on: 1993-11-26
// Created by: Modelistation
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-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.
#ifndef _IntPatch_ALineToWLine_HeaderFile
#define _IntPatch_ALineToWLine_HeaderFile
#include <IntPatch_SequenceOfLine.hxx>
#include <IntSurf_Quadric.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Macro.hxx>
class Adaptor3d_HSurface;
class IntPatch_ALine;
class IntSurf_PntOn2S;
class IntPatch_ALineToWLine
{
public:
DEFINE_STANDARD_ALLOC
//! Constructor
Standard_EXPORT IntPatch_ALineToWLine(const Handle(Adaptor3d_HSurface)& theS1,
const Handle(Adaptor3d_HSurface)& theS2,
const Standard_Integer theNbPoints = 200);
Standard_EXPORT void SetTolOpenDomain (const Standard_Real aT);
Standard_EXPORT Standard_Real TolOpenDomain() const;
Standard_EXPORT void SetTolTransition (const Standard_Real aT);
Standard_EXPORT Standard_Real TolTransition() const;
Standard_EXPORT void SetTol3D (const Standard_Real aT);
Standard_EXPORT Standard_Real Tol3D() const;
//! Converts aline to the set of Walking-lines and adds
//! them in theLines.
Standard_EXPORT void MakeWLine (const Handle(IntPatch_ALine)& aline,
IntPatch_SequenceOfLine& theLines) const;
//! Converts aline (limitted by paraminf and paramsup) to the set of
//! Walking-lines and adds them in theLines.
Standard_EXPORT void MakeWLine (const Handle(IntPatch_ALine)& aline,
const Standard_Real paraminf,
const Standard_Real paramsup,
IntPatch_SequenceOfLine& theLines) const;
protected:
//! Computes step value to construct point-line. The step depends on
//! the local curvature of the intersection line computed in thePOn2S.
//! theTgMagnitude is the magnitude of tangent vector to the intersection
//! line (in the point thePOn2S).
//! Computed step is always in the range [theStepMin, theStepMax].
//! Returns FALSE if the step cannot be computed. In this case, its value
//! will not be changed.
Standard_EXPORT Standard_Boolean StepComputing(const Handle(IntPatch_ALine)& theALine,
const IntSurf_PntOn2S& thePOn2S,
const Standard_Real theLastParOfAline,
const Standard_Real theCurParam,
const Standard_Real theTgMagnitude,
const Standard_Real theStepMin,
const Standard_Real theStepMax,
const Standard_Real theMaxDeflection,
Standard_Real& theStep) const;
//! Compares distances from theMidPt to every quadrics with theMaxDeflection
//! (maximal distance of two ones is taken into account).
//! Returns the result of this comparison: -1 - small distance, +1 - big distance,
//! 0 - Dist == theMaxDeflection. Comparisons are done with internal tolerances.
Standard_EXPORT Standard_Integer CheckDeflection(const gp_XYZ& theMidPt,
const Standard_Real theMaxDeflection) const;
//! Returns radius of a circle obtained by intersection the quadric with a plane
//! goes through thePnt3d perpendicular to the quadric axis. This radius is computed
//! for both quadrics and minimal value is returned.
//! This check is made for cone and sphere only.
Standard_EXPORT Standard_Real GetSectionRadius(const gp_Pnt& thePnt3d) const;
private:
Handle(Adaptor3d_HSurface) myS1;
Handle(Adaptor3d_HSurface) myS2;
IntSurf_Quadric myQuad1;
IntSurf_Quadric myQuad2;
//! Approximate number of points in resulting
//! WLine (precise number of points is computed
//! by the algorithms)
Standard_Integer myNbPointsInWline;
Standard_Real myTolOpenDomain;
Standard_Real myTolTransition;
Standard_Real myTol3D;
};
#endif // _IntPatch_ALineToWLine_HeaderFile