Archived issue #0033604
Modeling Algorithms - GeomFill_Pipe cause mfc samples crash
Description
crash file samples\mfc\standard\01_Geometry GeomSources::gpTest40 line 3144,the version 7.6 work well,it like that function void GeomFill_Pipe::Init(const Handle(Geom_Curve)& Path, const Handle(Geom_Curve)& FirstSect,const Handle(Geom_Curve)& LastSect) not set correct flags,7.6 is myLoc->SetCurve(myAdpPath),not check the result,but 7.7 and above,
run into this line myStatus = GeomFill_ImpossibleContact and return,so Performe throw exception
if (!(myLoc->SetCurve(myAdpPath)))
{
myStatus = GeomFill_ImpossibleContact;
return;
}
run into this line myStatus = GeomFill_ImpossibleContact and return,so Performe throw exception
Public activity
2 archived notes
Participants are labeled by their role within this record.
Dear Commenter 2 could you share a file to reproduce and full scenario that you perform.
void GeomSources::gpTest40(CGeometryDoc* aDoc)
{
DisplayType TheDisplayType = No2D3D;
PreProcess(aDoc,TheDisplayType);
//==============================================================
TColgp_Array1OfPnt array1 (1,5); // sizing array
array1.SetValue(1,gp_Pnt (-4,0,2 ));
array1.SetValue(2,gp_Pnt (-5,1,0 ));
array1.SetValue(3,gp_Pnt (-6,2,-2 ));
array1.SetValue(4,gp_Pnt (-5,4,-7));
array1.SetValue(5,gp_Pnt (-3,5,-12));
Handle(Geom_Curve) SPL1 =
GeomAPI_PointsToBSpline(array1).Curve();
GeomFill_Pipe aPipe(SPL1,1);
aPipe.Perform();
Handle(Geom_Surface) aSurface= aPipe.Surface();
Standard_CString aSurfaceEntityTypeName="Not Computed";
if (!aSurface.IsNull())
aSurfaceEntityTypeName = aSurface->DynamicType()->Name();
Handle(Geom_Ellipse) E = GC_MakeEllipse( gp::XOY() ,3,1).Value();
GeomFill_Pipe aPipe2(SPL1,E);
aPipe2.Perform();
Handle(Geom_Surface) aSurface2= aPipe2.Surface();
Standard_CString aSurfaceEntityTypeName2="Not Computed";
if (!aSurface2.IsNull()) {
aSurfaceEntityTypeName2 = aSurface2->DynamicType()->Name();
aSurface2->Translate(gp_Vec(5,0,0)); }
Handle(Geom_TrimmedCurve) TC1 =
GC_MakeSegment(gp_Pnt(1,1,1),gp_Pnt(5,5,5));
Handle(Geom_TrimmedCurve) TC2 =
GC_MakeSegment(gp_Pnt(1,1,0),gp_Pnt(4,5,6));
GeomFill_Pipe aPipe3(SPL1,TC1,TC2);
aPipe3.Perform();
Handle(Geom_Surface) aSurface3 = aPipe3.Surface();
Standard_CString aSurfaceEntityTypeName3="Not Computed";
if (!aSurface3.IsNull())
{
aSurfaceEntityTypeName3 = aSurface3->DynamicType()->Name();
aSurface3->Translate(gp_Vec(10,0,0));
}
}
the main code for the function
the bug reproduce with mfc sample Geometry
I have the py code.not tcl.
array1=OCC.TColgp_Array1OfPnt(1,5)
array1.SetValue(1,OCC.gp_Pnt(-4,0,2))
array1.SetValue(2,OCC.gp_Pnt(-5,1,0))
array1.SetValue(3,OCC.gp_Pnt(-6,2,-2))
array1.SetValue(4,OCC.gp_Pnt(-5,4,-7))
array1.SetValue(5,OCC.gp_Pnt(-3,5,-12))
TC1 =OCC.GC_MakeSegment(OCC.gp_Pnt(1,1,1),OCC.gp_Pnt(5,5,5)).Value()
TC2 =OCC.GC_MakeSegment(OCC.gp_Pnt(1,1,0),OCC.gp_Pnt(4,5,6)).Value()
aPipe3=OCC.GeomFill_Pipe(SPL1,TC1,TC2);
aPipe3.Perform();
{
DisplayType TheDisplayType = No2D3D;
PreProcess(aDoc,TheDisplayType);
//==============================================================
TColgp_Array1OfPnt array1 (1,5); // sizing array
array1.SetValue(1,gp_Pnt (-4,0,2 ));
array1.SetValue(2,gp_Pnt (-5,1,0 ));
array1.SetValue(3,gp_Pnt (-6,2,-2 ));
array1.SetValue(4,gp_Pnt (-5,4,-7));
array1.SetValue(5,gp_Pnt (-3,5,-12));
Handle(Geom_Curve) SPL1 =
GeomAPI_PointsToBSpline(array1).Curve();
GeomFill_Pipe aPipe(SPL1,1);
aPipe.Perform();
Handle(Geom_Surface) aSurface= aPipe.Surface();
Standard_CString aSurfaceEntityTypeName="Not Computed";
if (!aSurface.IsNull())
aSurfaceEntityTypeName = aSurface->DynamicType()->Name();
Handle(Geom_Ellipse) E = GC_MakeEllipse( gp::XOY() ,3,1).Value();
GeomFill_Pipe aPipe2(SPL1,E);
aPipe2.Perform();
Handle(Geom_Surface) aSurface2= aPipe2.Surface();
Standard_CString aSurfaceEntityTypeName2="Not Computed";
if (!aSurface2.IsNull()) {
aSurfaceEntityTypeName2 = aSurface2->DynamicType()->Name();
aSurface2->Translate(gp_Vec(5,0,0)); }
Handle(Geom_TrimmedCurve) TC1 =
GC_MakeSegment(gp_Pnt(1,1,1),gp_Pnt(5,5,5));
Handle(Geom_TrimmedCurve) TC2 =
GC_MakeSegment(gp_Pnt(1,1,0),gp_Pnt(4,5,6));
GeomFill_Pipe aPipe3(SPL1,TC1,TC2);
aPipe3.Perform();
Handle(Geom_Surface) aSurface3 = aPipe3.Surface();
Standard_CString aSurfaceEntityTypeName3="Not Computed";
if (!aSurface3.IsNull())
{
aSurfaceEntityTypeName3 = aSurface3->DynamicType()->Name();
aSurface3->Translate(gp_Vec(10,0,0));
}
}
the main code for the function
the bug reproduce with mfc sample Geometry
I have the py code.not tcl.
array1=OCC.TColgp_Array1OfPnt(1,5)
array1.SetValue(1,OCC.gp_Pnt(-4,0,2))
array1.SetValue(2,OCC.gp_Pnt(-5,1,0))
array1.SetValue(3,OCC.gp_Pnt(-6,2,-2))
array1.SetValue(4,OCC.gp_Pnt(-5,4,-7))
array1.SetValue(5,OCC.gp_Pnt(-3,5,-12))
TC1 =OCC.GC_MakeSegment(OCC.gp_Pnt(1,1,1),OCC.gp_Pnt(5,5,5)).Value()
TC2 =OCC.GC_MakeSegment(OCC.gp_Pnt(1,1,0),OCC.gp_Pnt(4,5,6)).Value()
aPipe3=OCC.GeomFill_Pipe(SPL1,TC1,TC2);
aPipe3.Perform();