mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0025971: Near B-Spline knots get merged after saving/restoring (exporting/importing)
Precision used to consider B-Spline knots identical is restricted to be not less than Precision::PConfusion() in Geom2d_BSplineCurve::Segment(). Affected tests updated (improvements) Test case for issue CR25971
This commit is contained in:
parent
062d7dfd62
commit
7b1c1b7cbb
@ -33,6 +33,7 @@
|
||||
#include <BSplCLib.hxx>
|
||||
#include <BSplCLib_KnotDistribution.hxx>
|
||||
#include <BSplCLib_MultDistribution.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
@ -686,7 +687,7 @@ void Geom2d_BSplineCurve::Segment(const Standard_Real aU1,
|
||||
Standard_DomainError_Raise_if ( aU2 < aU1, "Geom2d_BSplineCurve::Segment");
|
||||
//
|
||||
Standard_Real AbsUMax = Max(Abs(FirstParameter()),Abs(LastParameter()));
|
||||
Standard_Real Eps = Epsilon(AbsUMax);
|
||||
Standard_Real Eps = Max (Epsilon(AbsUMax), Precision::PConfusion());
|
||||
Standard_Real NewU1, NewU2;
|
||||
Standard_Real U, DU=0;
|
||||
Standard_Integer i, k, index;
|
||||
|
@ -28,10 +28,10 @@ if { $init_dump == $result_dump} {
|
||||
#retrieve amount of knots of result curve from dump
|
||||
regexp { +Degree +[-0-9.+eE]+, +[-0-9.+eE]+ +Poles, +([-0-9.+eE]+) +KnotsPoles +:} $result_dump full KnotsNumber
|
||||
#create string to be found in result dump
|
||||
set trueLastKnot "$KnotsNumber : 1.00000000015925 "
|
||||
set trueLastKnot "$KnotsNumber : 1 4"
|
||||
|
||||
#verify parametrization of result curve
|
||||
if { [regexp "1 : 0.500000000000006 " $result_dump] && [regexp $trueLastKnot $result_dump]} {
|
||||
if { [regexp "1 : 0.5 4" $result_dump] && [regexp $trueLastKnot $result_dump]} {
|
||||
puts " OCC253 is OK: command segment works properly"
|
||||
} else {
|
||||
puts "Faulty OCC253: parametrization of result curve is wrong"
|
||||
|
52
tests/bugs/moddata_3/bug25971
Executable file
52
tests/bugs/moddata_3/bug25971
Executable file
@ -0,0 +1,52 @@
|
||||
puts "============"
|
||||
puts "OCC25971"
|
||||
puts "============"
|
||||
puts ""
|
||||
#######################################################################
|
||||
# Near B-Spline knots get merged after saving/restoring (exporting/importing)
|
||||
#######################################################################
|
||||
|
||||
pload XDE
|
||||
|
||||
restore [locate_data_file bug25971_a_328_1.brep] a
|
||||
|
||||
fixshape f a 1e-6
|
||||
explode f e
|
||||
|
||||
dump f_4
|
||||
|
||||
newmodel
|
||||
set aFile ${imagedir}/bug25971.stp
|
||||
catch { file delete ${aFile} }
|
||||
|
||||
stepwrite a a ${aFile}
|
||||
|
||||
stepread ${aFile} ff *
|
||||
|
||||
catch { file delete ${aFile} }
|
||||
|
||||
set nbshapes_expected "
|
||||
Number of shapes in shape
|
||||
VERTEX : 4
|
||||
EDGE : 5
|
||||
WIRE : 1
|
||||
FACE : 1
|
||||
SHELL : 1
|
||||
SOLID : 0
|
||||
COMPSOLID : 0
|
||||
COMPOUND : 0
|
||||
SHAPE : 12
|
||||
"
|
||||
checknbshapes ff_1 -ref ${nbshapes_expected} -t -m "Saved shape"
|
||||
|
||||
tpstat c ; #Exception caught for the shell
|
||||
|
||||
vinit View1
|
||||
vdisplay a
|
||||
vfit
|
||||
vdump ${imagedir}/${casename}_1.png
|
||||
|
||||
vinit View2
|
||||
vdisplay ff_1
|
||||
vfit
|
||||
vdump ${imagedir}/${casename}_2.png
|
@ -1,8 +1,4 @@
|
||||
# !!!! This file is generated automatically, do not edit manually! See end script
|
||||
puts "TODO CR23096 ALL: TPSTAT : Faulty"
|
||||
puts "TODO CR23096 ALL: NBSHAPES : Faulty"
|
||||
puts "TODO CR23096 ALL: LABELS : Faulty"
|
||||
|
||||
|
||||
set filename PRO8843.stp
|
||||
|
||||
@ -10,10 +6,10 @@ set ref_data {
|
||||
DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 0 ) Summary = 0 ( 0 )
|
||||
TPSTAT : Faulties = 3 ( 0 ) Warnings = 10 ( 32 ) Summary = 13 ( 32 )
|
||||
CHECKSHAPE : Wires = 0 ( 0 ) Faces = 0 ( 0 ) Shells = 0 ( 0 ) Solids = 0 ( 0 )
|
||||
NBSHAPES : Solid = 25 ( 25 ) Shell = 42 ( 45 ) Face = 195 ( 198 ) Summary = 1276 ( 1343 )
|
||||
STATSHAPE : Solid = 25 ( 25 ) Shell = 42 ( 45 ) Face = 195 ( 198 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 467 ( 496 )
|
||||
TOLERANCE : MaxTol = 0.01438603118 ( 0.0293421074 ) AvgTol = 0.0002717522291 ( 0.001390253412 )
|
||||
LABELS : N0Labels = 3 ( 3 ) N1Labels = 61 ( 67 ) N2Labels = 0 ( 0 ) TotalLabels = 64 ( 70 ) NameLabels = 5 ( 5 ) ColorLabels = 42 ( 45 ) LayerLabels = 42 ( 45 )
|
||||
NBSHAPES : Solid = 25 ( 25 ) Shell = 45 ( 45 ) Face = 198 ( 198 ) Summary = 1343 ( 1343 )
|
||||
STATSHAPE : Solid = 25 ( 25 ) Shell = 45 ( 45 ) Face = 198 ( 198 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 496 ( 496 )
|
||||
TOLERANCE : MaxTol = 0.02054327471 ( 0.0293421074 ) AvgTol = 0.0005819945737 ( 0.001390253412 )
|
||||
LABELS : N0Labels = 3 ( 3 ) N1Labels = 67 ( 67 ) N2Labels = 0 ( 0 ) TotalLabels = 70 ( 70 ) NameLabels = 5 ( 5 ) ColorLabels = 45 ( 45 ) LayerLabels = 45 ( 45 )
|
||||
PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 )
|
||||
NCOLORS : NColors = 2 ( 2 )
|
||||
COLORS : Colors = GREEN ROYALBLUE ( GREEN ROYALBLUE )
|
||||
|
@ -1,7 +1,5 @@
|
||||
# !!!! This file is generated automatically, do not edit manually! See end script
|
||||
puts "TODO CR23096 ALL: TPSTAT : Faulty"
|
||||
puts "TODO CR23096 ALL: NBSHAPES : Faulty"
|
||||
puts "TODO CR23096 ALL: LABELS : Faulty"
|
||||
|
||||
set LinuxDiff 3
|
||||
set filename r_77-sy.stp
|
||||
@ -10,10 +8,10 @@ set ref_data {
|
||||
DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 0 ) Summary = 0 ( 0 )
|
||||
TPSTAT : Faulties = 5 ( 0 ) Warnings = 8 ( 2 ) Summary = 13 ( 2 )
|
||||
CHECKSHAPE : Wires = 0 ( 0 ) Faces = 0 ( 0 ) Shells = 0 ( 0 ) Solids = 0 ( 0 )
|
||||
NBSHAPES : Solid = 0 ( 0 ) Shell = 54 ( 59 ) Face = 54 ( 59 ) Summary = 766 ( 889 )
|
||||
STATSHAPE : Solid = 0 ( 0 ) Shell = 54 ( 59 ) Face = 54 ( 59 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 302 ( 356 )
|
||||
NBSHAPES : Solid = 0 ( 0 ) Shell = 59 ( 59 ) Face = 59 ( 59 ) Summary = 889 ( 889 )
|
||||
STATSHAPE : Solid = 0 ( 0 ) Shell = 59 ( 59 ) Face = 59 ( 59 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 356 ( 356 )
|
||||
TOLERANCE : MaxTol = 0.01782737572 ( 0.03722151184 ) AvgTol = 0.002033692633 ( 0.003517189961 )
|
||||
LABELS : N0Labels = 1 ( 1 ) N1Labels = 108 ( 118 ) N2Labels = 0 ( 0 ) TotalLabels = 109 ( 119 ) NameLabels = 1 ( 1 ) ColorLabels = 54 ( 59 ) LayerLabels = 54 ( 59 )
|
||||
LABELS : N0Labels = 1 ( 1 ) N1Labels = 118 ( 118 ) N2Labels = 0 ( 0 ) TotalLabels = 119 ( 119 ) NameLabels = 1 ( 1 ) ColorLabels = 59 ( 59 ) LayerLabels = 59 ( 59 )
|
||||
PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 )
|
||||
NCOLORS : NColors = 3 ( 3 )
|
||||
COLORS : Colors = GREEN RED TURQUOISE ( GREEN RED TURQUOISE )
|
||||
|
@ -1,8 +1,4 @@
|
||||
# !!!! This file is generated automatically, do not edit manually! See end script
|
||||
puts "TODO CR23096 ALL: TPSTAT : Faulty"
|
||||
puts "TODO CR23096 ALL: NBSHAPES : Faulty"
|
||||
puts "TODO CR23096 ALL: LABELS : Faulty"
|
||||
|
||||
|
||||
set filename tr10_r1101_sy.stp
|
||||
|
||||
@ -10,10 +6,10 @@ set ref_data {
|
||||
DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 0 ) Summary = 0 ( 0 )
|
||||
TPSTAT : Faulties = 5 ( 0 ) Warnings = 0 ( 0 ) Summary = 5 ( 0 )
|
||||
CHECKSHAPE : Wires = 0 ( 0 ) Faces = 0 ( 0 ) Shells = 0 ( 0 ) Solids = 0 ( 0 )
|
||||
NBSHAPES : Solid = 0 ( 0 ) Shell = 59 ( 64 ) Face = 59 ( 64 ) Summary = 686 ( 759 )
|
||||
STATSHAPE : Solid = 0 ( 0 ) Shell = 59 ( 64 ) Face = 59 ( 64 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 254 ( 283 )
|
||||
TOLERANCE : MaxTol = 0.01572432916 ( 0.03822476581 ) AvgTol = 0.001130934878 ( 0.002480845829 )
|
||||
LABELS : N0Labels = 1 ( 1 ) N1Labels = 118 ( 128 ) N2Labels = 0 ( 0 ) TotalLabels = 119 ( 129 ) NameLabels = 1 ( 1 ) ColorLabels = 59 ( 64 ) LayerLabels = 59 ( 64 )
|
||||
NBSHAPES : Solid = 0 ( 0 ) Shell = 64 ( 64 ) Face = 64 ( 64 ) Summary = 759 ( 759 )
|
||||
STATSHAPE : Solid = 0 ( 0 ) Shell = 64 ( 64 ) Face = 64 ( 64 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 283 ( 283 )
|
||||
TOLERANCE : MaxTol = 0.01969059797 ( 0.03822476581 ) AvgTol = 0.001190568033 ( 0.002480845829 )
|
||||
LABELS : N0Labels = 1 ( 1 ) N1Labels = 128 ( 128 ) N2Labels = 0 ( 0 ) TotalLabels = 129 ( 129 ) NameLabels = 1 ( 1 ) ColorLabels = 64 ( 64 ) LayerLabels = 64 ( 64 )
|
||||
PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 )
|
||||
NCOLORS : NColors = 1 ( 1 )
|
||||
COLORS : Colors = TURQUOISE ( TURQUOISE )
|
||||
|
@ -1,19 +1,18 @@
|
||||
# !!!! This file is generated automatically, do not edit manually! See end script
|
||||
puts "TODO CR23096 ALL: LABELS : Faulty"
|
||||
puts "TODO CR23096 ALL: CHECKSHAPE : Faulty"
|
||||
puts "TODO CR23096 ALL: NBSHAPES : Faulty"
|
||||
puts "TODO CR23096 ALL: LABELS : Faulty"
|
||||
|
||||
set LinuxDiff 3
|
||||
set filename r76sy.stp
|
||||
|
||||
set ref_data {
|
||||
DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 0 ) Summary = 0 ( 0 )
|
||||
TPSTAT : Faulties = 1 ( 4 ) Warnings = 68 ( 103 ) Summary = 69 ( 107 )
|
||||
CHECKSHAPE : Wires = 2 ( 0 ) Faces = 2 ( 0 ) Shells = 0 ( 0 ) Solids = 0 ( 0 )
|
||||
NBSHAPES : Solid = 23 ( 23 ) Shell = 46 ( 47 ) Face = 193 ( 194 ) Summary = 1329 ( 1357 )
|
||||
STATSHAPE : Solid = 23 ( 23 ) Shell = 46 ( 47 ) Face = 193 ( 194 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 494 ( 504 )
|
||||
NBSHAPES : Solid = 23 ( 23 ) Shell = 47 ( 47 ) Face = 194 ( 194 ) Summary = 1352 ( 1357 )
|
||||
STATSHAPE : Solid = 23 ( 23 ) Shell = 47 ( 47 ) Face = 194 ( 194 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 504 ( 504 )
|
||||
TOLERANCE : MaxTol = 0.0205434719 ( 0.0293421419 ) AvgTol = 0.0005065999101 ( 0.00138068504 )
|
||||
LABELS : N0Labels = 3 ( 3 ) N1Labels = 67 ( 67 ) N2Labels = 0 ( 0 ) TotalLabels = 70 ( 70 ) NameLabels = 5 ( 5 ) ColorLabels = 46 ( 45 ) LayerLabels = 42 ( 45 )
|
||||
LABELS : N0Labels = 3 ( 3 ) N1Labels = 69 ( 67 ) N2Labels = 0 ( 0 ) TotalLabels = 72 ( 70 ) NameLabels = 5 ( 5 ) ColorLabels = 47 ( 45 ) LayerLabels = 43 ( 45 )
|
||||
PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 )
|
||||
NCOLORS : NColors = 2 ( 2 )
|
||||
COLORS : Colors = GREEN ROYALBLUE ( GREEN ROYALBLUE )
|
||||
|
@ -1,8 +1,5 @@
|
||||
# !!!! This file is generated automatically, do not edit manually! See end script
|
||||
puts "TODO CR23096 ALL: TPSTAT : Faulty"
|
||||
puts "TODO CR23096 ALL: NBSHAPES : Faulty"
|
||||
puts "TODO CR23096 ALL: LABELS : Faulty"
|
||||
|
||||
|
||||
set filename r0601_sy.stp
|
||||
|
||||
@ -10,10 +7,10 @@ set ref_data {
|
||||
DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 0 ) Summary = 0 ( 0 )
|
||||
TPSTAT : Faulties = 11 ( 0 ) Warnings = 78 ( 24 ) Summary = 89 ( 24 )
|
||||
CHECKSHAPE : Wires = 0 ( 0 ) Faces = 0 ( 0 ) Shells = 0 ( 0 ) Solids = 0 ( 0 )
|
||||
NBSHAPES : Solid = 0 ( 0 ) Shell = 95 ( 106 ) Face = 95 ( 106 ) Summary = 1451 ( 1665 )
|
||||
STATSHAPE : Solid = 0 ( 0 ) Shell = 95 ( 106 ) Face = 95 ( 106 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 580 ( 670 )
|
||||
NBSHAPES : Solid = 0 ( 0 ) Shell = 106 ( 106 ) Face = 106 ( 106 ) Summary = 1665 ( 1665 )
|
||||
STATSHAPE : Solid = 0 ( 0 ) Shell = 106 ( 106 ) Face = 106 ( 106 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 670 ( 670 )
|
||||
TOLERANCE : MaxTol = 0.02881427566 ( 0.03703290736 ) AvgTol = 0.002876539025 ( 0.004091781903 )
|
||||
LABELS : N0Labels = 1 ( 1 ) N1Labels = 190 ( 212 ) N2Labels = 0 ( 0 ) TotalLabels = 191 ( 213 ) NameLabels = 1 ( 1 ) ColorLabels = 95 ( 106 ) LayerLabels = 95 ( 106 )
|
||||
LABELS : N0Labels = 1 ( 1 ) N1Labels = 212 ( 212 ) N2Labels = 0 ( 0 ) TotalLabels = 213 ( 213 ) NameLabels = 1 ( 1 ) ColorLabels = 106 ( 106 ) LayerLabels = 106 ( 106 )
|
||||
PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 )
|
||||
NCOLORS : NColors = 5 ( 5 )
|
||||
COLORS : Colors = GREEN RED ROYALBLUE STEELBLUE2 TURQUOISE ( GREEN RED ROYALBLUE STEELBLUE2 TURQUOISE )
|
||||
|
Loading…
x
Reference in New Issue
Block a user