mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0026431: Can't cut a sphere from a cylinder
This branch contains fixes for 26675 and 26431 bugs. 1. Normalization has been eliminated. 2. Interfaces of AppDef_Compute::Parametrization(...) and BRepAlgo_BooleanOperations::SetApproxParameters() methods have been changed. 3. Overloaded methods for ApproxInt_Approx::SetParameters(...), TopOpeBRepTool_GeomTool::GetTolerances(...) and TopOpeBRepTool_GeomTool::SetTolerances(...) have been removed (because some fields of these classes are not used more). 4. Comments for some methods have been changed in BRepApprox_TheMultiLineOfApprox.hxx and GeomInt_TheMultiLineOfWLApprox.hxx files. 5. Some fields have been deleted from ApproxInt_MultiLine class. Kept members have become constant. 6. Interface of ksection DRAW-command has been changed. 7. Now, 2dintersect DRAW-command prints information about found segments. 8. Some code fragments have been rewritten to make them easier. 9. Algorithm of splitting WLine, which goes through pole of sphere has been improved. 10. Improve approximation algorithm in order to it will compute correct 2D- and 3D-tangent at the end of bezier constraints (including case when curve goes through or finishes on singular points). 11. Interface of IntPatch_WLine::Dump(...) method has been corrected. 12. Some methods for working with Walking-line are made more universal (available for both GeomInt and IntTools packages). 13. Problem in BRepLib::SameParameter(...) method has been fixed (see corresponding comment). 14. Small correction in Draft package. 15. Any outputs in IntPatch_Intersection::Dump(...) method have become disabled because they are useless. If anybody need in this outputs he/she will correct this method himself/herself. Adjusting some test cases according to their new behavior. Creation of new test cases. ---------------------------------------------------------------------------------------------------------------------------- Some explanation of new behavior of some test cases: 1. Regressions: a) blend simple X4 The problem is described in the issue #0026740. According to this description, the result on the current MASTER seems to be wrong indeed. b) boolean bcommon_complex C7 and boolean bcut_complex Q1 These test case use same shapes with different Boolean operation (COMMON and CUT). They are already BAD (on the MASTER). Now, some sub-shapes have become not-shared, simply. In my opinion, we shall apply new behavior of these tests. c) boolean bsection M3 The problem described in the issue #0026777 exists even on the current MASTER. d) boolean bsection M9 The problem is described in the message http://tracker.dev.opencascade.org/view.php?id=26815#c47546. Here, we have really regression in the picture. e) boolean bsection N2 The problem is described in issue #0026814. f) boolean volumemaker G1 The problem is described in issue #26020. g) bugs modalg_1 bug1255 (and bug1255_1) The problem is described in issue #26815. h) bugs modalg_2 bug5805_18, bugs modalg_2 bug5805_42, bugs modalg_2 bug5805_46 The problem is described in issue #25925. i) bugs modalg_3 bug602 The problem is describes in issue #602. j) bugs modalg_5 bug24915 The problem is described in the message http://tracker.dev.opencascade.org/view.php?id=25929#c48565. It is not fixed by this issue. k) bugs modalg_5 bug25838 The main reason is described in issue #0026816. ---------------------------------------------------------------------------- 2. Improvements: a) boolean volumemaker F9 b) bugs modalg_1 bug10160_3 c) bugs modalg_2 bug22557 d) bugs modalg_5 bug25319_1 (_2) e) draft angle G2 f) offset shape A1 g) offset with_intersect_80 N7
This commit is contained in:
@@ -51,22 +51,24 @@ class AppParCurves_MultiBSpCurve;
|
||||
|
||||
struct Approx_Data
|
||||
{
|
||||
Approx_Data()
|
||||
Approx_Data() : myBezierApprox(Standard_True),
|
||||
Xo(0.0), Yo(0.0), Zo(0.0),
|
||||
U1o(0.0), V1o(0.0), U2o(0.0), V2o(0.0),
|
||||
ApproxXYZ(Standard_True),
|
||||
ApproxU1V1(Standard_True),
|
||||
ApproxU2V2(Standard_True),
|
||||
indicemin(0), indicemax(0),
|
||||
myNbPntMax(30), parametrization(Approx_ChordLength)
|
||||
{
|
||||
myMinFactorXYZ = 0.0;
|
||||
myMinFactorUV = 0.0;
|
||||
}
|
||||
|
||||
Standard_Boolean myBezierApprox;
|
||||
Standard_Real Xo, Ax, Yo, Ay, Zo, Az,
|
||||
U1o, A1u, V1o, A1v, U2o, A2u, V2o, A2v;
|
||||
Standard_Real Xo, Yo, Zo, U1o, V1o, U2o, V2o;
|
||||
Standard_Boolean ApproxXYZ, ApproxU1V1, ApproxU2V2;
|
||||
Standard_Integer indicemin, indicemax, nbpntmax;
|
||||
Standard_Integer indicemin, indicemax, myNbPntMax;
|
||||
Approx_ParametrizationType parametrization;
|
||||
Standard_Real myMinFactorXYZ, myMinFactorUV;
|
||||
};
|
||||
|
||||
|
||||
class BRepApprox_Approx
|
||||
{
|
||||
public:
|
||||
@@ -80,10 +82,16 @@ public:
|
||||
|
||||
Standard_EXPORT void Perform (const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ = Standard_True, const Standard_Boolean ApproxU1V1 = Standard_True, const Standard_Boolean ApproxU2V2 = Standard_True, const Standard_Integer indicemin = 0, const Standard_Integer indicemax = 0);
|
||||
|
||||
Standard_EXPORT void SetParameters (const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer DegMin, const Standard_Integer DegMax, const Standard_Integer NbIterMax, const Standard_Boolean ApproxWithTangency = Standard_True, const Approx_ParametrizationType Parametrization = Approx_ChordLength);
|
||||
|
||||
Standard_EXPORT void SetParameters (const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Boolean RelativeTol, const Standard_Integer DegMin, const Standard_Integer DegMax, const Standard_Integer NbIterMax, const Standard_Integer NbPntMax, const Standard_Boolean ApproxWithTangency = Standard_True, const Approx_ParametrizationType Parametrization = Approx_ChordLength);
|
||||
|
||||
Standard_EXPORT
|
||||
void SetParameters (const Standard_Real Tol3d, const Standard_Real Tol2d,
|
||||
const Standard_Integer DegMin,
|
||||
const Standard_Integer DegMax,
|
||||
const Standard_Integer NbIterMax,
|
||||
const Standard_Integer NbPntMax = 30,
|
||||
const Standard_Boolean ApproxWithTangency = Standard_True,
|
||||
const Approx_ParametrizationType
|
||||
Parametrization = Approx_ChordLength);
|
||||
|
||||
Standard_EXPORT void Perform();
|
||||
|
||||
Standard_EXPORT Standard_Real TolReached3d() const;
|
||||
@@ -106,22 +114,12 @@ protected:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
Standard_EXPORT Standard_Integer CorrectFinishIdx(const Standard_Integer theMinIdx,
|
||||
const Standard_Integer theMaxIdx,
|
||||
const Handle(BRepApprox_ApproxLine)& theline);
|
||||
|
||||
Standard_EXPORT void Perform (const BRepAdaptor_Surface& Surf1, const IntSurf_Quadric& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ, const Standard_Boolean ApproxU1V1, const Standard_Boolean ApproxU2V2, const Standard_Integer indicemin, const Standard_Integer indicemax);
|
||||
|
||||
Standard_EXPORT void Perform (const IntSurf_Quadric& Surf1, const BRepAdaptor_Surface& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ, const Standard_Boolean ApproxU1V1, const Standard_Boolean ApproxU2V2, const Standard_Integer indicemin, const Standard_Integer indicemax);
|
||||
Standard_EXPORT void Perform (const IntSurf_Quadric& Surf1, const BRepAdaptor_Surface& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ, const Standard_Boolean ApproxU1V1, const Standard_Boolean ApproxU2V2, const Standard_Integer indicemin, const Standard_Integer indicemax, const Standard_Boolean isTheQuadFirst);
|
||||
|
||||
Standard_EXPORT void UpdateTolReached();
|
||||
|
||||
//! Fill data structure for intersection approximation.
|
||||
Standard_EXPORT void fillData(const Handle(BRepApprox_ApproxLine)& theLine,
|
||||
const Standard_Boolean theApproxXYZ,
|
||||
const Standard_Boolean theApproxU1V1,
|
||||
const Standard_Boolean theApproxU2V2);
|
||||
Standard_EXPORT void fillData(const Handle(BRepApprox_ApproxLine)& theLine);
|
||||
|
||||
//! Prepare data structure for further computations.
|
||||
Standard_EXPORT void prepareDS(const Standard_Boolean theApproxXYZ,
|
||||
@@ -141,19 +139,15 @@ private:
|
||||
BRepApprox_TheComputeLineOfApprox myComputeLine;
|
||||
BRepApprox_TheComputeLineBezierOfApprox myComputeLineBezier;
|
||||
Approx_MCurvesToBSpCurve myBezToBSpl;
|
||||
Standard_Boolean myTolReached;
|
||||
Standard_Boolean myWithTangency;
|
||||
Standard_Real myTol3d;
|
||||
Standard_Real myTol2d;
|
||||
Standard_Boolean myRelativeTol;
|
||||
Standard_Integer myDegMin;
|
||||
Standard_Integer myDegMax;
|
||||
Standard_Integer myNbPntMax;
|
||||
Standard_Integer myNbIterMax;
|
||||
Standard_Real myTolReached3d;
|
||||
Standard_Real myTolReached2d;
|
||||
Approx_Data myData;
|
||||
Standard_Real myUVRes1, myUVRes2;
|
||||
NCollection_Vector<Standard_Integer> myKnots;
|
||||
|
||||
};
|
||||
|
@@ -116,15 +116,12 @@ public:
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& SplineValue();
|
||||
|
||||
//! returns the type of parametrization
|
||||
Standard_EXPORT void Parametrization (Approx_ParametrizationType& partype) const;
|
||||
Standard_EXPORT Approx_ParametrizationType Parametrization () const;
|
||||
|
||||
//! returns the new parameters of the approximation
|
||||
//! corresponding to the points of the multicurve <Index>.
|
||||
Standard_EXPORT const TColStd_Array1OfReal& Parameters (const Standard_Integer Index = 1) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
@@ -40,56 +40,71 @@ class BRepApprox_TheMultiLineOfApprox
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! The class SvSurfaces is used when the
|
||||
//! approximation algorithm needs some extra points on
|
||||
//! the line <line>. A New line is then created which
|
||||
//! shares the same surfaces and functions.
|
||||
//!
|
||||
//! SvSurfaces is a deferred class which allows
|
||||
//! several implementations of this algorithm with
|
||||
//! different surfaces (bi-parametric ones, or
|
||||
//! The class SvSurfaces is used when the approximation algorithm
|
||||
//! needs some extra points on the line <line>.
|
||||
//! A New line is then created which shares the same surfaces and functions.
|
||||
//! SvSurfaces is a deferred class which allows several implementations of
|
||||
//! this algorithm with different surfaces (bi-parametric ones, or
|
||||
//! implicit and biparametric ones)
|
||||
Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line, const Standard_Address PtrSvSurfaces, const Standard_Integer NbP3d, const Standard_Integer NbP2d, const Standard_Real xo, const Standard_Real ax, const Standard_Real yo, const Standard_Real ay, const Standard_Real zo, const Standard_Real az, const Standard_Real u1o, const Standard_Real a1u, const Standard_Real v1o, const Standard_Real a1v, const Standard_Real u2o, const Standard_Real a2u, const Standard_Real v2o, const Standard_Real a2v, const Standard_Boolean P2DOnFirst, const Standard_Integer IndMin = 0, const Standard_Integer IndMax = 0);
|
||||
|
||||
Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line,
|
||||
const Standard_Address PtrSvSurfaces,
|
||||
const Standard_Integer NbP3d,
|
||||
const Standard_Integer NbP2d,
|
||||
const Standard_Real xo,
|
||||
const Standard_Real yo,
|
||||
const Standard_Real zo,
|
||||
const Standard_Real u1o,
|
||||
const Standard_Real v1o,
|
||||
const Standard_Real u2o,
|
||||
const Standard_Real v2o,
|
||||
const Standard_Boolean P2DOnFirst,
|
||||
const Standard_Integer IndMin = 0,
|
||||
const Standard_Integer IndMax = 0);
|
||||
|
||||
//! No Extra points will be added on the current line
|
||||
Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line, const Standard_Integer NbP3d, const Standard_Integer NbP2d, const Standard_Real xo, const Standard_Real ax, const Standard_Real yo, const Standard_Real ay, const Standard_Real zo, const Standard_Real az, const Standard_Real u1o, const Standard_Real a1u, const Standard_Real v1o, const Standard_Real a1v, const Standard_Real u2o, const Standard_Real a2u, const Standard_Real v2o, const Standard_Real a2v, const Standard_Boolean P2DOnFirst, const Standard_Integer IndMin = 0, const Standard_Integer IndMax = 0);
|
||||
|
||||
Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line,
|
||||
const Standard_Integer NbP3d,
|
||||
const Standard_Integer NbP2d,
|
||||
const Standard_Real xo,
|
||||
const Standard_Real yo,
|
||||
const Standard_Real zo,
|
||||
const Standard_Real u1o,
|
||||
const Standard_Real v1o,
|
||||
const Standard_Real u2o,
|
||||
const Standard_Real v2o,
|
||||
const Standard_Boolean P2DOnFirst,
|
||||
const Standard_Integer IndMin = 0,
|
||||
const Standard_Integer IndMax = 0);
|
||||
|
||||
Standard_EXPORT Standard_Integer FirstPoint() const;
|
||||
|
||||
Standard_EXPORT Standard_Integer LastPoint() const;
|
||||
|
||||
|
||||
//! Returns the number of 2d points of a TheLine.
|
||||
Standard_EXPORT Standard_Integer NbP2d() const;
|
||||
|
||||
|
||||
//! Returns the number of 3d points of a TheLine.
|
||||
Standard_EXPORT Standard_Integer NbP3d() const;
|
||||
|
||||
|
||||
Standard_EXPORT Approx_Status WhatStatus() const;
|
||||
|
||||
//! returns the 3d points of the multipoint <MPointIndex>
|
||||
//! when only 3d points exist.
|
||||
//! Returns the 3d points of the multipoint <MPointIndex> when only 3d points exist.
|
||||
Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt) const;
|
||||
|
||||
//! returns the 2d points of the multipoint <MPointIndex>
|
||||
//! when only 2d points exist.
|
||||
|
||||
//! Returns the 2d points of the multipoint <MPointIndex> when only 2d points exist.
|
||||
Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt2d& tabPt2d) const;
|
||||
|
||||
//! returns the 3d and 2d points of the multipoint
|
||||
//! <MPointIndex>.
|
||||
|
||||
//! Returns the 3d and 2d points of the multipoint <MPointIndex>.
|
||||
Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt, TColgp_Array1OfPnt2d& tabPt2d) const;
|
||||
|
||||
//! returns the 3d points of the multipoint <MPointIndex>
|
||||
//! when only 3d points exist.
|
||||
|
||||
//! Returns the 3d tangency points of the multipoint <MPointIndex> only when 3d points exist.
|
||||
Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV) const;
|
||||
|
||||
//! returns the 2d tangency points of the multipoint
|
||||
//! <MPointIndex> only when 2d points exist.
|
||||
//! Returns the 2d tangency points of the multipoint <MPointIndex> only when 2d points exist.
|
||||
Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec2d& tabV2d) const;
|
||||
|
||||
//! returns the 3d and 2d points of the multipoint
|
||||
//! <MPointIndex>.
|
||||
//! Returns the 3d and 2d points of the multipoint <MPointIndex>.
|
||||
Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV, TColgp_Array1OfVec2d& tabV2d) const;
|
||||
|
||||
Standard_EXPORT BRepApprox_TheMultiLineOfApprox MakeMLBetween (const Standard_Integer Low, const Standard_Integer High, const Standard_Integer NbPointsToInsert) const;
|
||||
@@ -97,48 +112,25 @@ public:
|
||||
//! Dump of the current multi-line.
|
||||
Standard_EXPORT void Dump() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
BRepApprox_TheMultiLineOfApprox operator=(BRepApprox_TheMultiLineOfApprox&);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Address PtrOnmySvSurfaces;
|
||||
Handle(BRepApprox_ApproxLine) myLine;
|
||||
Standard_Integer indicemin;
|
||||
Standard_Integer indicemax;
|
||||
Standard_Integer nbp3d;
|
||||
Standard_Integer nbp2d;
|
||||
Standard_Boolean p2donfirst;
|
||||
Standard_Real Xo;
|
||||
Standard_Real Ax;
|
||||
Standard_Real Yo;
|
||||
Standard_Real Ay;
|
||||
Standard_Real Zo;
|
||||
Standard_Real Az;
|
||||
Standard_Real U1o;
|
||||
Standard_Real A1u;
|
||||
Standard_Real V1o;
|
||||
Standard_Real A1v;
|
||||
Standard_Real U2o;
|
||||
Standard_Real A2u;
|
||||
Standard_Real V2o;
|
||||
Standard_Real A2v;
|
||||
|
||||
const Standard_Address PtrOnmySvSurfaces;
|
||||
const Handle(BRepApprox_ApproxLine) myLine;
|
||||
const Standard_Integer indicemin;
|
||||
const Standard_Integer indicemax;
|
||||
const Standard_Integer nbp3d;
|
||||
const Standard_Integer nbp2d;
|
||||
const Standard_Boolean p2donfirst;
|
||||
const Standard_Real Xo;
|
||||
const Standard_Real Yo;
|
||||
const Standard_Real Zo;
|
||||
const Standard_Real U1o;
|
||||
const Standard_Real V1o;
|
||||
const Standard_Real U2o;
|
||||
const Standard_Real V2o;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepApprox_TheMultiLineOfApprox_HeaderFile
|
||||
|
Reference in New Issue
Block a user