mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-07 18:30:55 +03:00
0024667: BRepOffsetAPI_MakePipe::FirstShape() and LastShape() return shapes not from result
Test case for issue CR24667
This commit is contained in:
parent
cb389a77e4
commit
2cd138b878
@ -639,6 +639,15 @@ TopoDS_Shape BRepFill_Pipe::MakeShape(const TopoDS_Shape& S,
|
|||||||
MkSw.Build( myReversedEdges, myTapes,
|
MkSw.Build( myReversedEdges, myTapes,
|
||||||
BRepFill_Modified, myContinuity, GeomFill_Location, myDegmax, mySegmax );
|
BRepFill_Modified, myContinuity, GeomFill_Location, myDegmax, mySegmax );
|
||||||
result = MkSw.Shape();
|
result = MkSw.Shape();
|
||||||
|
|
||||||
|
Handle(TopTools_HArray2OfShape) aSections = MkSw.Sections();
|
||||||
|
|
||||||
|
if (aSections.IsNull() == Standard_False) {
|
||||||
|
const Standard_Integer aVLast = aSections->UpperCol();
|
||||||
|
|
||||||
|
myFirst = aSections->Value(1, 1);
|
||||||
|
myLast = aSections->Value(1, aVLast);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TheS.ShapeType() == TopAbs_WIRE ) {
|
if (TheS.ShapeType() == TopAbs_WIRE ) {
|
||||||
|
@ -46,6 +46,8 @@
|
|||||||
#include <NCollection_Map.hxx>
|
#include <NCollection_Map.hxx>
|
||||||
#include <NCollection_Handle.hxx>
|
#include <NCollection_Handle.hxx>
|
||||||
#include <TCollection_HAsciiString.hxx>
|
#include <TCollection_HAsciiString.hxx>
|
||||||
|
#include <GeomFill_Trihedron.hxx>
|
||||||
|
#include <BRepOffsetAPI_MakePipe.hxx>
|
||||||
|
|
||||||
#include <Standard_Version.hxx>
|
#include <Standard_Version.hxx>
|
||||||
|
|
||||||
@ -1724,6 +1726,64 @@ static Standard_Integer OCC24622 (Draw_Interpretor& /*theDi*/, Standard_Integer
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : OCC24667
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
static Standard_Integer OCC24667 (Draw_Interpretor& di, Standard_Integer n, const char** a)
|
||||||
|
{
|
||||||
|
if (n == 1)
|
||||||
|
{
|
||||||
|
di << "OCC24667 result Wire_spine Profile [Mode [Approx]]" << "\n";
|
||||||
|
di << "Mode = 0 - CorrectedFrenet," << "\n";
|
||||||
|
di << " = 1 - Frenet," << "\n";
|
||||||
|
di << " = 2 - DiscreteTrihedron" << "\n";
|
||||||
|
di << "Approx - force C1-approximation if result is C0" << "\n";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (n > 1 && n < 4) return 1;
|
||||||
|
|
||||||
|
TopoDS_Shape Spine = DBRep::Get(a[2],TopAbs_WIRE);
|
||||||
|
if ( Spine.IsNull()) return 1;
|
||||||
|
|
||||||
|
TopoDS_Shape Profile = DBRep::Get(a[3]);
|
||||||
|
if ( Profile.IsNull()) return 1;
|
||||||
|
|
||||||
|
GeomFill_Trihedron Mode = GeomFill_IsCorrectedFrenet;
|
||||||
|
if (n >= 5)
|
||||||
|
{
|
||||||
|
Standard_Integer iMode = atoi(a[4]);
|
||||||
|
if (iMode == 1)
|
||||||
|
Mode = GeomFill_IsFrenet;
|
||||||
|
else if (iMode == 2)
|
||||||
|
Mode = GeomFill_IsDiscreteTrihedron;
|
||||||
|
}
|
||||||
|
|
||||||
|
Standard_Boolean ForceApproxC1 = Standard_False;
|
||||||
|
if (n >= 6)
|
||||||
|
ForceApproxC1 = Standard_True;
|
||||||
|
|
||||||
|
BRepOffsetAPI_MakePipe aPipe(TopoDS::Wire(Spine),
|
||||||
|
Profile,
|
||||||
|
Mode,
|
||||||
|
ForceApproxC1);
|
||||||
|
|
||||||
|
TopoDS_Shape S = aPipe.Shape();
|
||||||
|
TopoDS_Shape aSF = aPipe.FirstShape();
|
||||||
|
TopoDS_Shape aSL = aPipe.LastShape();
|
||||||
|
|
||||||
|
DBRep::Set(a[1],S);
|
||||||
|
|
||||||
|
TCollection_AsciiString aStrF(a[1], "_f");
|
||||||
|
TCollection_AsciiString aStrL(a[1], "_l");
|
||||||
|
|
||||||
|
DBRep::Set(aStrF.ToCString(), aSF);
|
||||||
|
DBRep::Set(aStrL.ToCString(), aSL);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
||||||
const char *group = "QABugs";
|
const char *group = "QABugs";
|
||||||
|
|
||||||
@ -1759,9 +1819,7 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
|||||||
theCommands.Add ("OCC24012", "OCC24012 face edge", __FILE__, OCC24012, group);
|
theCommands.Add ("OCC24012", "OCC24012 face edge", __FILE__, OCC24012, group);
|
||||||
theCommands.Add ("OCC24051", "OCC24051", __FILE__, OCC24051, group);
|
theCommands.Add ("OCC24051", "OCC24051", __FILE__, OCC24051, group);
|
||||||
theCommands.Add ("OCC24086", "OCC24086 face wire", __FILE__, OCC24086, group);
|
theCommands.Add ("OCC24086", "OCC24086 face wire", __FILE__, OCC24086, group);
|
||||||
theCommands.Add ("OCC24622",
|
theCommands.Add ("OCC24622", "OCC24622 texture={1D|2D}\n Tests sourcing of 1D/2D pixmaps for AIS_TexturedShape", __FILE__, OCC24622, group);
|
||||||
"OCC24622 texture={1D|2D}\n"
|
theCommands.Add ("OCC24667", "OCC24667 result Wire_spine Profile [Mode [Approx]], no args to get help", __FILE__, OCC24667, group);
|
||||||
" Tests sourcing of 1D/2D pixmaps for AIS_TexturedShape.\n",
|
|
||||||
__FILE__, OCC24622, group);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
34
tests/bugs/modalg_5/bug24667
Normal file
34
tests/bugs/modalg_5/bug24667
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC24667"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
###############################################################################################
|
||||||
|
# BRepOffsetAPI_MakePipe::FirstShape() and LastShape() return shapes not from result
|
||||||
|
###############################################################################################
|
||||||
|
|
||||||
|
pload QAcommands
|
||||||
|
|
||||||
|
vertex v1 0 0 0
|
||||||
|
vertex v2 0 0 100
|
||||||
|
vertex v3 0 -50 0
|
||||||
|
|
||||||
|
edge e v1 v2
|
||||||
|
wire w e
|
||||||
|
OCC24667 r w v3
|
||||||
|
|
||||||
|
compound r r_f r_l result
|
||||||
|
|
||||||
|
set length 100
|
||||||
|
|
||||||
|
# Analysis of "nbshapes result"
|
||||||
|
set nb_v_good 2
|
||||||
|
set nb_e_good 1
|
||||||
|
set nb_w_good 1
|
||||||
|
set nb_f_good 0
|
||||||
|
set nb_sh_good 0
|
||||||
|
set nb_sol_good 0
|
||||||
|
set nb_compsol_good 0
|
||||||
|
set nb_compound_good 1
|
||||||
|
set nb_shape_good 5
|
||||||
|
|
||||||
|
set 2dviewer 1
|
Loading…
x
Reference in New Issue
Block a user