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

0024988: Wrong result done by projection algorithm

Wrong border 1.0e-9 jump has deleted. Added periodicity information when projecting to surface.
Period "jump" bug fixes.

AppCont_LeastSquare conversion to non cdl class.
AppCont_Function + AppCont_FunctionTool combined in one class providing the same functionality and converted to non cdl.
Testcase modification.

Test cases for issue CR24988

Fixed incorrect comparison.
This commit is contained in:
aml
2014-12-04 15:04:22 +03:00
committed by bugmaster
parent e8feb725a4
commit 368cdde60e
37 changed files with 1164 additions and 1704 deletions

View File

@@ -108,12 +108,10 @@ is
List from TCollection (OffsetWire from BRepFill);
private class ApproxSeewing;
private class MultiLine;
private class MultiLineTool;
imported MultiLine;
private class ComputeCLine instantiates
ComputeCLine from Approx ( MultiLine, MultiLineTool);
ComputeCLine from Approx (MultiLine);
private class TrimSurfaceTool;

View File

@@ -1,112 +0,0 @@
-- Created on: 1994-11-14
-- Created by: Bruno DUMORTIER
-- Copyright (c) 1994-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.
private class MultiLine from BRepFill
---Purpose: Private class used to compute the 3d curve and the
-- two 2d curves resulting from the intersection of a
-- surface of linear extrusion( Bissec, Dz) and the 2
-- faces.
-- This 3 curves will have the same parametrization
-- as the Bissectrice.
-- This class is to be send to an approximation
-- routine.
uses
Face from TopoDS,
Edge from TopoDS,
Curve from Geom,
Curve from Geom2d,
Curve from Geom2dAdaptor,
Pnt from gp,
Pnt2d from gp,
Shape from GeomAbs
raises
DomainError from Standard
is
Create;
Create( Face1, Face2 : Face from TopoDS;
Edge1, Edge2 : Edge from TopoDS;
Inv1 , Inv2 : Boolean from Standard;
Bissec : Curve from Geom2d );
IsParticularCase(me)
returns Boolean from Standard
---Purpose: Search if the Projection of the Bissectrice on the
-- faces needs an approximation or not.
-- Returns true if the approximation is not needed.
is static;
Continuity (me) returns Shape from GeomAbs
---Purpose: Returns the continuity betwwen the two faces
-- seShape from GeomAbsparated by myBis.
is static;
Curves(me; Curve : in out Curve from Geom;
PCurve1 : in out Curve from Geom2d;
PCurve2 : in out Curve from Geom2d)
raises
DomainError from Standard
---Purpose: raises if IsParticularCase is <False>.
is static;
FirstParameter(me)
---Purpose: returns the first parameter of the Bissectrice.
returns Real from Standard is static;
LastParameter(me)
---Purpose: returns the last parameter of the Bissectrice.
returns Real from Standard is static;
Value ( me; U : Real from Standard)
---Purpose: Returns the current point on the 3d curve
returns Pnt from gp is static;
ValueOnF1(me; U : Real from Standard)
---Purpose: returns the current point on the PCurve of the
-- first face
returns Pnt2d from gp is static;
ValueOnF2(me; U : Real from Standard)
---Purpose: returns the current point on the PCurve of the
-- first face
returns Pnt2d from gp is static;
Value3dOnF1OnF2(me;
U : Real from Standard;
P3d : in out Pnt from gp;
PF1 : in out Pnt2d from gp;
PF2 : in out Pnt2d from gp)
is static;
fields
myFace1 : Face from TopoDS;
myFace2 : Face from TopoDS;
myU1 : Curve from Geom2dAdaptor;
myV1 : Curve from Geom2dAdaptor;
myU2 : Curve from Geom2dAdaptor;
myV2 : Curve from Geom2dAdaptor;
myIsoU1 : Boolean from Standard;
myIsoU2 : Boolean from Standard;
myBis : Curve from Geom2dAdaptor;
myKPart : Integer from Standard;
myCont : Shape from GeomAbs;
end MultiLine;

View File

