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

0025124: [Feature request] Removal of continuity checks for offset geometries

Sometimes curve or surface, which is defined as C0, has continuity G1 or above. Offset can be built from these shapes.
Therefore, this extended checking was added into SetBasisCurve and SetBasisSurface methods.

Main changes in function BRepOffset_Tool::ExtentFace(...):
*  "return" is added if intersection (in 2D-space) between two edges in a face cannot be found.

Basis curve/surface continuity value found (if G1-checking is OK) is set up as BasisContinuity (see myBasisCurveContinuity and myBasisSurfContinuity members which is returned by GetBasisCurveContinuity and GetBasisSurfContinuity() methods). This fact is used in Geom2dAdaptor and in GeomAdaptor classes.

Possibility is entered, which allows for basis elements of offset curve/surface to avoid of C0-checking.

Test cases were changed according to their new behavior.

Test-cases for issue #25124
This commit is contained in:
nbv
2014-12-10 16:18:05 +03:00
committed by bugmaster
parent 68cdb44b0a
commit 3d58dc498b
33 changed files with 1959 additions and 1336 deletions

View File

@@ -768,7 +768,22 @@ void BRepOffset_Inter3d::ContextIntByArc(const TopTools_IndexedMapOfShape& Conte
//---------------------------------------------------
const TopoDS_Shape SI = Analyse.Ancestors(E).First();
OF1 = TopoDS::Face(InitOffsetFace.Image(SI).First());
OE = TopoDS::Edge(InitOffsetEdge.Image(E).First());
OE = TopoDS::Edge(InitOffsetEdge.Image(E).First());
{
//Check if OE has pcurve in CF
Standard_Real f,l;
Handle (Geom2d_Curve) C1 = BRep_Tool::CurveOnSurface(OE,CF,f,l);
Handle (Geom2d_Curve) C2 = BRep_Tool::CurveOnSurface(OE,OF1,f,l);
if(C1.IsNull() || C2.IsNull())
{
continue;
}
}
//--------------------------------------------------
// MAJ of OE on cap CF.
//--------------------------------------------------
@@ -804,6 +819,21 @@ void BRepOffset_Inter3d::ContextIntByArc(const TopTools_IndexedMapOfShape& Conte
//-------------------------------------------------
OF1 = TopoDS::Face(InitOffsetFace.Image(EV).First());
OE = TopoDS::Edge(InitOffsetEdge.Image(V[i]).First());
{
//Check if OE has pcurve in CF and OF1
Standard_Real f,l;
Handle (Geom2d_Curve) C1 = BRep_Tool::CurveOnSurface(OE,CF,f,l);
Handle (Geom2d_Curve) C2 = BRep_Tool::CurveOnSurface(OE,OF1,f,l);
if(C1.IsNull() || C2.IsNull())
{
continue;
}
}
//--------------------------------------------------
// MAj of OE on cap CF.
//--------------------------------------------------

View File

@@ -3610,101 +3610,135 @@ void BRepOffset_Tool::ExtentFace (const TopoDS_Face& F,
TopoDS_Edge ERef;
TopoDS_Vertex V1,V2;
for (exp2.Init(W.Oriented(TopAbs_FORWARD),TopAbs_EDGE);
exp2.More(); exp2.Next()) {
for (exp2.Init(W.Oriented(TopAbs_FORWARD),TopAbs_EDGE); exp2.More(); exp2.Next())
{
const TopoDS_Edge& E = TopoDS::Edge(exp2.Current());
TopExp::Vertices (E,V1,V2);
BRep_Tool::Range (E,f,l);
TopoDS_Vertex V;
if (Build.IsBound(E)) {
const TopoDS_Edge& NEOnV1 = TopoDS::Edge(NOnV1(E));
if (Build.IsBound(NEOnV1) &&
(ToBuild.IsBound(E) || ToBuild.IsBound(NEOnV1))) {
if (E.IsSame(NEOnV1))
V = TopExp::FirstVertex(TopoDS::Edge(Build(E)));
else {
//---------------
// intersection.
//---------------
if (!Build.IsBound(V1)) {
Inter2d (EF,TopoDS::Edge(Build(E)),
TopoDS::Edge(Build(NEOnV1)),LV,/*TolConf*/Precision::Confusion());
if (Build(E).Orientation() == TopAbs_FORWARD) {
V = TopoDS::Vertex(LV.First());
}
else {
V = TopoDS::Vertex(LV.Last());
}
}
else {
V = TopoDS::Vertex(Build(V1));
if (MVE (V1).Extent() > 2) {
V.Orientation(TopAbs_FORWARD);
if (Build(E).Orientation() == TopAbs_REVERSED)
V.Orientation(TopAbs_REVERSED);
ProjectVertexOnEdge(V,TopoDS::Edge(Build(E)),TolConf);
}
}
}
}
else {
//------------
//projection
//------------
V = V1;
if (ConstShapes.IsBound(V1)) V = TopoDS::Vertex(ConstShapes(V1));
V.Orientation(TopAbs_FORWARD);
if (Build(E).Orientation() == TopAbs_REVERSED)
V.Orientation(TopAbs_REVERSED);
if (!TryParameter (E,V,TopoDS::Edge(Build(E)),TolConf))
ProjectVertexOnEdge(V,TopoDS::Edge(Build(E)),TolConf);
}
ConstShapes.Bind(V1,V);
Build.Bind (V1,V);
const TopoDS_Edge& NEOnV2 = TopoDS::Edge(NOnV2(E));
if (Build.IsBound(NEOnV2) &&
(ToBuild.IsBound(E) || ToBuild.IsBound(NEOnV2))) {
if (E.IsSame(NEOnV2))
V = TopExp::LastVertex(TopoDS::Edge(Build(E)));
else {
//--------------
// intersection.
//---------------
if (!Build.IsBound(V2)) {
Inter2d (EF,TopoDS::Edge(Build(E)),
TopoDS::Edge(Build(NEOnV2)),LV,/*TolConf*/Precision::Confusion());
if (Build(E).Orientation() == TopAbs_FORWARD) {
V = TopoDS::Vertex(LV.Last());
}
else {
V = TopoDS::Vertex(LV.First());
}
}
else {
V = TopoDS::Vertex(Build(V2));
if (MVE (V2).Extent() > 2) {
V.Orientation(TopAbs_REVERSED);
if (Build(E).Orientation() == TopAbs_REVERSED)
V.Orientation(TopAbs_FORWARD);
ProjectVertexOnEdge(V,TopoDS::Edge(Build(E)),TolConf);
}
}
}
}
else {
//------------
//projection
//------------
V = V2;
if (ConstShapes.IsBound(V2)) V = TopoDS::Vertex(ConstShapes(V2));
V.Orientation(TopAbs_REVERSED);
if (Build(E).Orientation() == TopAbs_REVERSED)
V.Orientation(TopAbs_FORWARD);
if (!TryParameter (E,V,TopoDS::Edge(Build(E)),TolConf))
ProjectVertexOnEdge(V,TopoDS::Edge(Build(E)),TolConf);
}
ConstShapes.Bind(V2,V);
Build.Bind(V2,V);
if (Build.IsBound(E))
{
const TopoDS_Edge& NEOnV1 = TopoDS::Edge(NOnV1(E));
if (Build.IsBound(NEOnV1) && (ToBuild.IsBound(E) || ToBuild.IsBound(NEOnV1)))
{
if (E.IsSame(NEOnV1))
V = TopExp::FirstVertex(TopoDS::Edge(Build(E)));
else
{
//---------------
// intersection.
//---------------
if (!Build.IsBound(V1))
{
Inter2d (EF,TopoDS::Edge(Build(E)), TopoDS::Edge(Build(NEOnV1)),LV,/*TolConf*/Precision::Confusion());
if(!LV.IsEmpty())
{
if (Build(E).Orientation() == TopAbs_FORWARD)
{
V = TopoDS::Vertex(LV.First());
}
else
{
V = TopoDS::Vertex(LV.Last());
}
}
else
{
return;
}
}
else
{
V = TopoDS::Vertex(Build(V1));
if (MVE (V1).Extent() > 2)
{
V.Orientation(TopAbs_FORWARD);
if (Build(E).Orientation() == TopAbs_REVERSED)
V.Orientation(TopAbs_REVERSED);
ProjectVertexOnEdge(V,TopoDS::Edge(Build(E)),TolConf);
}
}
}
}
else
{
//------------
//projection
//------------
V = V1;
if (ConstShapes.IsBound(V1)) V = TopoDS::Vertex(ConstShapes(V1));
V.Orientation(TopAbs_FORWARD);
if (Build(E).Orientation() == TopAbs_REVERSED)
V.Orientation(TopAbs_REVERSED);
if (!TryParameter (E,V,TopoDS::Edge(Build(E)),TolConf))
ProjectVertexOnEdge(V,TopoDS::Edge(Build(E)),TolConf);
}
ConstShapes.Bind(V1,V);
Build.Bind (V1,V);
const TopoDS_Edge& NEOnV2 = TopoDS::Edge(NOnV2(E));
if (Build.IsBound(NEOnV2) && (ToBuild.IsBound(E) || ToBuild.IsBound(NEOnV2)))
{
if (E.IsSame(NEOnV2))
V = TopExp::LastVertex(TopoDS::Edge(Build(E)));
else
{
//--------------
// intersection.
//---------------
if (!Build.IsBound(V2))
{
Inter2d (EF,TopoDS::Edge(Build(E)), TopoDS::Edge(Build(NEOnV2)),LV,/*TolConf*/Precision::Confusion());
if(!LV.IsEmpty())
{
if (Build(E).Orientation() == TopAbs_FORWARD)
{
V = TopoDS::Vertex(LV.Last());
}
else
{
V = TopoDS::Vertex(LV.First());
}
}
else
{
return;
}
}
else
{
V = TopoDS::Vertex(Build(V2));
if (MVE (V2).Extent() > 2)
{
V.Orientation(TopAbs_REVERSED);
if (Build(E).Orientation() == TopAbs_REVERSED)
V.Orientation(TopAbs_FORWARD);
ProjectVertexOnEdge(V,TopoDS::Edge(Build(E)),TolConf);
}
}
}
}
else
{
//------------
//projection
//------------
V = V2;
if (ConstShapes.IsBound(V2))
V = TopoDS::Vertex(ConstShapes(V2));
V.Orientation(TopAbs_REVERSED);
if (Build(E).Orientation() == TopAbs_REVERSED)
V.Orientation(TopAbs_FORWARD);
if (!TryParameter (E,V,TopoDS::Edge(Build(E)),TolConf))
ProjectVertexOnEdge(V,TopoDS::Edge(Build(E)),TolConf);
}
ConstShapes.Bind(V2,V);
Build.Bind(V2,V);
}
}