mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0028828: Modeling Algorithms - New functionalities of BRepFilletAPI_MakeChamfer algorithm
Two new functionalities have been added in BRepFilletAPI_MakeChamfer: - constant throat (the section of chamfer is isosceles triangle, its height is constant in all sections - this is the "throat" of the weld); - constant throat with penetration(the section of chamfer is right-angled triangle, the first of two surfaces (where is the top of the chamfer) is virtually moved inside the solid by offset operation, the apex of the section is on the intersection curve between moved surface and second surface, right angle is at the top of the chamfer, the length of the leg from apex to top is constant - this is the "throat" of the weld). - New abstract classes BlendFunc_GenChamfer and BlendFunc_GenChamfInv have been added; - Class BlendFunc_Chamfer is now descended from BlendFunc_GenChamfer, class BlendFunc_ChamfInv is now descended from BlendFunc_GenChamfInv. - New class BlendFunc_ConstThroat is descended from BlendFunc_GenChamfer, new class BlendFund_ConstThroatInv is descended from BlendFunc_GenChamfInv. - New class BlendFunc_ConstThroatWithPenetration is descended from BlendFunc_GenChamfer, new class BlendFund_ConstThroatWithPenetrationInv is descended from BlendFunc_GenChamfInv. - Class ChFi3d_ChBuilder has now mode of chamfer that can be ClassicChamfer, ConstThroatChamfer and ConstThroatWithPenetrationChamfer. - Two new DRAW Test Harness commands "chamf_throat" ant "chamf_throat_with_penetration" have been added for the second mode of ChBuilder. - The interface of DRAW Test Harness command "chamf" changed for symmetric case.
This commit is contained in:
37
src/ChFiDS/ChFiDS_ChamfMode.hxx
Normal file
37
src/ChFiDS/ChFiDS_ChamfMode.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created by: Julia GERASIMOVA
|
||||
// Copyright (c) 2015 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 _ChFiDS_ChamfMode_HeaderFile
|
||||
#define _ChFiDS_ChamfMode_HeaderFile
|
||||
|
||||
//! this enumeration defines several modes of chamfer
|
||||
enum ChFiDS_ChamfMode
|
||||
{
|
||||
//! chamfer with constant distance from spine to one of the two surfaces
|
||||
ChFiDS_ClassicChamfer,
|
||||
|
||||
//! symmetric chamfer with constant throat
|
||||
//! that is the height of isosceles triangle in section
|
||||
ChFiDS_ConstThroatChamfer,
|
||||
|
||||
//! chamfer with constant throat: the section of chamfer is right-angled triangle,
|
||||
//! the first of two surfaces (where is the top of the chamfer)
|
||||
//! is virtually moved inside the solid by offset operation,
|
||||
//! the apex of the section is on the intersection curve between moved surface and second surface,
|
||||
//! right angle is at the top of the chamfer,
|
||||
//! the length of the leg from apex to top is constant - it is throat
|
||||
ChFiDS_ConstThroatWithPenetrationChamfer
|
||||
};
|
||||
|
||||
#endif // _ChFiDS_ChamfMode_HeaderFile
|
@@ -25,12 +25,16 @@ IMPLEMENT_STANDARD_RTTIEXT(ChFiDS_ChamfSpine,ChFiDS_Spine)
|
||||
//function : ChFiDS_ChamfSpine
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
ChFiDS_ChamfSpine::ChFiDS_ChamfSpine(){}
|
||||
ChFiDS_ChamfSpine::ChFiDS_ChamfSpine()
|
||||
{
|
||||
myMode = ChFiDS_ClassicChamfer;
|
||||
}
|
||||
|
||||
ChFiDS_ChamfSpine::ChFiDS_ChamfSpine(const Standard_Real Tol):
|
||||
ChFiDS_Spine(Tol)
|
||||
{}
|
||||
|
||||
{
|
||||
myMode = ChFiDS_ClassicChamfer;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetDist
|
||||
@@ -92,13 +96,14 @@ void ChFiDS_ChamfSpine::SetDists(const Standard_Real Dis1,
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ChamfSpine::GetDistAngle(Standard_Real& Dis,
|
||||
Standard_Real& Angle,
|
||||
Standard_Boolean& DisOnF1)const
|
||||
Standard_Real& Angle) const
|
||||
//Standard_Boolean& DisOnF1)const
|
||||
{
|
||||
if (mChamf != ChFiDS_DistAngle) throw Standard_Failure("Chamfer is not a Two Dists Chamfer");
|
||||
if (mChamf != ChFiDS_DistAngle)
|
||||
throw Standard_Failure("Chamfer is not a Two Dists Chamfer");
|
||||
Dis = d1;
|
||||
Angle = angle;
|
||||
DisOnF1 = dison1;
|
||||
//DisOnF1 = dison1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -107,16 +112,25 @@ void ChFiDS_ChamfSpine::GetDistAngle(Standard_Real& Dis,
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ChamfSpine::SetDistAngle(const Standard_Real Dis,
|
||||
const Standard_Real Angle,
|
||||
const Standard_Boolean DisOnF1)
|
||||
const Standard_Real Angle)
|
||||
//const Standard_Boolean DisOnF1)
|
||||
{
|
||||
//isconstant->Init(Standard_True);
|
||||
mChamf = ChFiDS_DistAngle;
|
||||
d1 = Dis;
|
||||
angle = Angle;
|
||||
dison1 = DisOnF1;
|
||||
//dison1 = DisOnF1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ChamfSpine::SetMode(const ChFiDS_ChamfMode theMode)
|
||||
{
|
||||
myMode = theMode;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsChamfer
|
||||
@@ -128,6 +142,3 @@ ChFiDS_ChamfMethod ChFiDS_ChamfSpine::IsChamfer() const
|
||||
|
||||
return mChamf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <ChFiDS_ChamfMethod.hxx>
|
||||
#include <ChFiDS_ChamfMode.hxx>
|
||||
#include <ChFiDS_Spine.hxx>
|
||||
|
||||
|
||||
@@ -49,13 +50,17 @@ public:
|
||||
|
||||
Standard_EXPORT void Dists (Standard_Real& Dis1, Standard_Real& Dis2) const;
|
||||
|
||||
Standard_EXPORT void GetDistAngle (Standard_Real& Dis, Standard_Real& Angle, Standard_Boolean& DisOnF1) const;
|
||||
Standard_EXPORT void GetDistAngle (Standard_Real& Dis, Standard_Real& Angle) const;
|
||||
|
||||
Standard_EXPORT void SetDistAngle (const Standard_Real Dis, const Standard_Real Angle, const Standard_Boolean DisOnF1);
|
||||
Standard_EXPORT void SetDistAngle (const Standard_Real Dis, const Standard_Real Angle);
|
||||
|
||||
Standard_EXPORT void SetMode (const ChFiDS_ChamfMode theMode);
|
||||
|
||||
//! Return the method of chamfers used
|
||||
Standard_EXPORT ChFiDS_ChamfMethod IsChamfer() const;
|
||||
|
||||
//! Return the mode of chamfers used
|
||||
//Standard_EXPORT ChFiDS_ChamfMode Mode() const;
|
||||
|
||||
|
||||
|
||||
@@ -71,7 +76,7 @@ private:
|
||||
|
||||
Standard_Real d1;
|
||||
Standard_Real d2;
|
||||
Standard_Boolean dison1;
|
||||
//Standard_Boolean dison1;
|
||||
Standard_Real angle;
|
||||
ChFiDS_ChamfMethod mChamf;
|
||||
|
||||
|
@@ -40,29 +40,35 @@ IMPLEMENT_STANDARD_RTTIEXT(ChFiDS_Spine,Standard_Transient)
|
||||
//function : ChFiDS_Spine
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
ChFiDS_Spine::ChFiDS_Spine():
|
||||
splitdone(Standard_False),
|
||||
tolesp(Precision::Confusion()),
|
||||
firstprolon(Standard_False),
|
||||
lastprolon(Standard_False),
|
||||
firstistgt(Standard_False),
|
||||
lastistgt(Standard_False),
|
||||
hasfirsttgt(Standard_False),
|
||||
haslasttgt(Standard_False),
|
||||
hasref(Standard_False)
|
||||
ChFiDS_Spine::ChFiDS_Spine()
|
||||
: splitdone(Standard_False),
|
||||
myMode(ChFiDS_ClassicChamfer),
|
||||
tolesp(Precision::Confusion()),
|
||||
firstprolon(Standard_False),
|
||||
lastprolon(Standard_False),
|
||||
firstistgt(Standard_False),
|
||||
lastistgt(Standard_False),
|
||||
hasfirsttgt(Standard_False),
|
||||
haslasttgt(Standard_False),
|
||||
hasref(Standard_False)
|
||||
{
|
||||
}
|
||||
|
||||
ChFiDS_Spine::ChFiDS_Spine(const Standard_Real Tol):
|
||||
splitdone(Standard_False),
|
||||
tolesp(Tol),
|
||||
firstprolon(Standard_False),
|
||||
lastprolon(Standard_False),
|
||||
firstistgt(Standard_False),
|
||||
lastistgt(Standard_False),
|
||||
hasfirsttgt(Standard_False),
|
||||
haslasttgt(Standard_False),
|
||||
hasref(Standard_False)
|
||||
//=======================================================================
|
||||
//function : ChFiDS_Spine
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
ChFiDS_Spine::ChFiDS_Spine(const Standard_Real Tol)
|
||||
: splitdone(Standard_False),
|
||||
myMode(ChFiDS_ClassicChamfer),
|
||||
tolesp(Tol),
|
||||
firstprolon(Standard_False),
|
||||
lastprolon(Standard_False),
|
||||
firstistgt(Standard_False),
|
||||
lastistgt(Standard_False),
|
||||
hasfirsttgt(Standard_False),
|
||||
haslasttgt(Standard_False),
|
||||
hasref(Standard_False)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -76,6 +82,16 @@ void ChFiDS_Spine::AppendElSpine(const Handle(ChFiDS_HElSpine)& Els)
|
||||
elspines.Append(Els);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AppendOffsetElSpine
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::AppendOffsetElSpine(const Handle(ChFiDS_HElSpine)& Els)
|
||||
{
|
||||
offset_elspines.Append(Els);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ElSpine
|
||||
//purpose :
|
||||
@@ -120,6 +136,16 @@ ChFiDS_ListOfHElSpine& ChFiDS_Spine::ChangeElSpines()
|
||||
return elspines;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeOffsetElSpines
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ChFiDS_ListOfHElSpine& ChFiDS_Spine::ChangeOffsetElSpines()
|
||||
{
|
||||
return offset_elspines;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SplitDone
|
||||
//purpose :
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include <ChFiDS_ErrorStatus.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <ChFiDS_ChamfMode.hxx>
|
||||
class TopoDS_Edge;
|
||||
class ChFiDS_HElSpine;
|
||||
class gp_Lin;
|
||||
@@ -83,13 +84,21 @@ public:
|
||||
//! store edges composing the guideline
|
||||
void SetEdges (const TopoDS_Edge& E);
|
||||
|
||||
//! store offset edges composing the offset guideline
|
||||
void SetOffsetEdges (const TopoDS_Edge& E);
|
||||
|
||||
//! store the edge at the first position before all others
|
||||
void PutInFirst (const TopoDS_Edge& E);
|
||||
|
||||
//! store the offset edge at the first position before all others
|
||||
void PutInFirstOffset (const TopoDS_Edge& E);
|
||||
|
||||
Standard_Integer NbEdges() const;
|
||||
|
||||
const TopoDS_Edge& Edges (const Standard_Integer I) const;
|
||||
|
||||
const TopoDS_Edge& OffsetEdges (const Standard_Integer I) const;
|
||||
|
||||
//! stores if the start of a set of edges starts on a
|
||||
//! section of free border or forms a closed contour
|
||||
void SetFirstStatus (const ChFiDS_State S);
|
||||
@@ -100,6 +109,8 @@ public:
|
||||
|
||||
Standard_EXPORT virtual void AppendElSpine (const Handle(ChFiDS_HElSpine)& Els);
|
||||
|
||||
Standard_EXPORT virtual void AppendOffsetElSpine (const Handle(ChFiDS_HElSpine)& Els);
|
||||
|
||||
Standard_EXPORT Handle(ChFiDS_HElSpine) ElSpine (const Standard_Integer IE) const;
|
||||
|
||||
Standard_EXPORT Handle(ChFiDS_HElSpine) ElSpine (const TopoDS_Edge& E) const;
|
||||
@@ -108,6 +119,8 @@ public:
|
||||
|
||||
Standard_EXPORT ChFiDS_ListOfHElSpine& ChangeElSpines();
|
||||
|
||||
Standard_EXPORT ChFiDS_ListOfHElSpine& ChangeOffsetElSpines();
|
||||
|
||||
Standard_EXPORT virtual void Reset (const Standard_Boolean AllData = Standard_False);
|
||||
|
||||
Standard_EXPORT Standard_Boolean SplitDone() const;
|
||||
@@ -227,6 +240,8 @@ public:
|
||||
|
||||
Standard_EXPORT ChFiDS_ErrorStatus ErrorStatus() const;
|
||||
|
||||
//! Return the mode of chamfers used
|
||||
Standard_EXPORT ChFiDS_ChamfMode Mode() const;
|
||||
|
||||
|
||||
|
||||
@@ -237,6 +252,8 @@ protected:
|
||||
|
||||
Standard_Boolean splitdone;
|
||||
ChFiDS_ListOfHElSpine elspines;
|
||||
ChFiDS_ListOfHElSpine offset_elspines;
|
||||
ChFiDS_ChamfMode myMode;
|
||||
|
||||
|
||||
private:
|
||||
@@ -245,11 +262,14 @@ private:
|
||||
Standard_EXPORT void Prepare (Standard_Real& L, Standard_Integer& Index) const;
|
||||
|
||||
BRepAdaptor_Curve myCurve;
|
||||
BRepAdaptor_Curve myOffsetCurve;
|
||||
Standard_Integer indexofcurve;
|
||||
ChFiDS_State firstState;
|
||||
ChFiDS_State lastState;
|
||||
TopTools_SequenceOfShape spine;
|
||||
TopTools_SequenceOfShape offsetspine;
|
||||
Handle(TColStd_HArray1OfReal) abscissa;
|
||||
Handle(TColStd_HArray1OfReal) offset_abscissa;
|
||||
Standard_Real tolesp;
|
||||
Standard_Real firstparam;
|
||||
Standard_Real lastparam;
|
||||
|
@@ -124,6 +124,16 @@ inline const TopoDS_Edge& ChFiDS_Spine::Edges(const Standard_Integer I) const
|
||||
return TopoDS::Edge(spine.Value(I));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : OffsetEdges
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const TopoDS_Edge& ChFiDS_Spine::OffsetEdges(const Standard_Integer I) const
|
||||
{
|
||||
return TopoDS::Edge(offsetspine.Value(I));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetEdges
|
||||
//purpose :
|
||||
@@ -134,6 +144,16 @@ inline void ChFiDS_Spine::SetEdges(const TopoDS_Edge& E)
|
||||
spine.Append(E);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetOffsetEdges
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Spine::SetOffsetEdges(const TopoDS_Edge& E)
|
||||
{
|
||||
offsetspine.Append(E);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PutInFirst
|
||||
//purpose :
|
||||
@@ -144,6 +164,16 @@ inline void ChFiDS_Spine::PutInFirst(const TopoDS_Edge& E)
|
||||
spine.InsertBefore(1,E);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PutInFirstOffset
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Spine::PutInFirstOffset(const TopoDS_Edge& E)
|
||||
{
|
||||
offsetspine.InsertBefore(1,E);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CurrentIndexOfElementarySpine
|
||||
//purpose :
|
||||
@@ -152,3 +182,14 @@ inline Standard_Integer ChFiDS_Spine::CurrentIndexOfElementarySpine() const
|
||||
{
|
||||
return indexofcurve;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Mode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline ChFiDS_ChamfMode ChFiDS_Spine::Mode() const
|
||||
{
|
||||
|
||||
return myMode;
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
ChFiDS_ChamfMethod.hxx
|
||||
ChFiDS_ChamfMode.hxx
|
||||
ChFiDS_ChamfSpine.cxx
|
||||
ChFiDS_ChamfSpine.hxx
|
||||
ChFiDS_CircSection.cxx
|
||||
|
Reference in New Issue
Block a user