@@ -14,7 +14,7 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepFill_MultiLine.ixx>
#include <BRepFill_MultiLine.hxx>
#include <BRepIntCurveSurface_Inter.hxx>
#include <gp.hxx>
@@ -80,8 +80,6 @@ static Standard_Boolean isIsoU(const TopoDS_Face& Face,
}
//=======================================================================
//function : BRepFill_MultiLine
//purpose :
@@ -89,6 +87,8 @@ static Standard_Boolean isIsoU(const TopoDS_Face& Face,
BRepFill_MultiLine::BRepFill_MultiLine()
{
myNbPnt2d = 2;
myNbPnt = 1;
}
@@ -98,17 +98,20 @@ BRepFill_MultiLine::BRepFill_MultiLine()
//=======================================================================
BRepFill_MultiLine::BRepFill_MultiLine(const TopoDS_Face& Face1,
const TopoDS_Face& Face2,
const TopoDS_Edge& Edge1,
const TopoDS_Edge& Edge2,
const Standard_Boolean Inv1,
const Standard_Boolean Inv2,
const Handle(Geom2d_Curve)& Bissec) :
myFace1(Face1 ),
myFace2(Face2 ),
myBis (Bissec),
myKPart(0)
const TopoDS_Face& Face2,
const TopoDS_Edge& Edge1,
const TopoDS_Edge& Edge2,
const Standard_Boolean Inv1,
const Standard_Boolean Inv2,
const Handle(Geom2d_Curve)& Bissec)
: myFace1(Face1 ),
myFace2(Face2 ),
myBis (Bissec),
myKPart(0)
{
myNbPnt2d = 2;
myNbPnt = 1;
// eval if myedges are IsoU or not
myIsoU1 = isIsoU(Face1, Edge1);
myIsoU2 = isIsoU(Face2, Edge2);
@@ -149,7 +152,6 @@ myKPart(0)
Vmax = Max(Vmax,V);
}
}
// return isos in their domain of restriction.
Handle(Geom_Curve) UU1, UU2, VV1, VV2;
@@ -765,3 +767,30 @@ GeomAbs_Shape BRepFill_MultiLine::Continuity() const
{
return myCont;
}
//=======================================================================
//function : Value
//purpose :
//=======================================================================
Standard_Boolean BRepFill_MultiLine::Value(const Standard_Real theT,
NCollection_Array1<gp_Pnt2d>& thePnt2d,
NCollection_Array1<gp_Pnt>& thePnt) const
{
thePnt(1) = Value(theT);
thePnt2d(1) = ValueOnF1(theT);
thePnt2d(2) = ValueOnF2(theT);
return Standard_True;
}
//=======================================================================
//function : Value
//purpose :
//=======================================================================
Standard_Boolean BRepFill_MultiLine::D1(const Standard_Real /*theT*/,
NCollection_Array1<gp_Vec2d>& /*theVec2d*/,
NCollection_Array1<gp_Vec>& /*theVec*/) const
{
return Standard_False;
}

View File

