diff --git a/src/QABugs/QABugs_19.cxx b/src/QABugs/QABugs_19.cxx index 6f6265d097..4b03646960 100755 --- a/src/QABugs/QABugs_19.cxx +++ b/src/QABugs/QABugs_19.cxx @@ -287,6 +287,106 @@ Standard_Integer OCC22595 (Draw_Interpretor& di, Standard_Integer argc, const ch return 0; } +#include +#include +#include +#include +#include +#include + +Standard_Boolean static OCC23774Test(const TopoDS_Face& grossPlateFace, const TopoDS_Shape& originalWire, Draw_Interpretor& di) +{ + BRepExtrema_DistShapeShape distShapeShape(grossPlateFace,originalWire,Extrema_ExtFlag_MIN); + if(!distShapeShape.IsDone()) { + di <<"Distance ShapeShape is Not Done\n"; + return Standard_False; + } + + if(distShapeShape.Value() > 0.01) { + di << "Wrong Dist = " < 0.01) { + di << "Dist = " < 0.01) { + di << "Wrong Dist2 = " < #include + +//======================================================================= +//function : gp_Trsf +//purpose : Constructor from 2d +//======================================================================= + +gp_Trsf::gp_Trsf (const gp_Trsf2d& T) : +scale(T.ScaleFactor()), +shape(T.Form()), +loc(T.TranslationPart().X(),T.TranslationPart().Y(), 0.0) +{ + const gp_Mat2d& M = T.HVectorialPart(); + matrix(1,1) = M(1,1); + matrix(1,2) = M(1,2); + matrix(2,1) = M(2,1); + matrix(2,2) = M(2,2); + matrix(3,3) = 1.; + if (shape == gp_Ax1Mirror) + { + scale = 1; + matrix.Multiply(-1); + } +} + //======================================================================= //function : SetMirror //purpose : diff --git a/src/gp/gp_Trsf.lxx b/src/gp/gp_Trsf.lxx index 540b75282b..507dafd392 100755 --- a/src/gp/gp_Trsf.lxx +++ b/src/gp/gp_Trsf.lxx @@ -32,19 +32,6 @@ matrix(1,0,0, 0,1,0, 0,0,1), loc(0.0, 0.0, 0.0) {} -inline gp_Trsf::gp_Trsf (const gp_Trsf2d& T) : -scale(T.ScaleFactor()), -shape(T.Form()), -loc(T.TranslationPart().X(),T.TranslationPart().Y(), 0.0) -{ - const gp_Mat2d& M = T.HVectorialPart(); - matrix(1,1) = M(1,1); - matrix(1,2) = M(1,2); - matrix(2,1) = M(2,1); - matrix(2,2) = M(2,2); - matrix(3,3) = 1.; -} - inline void gp_Trsf::SetMirror (const gp_Pnt& P) { shape = gp_PntMirror; diff --git a/tests/bugs/fclasses/bug23774 b/tests/bugs/fclasses/bug23774 new file mode 100755 index 0000000000..fc10eb5011 --- /dev/null +++ b/tests/bugs/fclasses/bug23774 @@ -0,0 +1,74 @@ +puts "===========" +puts "OCC23774" +puts "===========" +###################################################### +# Incorrect conversion from gp_Trsf2d to gp_Trsf +###################################################### + +pload QAcommands +pload TOPTEST + +set BugNumber OCC23774 + +restore [locate_data_file bug23774_GrossPlateFace.brep] face +restore [locate_data_file bug23774_OriginalWire.brep] wire + +set Info [OCC23774 face wire] + +regexp {Dist0 += +([-0-9.+eE]+)} ${Info} full Dist0 +regexp {Dist1 += +([-0-9.+eE]+)} ${Info} full Dist1 +regexp {Distance2 += +([-0-9.+eE]+)} ${Info} full Distance2 +puts "Dist0 = ${Dist0}" +puts "Dist1 = ${Dist1}" +puts "Distance2 = ${Distance2}" + +set face_tolerance [maxtolerance face] +regexp { +Face +: +Min +[-0-9.+eE]+ +Max +([-0-9.+eE]+)} ${face_tolerance} full F_MaxFaceTolerance +regexp { +Edge +: +Min +[-0-9.+eE]+ +Max +([-0-9.+eE]+)} ${face_tolerance} full F_MaxEdgeTolerance +regexp { +Vertex +: +Min +[-0-9.+eE]+ +Max +([-0-9.+eE]+)} ${face_tolerance} full F_MaxVertexTolerance + +set wire_tolerance [maxtolerance wire] +regexp { +Face +: +Min +[-0-9.+eE]+ +Max +([-0-9.+eE]+)} ${face_tolerance} full W_MaxFaceTolerance +regexp { +Edge +: +Min +[-0-9.+eE]+ +Max +([-0-9.+eE]+)} ${face_tolerance} full W_MaxEdgeTolerance +regexp { +Vertex +: +Min +[-0-9.+eE]+ +Max +([-0-9.+eE]+)} ${face_tolerance} full W_MaxVertexTolerance + +set max_tolerance ${F_MaxFaceTolerance} +if { ${F_MaxEdgeTolerance} > ${max_tolerance} } { + set max_tolerance ${F_MaxEdgeTolerance} +} +if { ${F_MaxVertexTolerance} > ${max_tolerance} } { + set max_tolerance ${F_MaxVertexTolerance} +} +if { ${W_MaxFaceTolerance} > ${max_tolerance} } { + set max_tolerance ${W_MaxFaceTolerance} +} +if { ${W_MaxEdgeTolerance} > ${max_tolerance} } { + set max_tolerance ${W_MaxEdgeTolerance} +} +if { ${W_MaxVertexTolerance} > ${max_tolerance} } { + set max_tolerance ${W_MaxVertexTolerance} +} +puts "max_tolerance = ${max_tolerance}" + +set status 0 +set Dist0_GoodValue 0. +set Dist1_GoodValue 0. +set Distance2_GoodValue 0. + +if { [expr abs(${Dist0} - ${Dist0_GoodValue})] > ${max_tolerance} } { + set status 1 +} +if { [expr abs(${Dist1} - ${Dist1_GoodValue})] > ${max_tolerance} } { + set status 1 +} +if { [expr abs(${Distance2} - ${Distance2_GoodValue})] > ${max_tolerance} } { + set status 1 +} + +# Resume +puts "" +if { ${status} != 0 } { + puts "Faulty ${BugNumber}" +} else { + puts "OK ${BugNumber}" +}