@@ -0,0 +1,117 @@
// Created on: 1994-11-14
// Created by: Bruno DUMORTIER
// Copyright (c) 1994-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 _BRepFill_MultiLine_HeaderFile
#define _BRepFill_MultiLine_HeaderFile
#include <AppCont_Function.hxx>
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Macro.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <GeomAbs_Shape.hxx>
#include <Handle_Geom2d_Curve.hxx>
#include <Handle_Geom_Curve.hxx>
#include <Standard_Real.hxx>
class Standard_DomainError;
class TopoDS_Face;
class TopoDS_Edge;
class Geom2d_Curve;
class Geom_Curve;
class gp_Pnt;
class gp_Pnt2d;
//! Class used to compute the 3d curve and the
//! two 2d curves resulting from the intersection of a
//! surface of linear extrusion( Bissec, Dz) and the 2
//! faces.
//! This 3 curves will have the same parametrization
//! as the Bissectrice.
//! This class is to be send to an approximation
//! routine.
class BRepFill_MultiLine : public AppCont_Function
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepFill_MultiLine();
Standard_EXPORT BRepFill_MultiLine(const TopoDS_Face& Face1, const TopoDS_Face& Face2, const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2, const Standard_Boolean Inv1, const Standard_Boolean Inv2, const Handle(Geom2d_Curve)& Bissec);
//! Search if the Projection of the Bissectrice on the
//! faces needs an approximation or not.
//! Returns true if the approximation is not needed.
Standard_EXPORT Standard_Boolean IsParticularCase() const;
//! Returns the continuity betwwen the two faces
//! seShape from GeomAbsparated by myBis.
Standard_EXPORT GeomAbs_Shape Continuity() const;
//! raises if IsParticularCase is <False>.
Standard_EXPORT void Curves (Handle(Geom_Curve)& Curve, Handle(Geom2d_Curve)& PCurve1, Handle(Geom2d_Curve)& PCurve2) const;
//! returns the first parameter of the Bissectrice.
Standard_EXPORT virtual Standard_Real FirstParameter() const;
//! returns the last parameter of the Bissectrice.
Standard_EXPORT virtual Standard_Real LastParameter() const;
//! Returns the current point on the 3d curve
Standard_EXPORT gp_Pnt Value (const Standard_Real U) const;
//! returns the current point on the PCurve of the
//! first face
Standard_EXPORT gp_Pnt2d ValueOnF1 (const Standard_Real U) const;
//! returns the current point on the PCurve of the
//! first face
Standard_EXPORT gp_Pnt2d ValueOnF2 (const Standard_Real U) const;
Standard_EXPORT void Value3dOnF1OnF2 (const Standard_Real U, gp_Pnt& P3d, gp_Pnt2d& PF1, gp_Pnt2d& PF2) const;
//! Returns the point at parameter <theU>.
Standard_EXPORT virtual Standard_Boolean Value(const Standard_Real theU,
NCollection_Array1<gp_Pnt2d>& thePnt2d,
NCollection_Array1<gp_Pnt>& thePnt) const;
//! Returns the derivative at parameter <theU>.
Standard_EXPORT virtual Standard_Boolean D1(const Standard_Real theU,
NCollection_Array1<gp_Vec2d>& theVec2d,
NCollection_Array1<gp_Vec>& theVec) const;
private:
TopoDS_Face myFace1;
TopoDS_Face myFace2;
Geom2dAdaptor_Curve myU1;
Geom2dAdaptor_Curve myV1;
Geom2dAdaptor_Curve myU2;
Geom2dAdaptor_Curve myV2;
Standard_Boolean myIsoU1;
Standard_Boolean myIsoU2;
Geom2dAdaptor_Curve myBis;
Standard_Integer myKPart;
GeomAbs_Shape myCont;
};
#endif // _BRepFill_MultiLine_HeaderFile

View File

@@ -1,105 +0,0 @@
-- Created on: 1994-11-14
-- Created by: Bruno DUMORTIER
-- Copyright (c) 1994-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.
private class MultiLineTool from BRepFill
---Purpose: private class used to instantiate the continuous
-- approximations routines.
uses
Pnt from gp,
Pnt2d from gp,
Vec from gp,
Vec2d from gp,
Array1OfPnt from TColgp,
Array1OfPnt2d from TColgp,
Array1OfVec from TColgp,
Array1OfVec2d from TColgp,
MultiLine from BRepFill
is
FirstParameter(myclass; ML: MultiLine from BRepFill)
---Purpose: returns the first parameter of the Line.
returns Real from Standard;
LastParameter(myclass; ML: MultiLine from BRepFill)
---Purpose: returns the last parameter of the Line.
returns Real from Standard;
NbP2d(myclass; ML: MultiLine from BRepFill)
---Purpose: Returns the number of 2d points of a MLine
returns Integer from Standard;
NbP3d(myclass; ML: MultiLine from BRepFill)
---Purpose: Returns the number of 3d points of a MLine.
returns Integer from Standard;
Value(myclass; ML : MultiLine from BRepFill;
U : Real from Standard;
tabPt: out Array1OfPnt from TColgp);
---Purpose: returns the 3d points of the multipoint <MPointIndex>
-- when only 3d points exist.
Value(myclass; ML : MultiLine from BRepFill;
U : Real from Standard;
tabPt2d: out Array1OfPnt2d from TColgp);
---Purpose: returns the 2d points of the multipoint <MPointIndex>
-- when only 2d points exist.
Value(myclass; ML : MultiLine from BRepFill;
U : Real from Standard;
tabPt : out Array1OfPnt from TColgp;
tabPt2d: out Array1OfPnt2d from TColgp);
---Purpose: returns the 3d and 2d points of the multipoint
-- <MPointIndex>.
D1(myclass; ML : MultiLine from BRepFill;
U : Real from Standard;
tabV: out Array1OfVec from TColgp)
returns Boolean from Standard;
---Purpose: returns the 3d derivative values of the multipoint
-- <MPointIndex> when only 3d points exist.
-- returns False if the derivative cannot be computed.
D1(myclass; ML : MultiLine from BRepFill;
U : Real from Standard;
tabV2d: out Array1OfVec2d from TColgp)
returns Boolean from Standard;
---Purpose: returns the 2d derivative values of the multipoint
-- <MPointIndex> only when 2d points exist.
-- returns False if the derivative cannot be computed.
D1(myclass; ML : MultiLine from BRepFill;
U : Real from Standard;
tabV : out Array1OfVec from TColgp;
tabV2d: out Array1OfVec2d from TColgp)
returns Boolean from Standard;
---Purpose: returns the 3d and 2d derivative values of the
-- multipoint <MPointIndex>.
-- returns False if the derivative cannot be computed.
end MultiLineTool;

View File

@@ -1,147 +0,0 @@
// Created on: 1994-11-14
// Created by: Bruno DUMORTIER
// Copyright (c) 1994-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.
#include <BRepFill_MultiLineTool.ixx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
//=======================================================================
//function : FirstParameter
//purpose :
//=======================================================================
Standard_Real BRepFill_MultiLineTool::FirstParameter
(const BRepFill_MultiLine& ML)
{
return ML.FirstParameter();
}
//=======================================================================
//function : LastParameter
//purpose :
//=======================================================================
Standard_Real BRepFill_MultiLineTool::LastParameter
(const BRepFill_MultiLine& ML)
{
return ML.LastParameter();
}
//=======================================================================
//function : NbP2d
//purpose :
//=======================================================================
Standard_Integer BRepFill_MultiLineTool::NbP2d
(const BRepFill_MultiLine&)
{
return 2;
}
//=======================================================================
//function : NbP3d
//purpose :
//=======================================================================
Standard_Integer BRepFill_MultiLineTool::NbP3d(const BRepFill_MultiLine&)
{
return 1;
}
//=======================================================================
//function : Value
//purpose :
//=======================================================================
void BRepFill_MultiLineTool::Value(const BRepFill_MultiLine& ,
const Standard_Real,
TColgp_Array1OfPnt&)
{
}
//=======================================================================
//function : Value
//purpose :
//=======================================================================
void BRepFill_MultiLineTool::Value(const BRepFill_MultiLine&,
const Standard_Real,
TColgp_Array1OfPnt2d&)
{
}
//=======================================================================
//function : Value
//purpose :
//=======================================================================
void BRepFill_MultiLineTool::Value(const BRepFill_MultiLine& ML,
const Standard_Real U,
TColgp_Array1OfPnt& tabPt,
TColgp_Array1OfPnt2d& tabPt2d)
{
tabPt(1) = ML.Value(U);
tabPt2d(1) = ML.ValueOnF1(U);
tabPt2d(2) = ML.ValueOnF2(U);
}
//=======================================================================
//function : D1
//purpose :
//=======================================================================
Standard_Boolean BRepFill_MultiLineTool::D1(const BRepFill_MultiLine&,
const Standard_Real,
TColgp_Array1OfVec&)
{
return Standard_False;
}
//=======================================================================
//function : D1
//purpose :
//=======================================================================
Standard_Boolean BRepFill_MultiLineTool::D1(const BRepFill_MultiLine&,
const Standard_Real,
TColgp_Array1OfVec2d&)
{
return Standard_False;
}
//=======================================================================
//function : D1
//purpose :
//=======================================================================
Standard_Boolean BRepFill_MultiLineTool::D1(const BRepFill_MultiLine&,
const Standard_Real,
TColgp_Array1OfVec&,
TColgp_Array1OfVec2d&)
{
return Standard_False;
}

2
src/BRepFill/FILES Normal file
View File

@@ -0,0 +1,2 @@
BRepFill_MultiLine.hxx
BRepFill_MultiLine.cxx