mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0027537: GCPnts_TangentialDeflection produces incorrect number of sample points for circular edge
* Round up number of sample points to satisfy deflection. * Test case added
This commit is contained in:
parent
c574faecb9
commit
b819ae67ce
@ -219,7 +219,8 @@ void GCPnts_TangentialDeflection::PerformCircular (const TheCurve& C)
|
|||||||
dfR, curvatureDeflection, angularDeflection, myMinLen);
|
dfR, curvatureDeflection, angularDeflection, myMinLen);
|
||||||
|
|
||||||
const Standard_Real aDiff = lastu - firstu;
|
const Standard_Real aDiff = lastu - firstu;
|
||||||
Standard_Integer NbPoints = (Standard_Integer)(aDiff / Du);
|
// Round up number of points to satisfy curvatureDeflection more precisely
|
||||||
|
Standard_Integer NbPoints = (Standard_Integer)Ceiling(aDiff / Du);
|
||||||
NbPoints = Max(NbPoints, minNbPnts - 1);
|
NbPoints = Max(NbPoints, minNbPnts - 1);
|
||||||
Du = aDiff / NbPoints;
|
Du = aDiff / NbPoints;
|
||||||
|
|
||||||
|
55
tests/bugs/modalg_6/bug27537
Normal file
55
tests/bugs/modalg_6/bug27537
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC27537"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
######################################################
|
||||||
|
# Incorrect number of sample points provided by GCPnts_TangentialDeflection
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug27537.brep] result
|
||||||
|
incmesh result 0.2
|
||||||
|
|
||||||
|
set bndbox [bounding result]
|
||||||
|
set xMin [lindex $bndbox 0]
|
||||||
|
set yMin [lindex $bndbox 1]
|
||||||
|
set zMin [lindex $bndbox 2]
|
||||||
|
set xMax [lindex $bndbox 3]
|
||||||
|
set yMax [lindex $bndbox 4]
|
||||||
|
set zMax [lindex $bndbox 5]
|
||||||
|
|
||||||
|
mkcurve c result
|
||||||
|
bounds c u1 u2
|
||||||
|
set first [dval u1]
|
||||||
|
set last [dval u2]
|
||||||
|
|
||||||
|
set x 0.
|
||||||
|
set y 0.
|
||||||
|
set z 0.
|
||||||
|
set param 0.
|
||||||
|
set isOk true
|
||||||
|
|
||||||
|
set nbSamples 100
|
||||||
|
set step [expr ($last - $first)/$nbSamples]
|
||||||
|
for {set i 0} {$i <= $nbSamples} {incr i} {
|
||||||
|
if {$i < $nbSamples} {
|
||||||
|
set param [expr $first + $i * $step]
|
||||||
|
} else {
|
||||||
|
set param $last
|
||||||
|
}
|
||||||
|
|
||||||
|
cvalue c $param cx cy cz
|
||||||
|
set x [dval cx]
|
||||||
|
set y [dval cy]
|
||||||
|
set z [dval cz]
|
||||||
|
if {$x < $xMin || $x > $xMax || $y < $yMin || $y > $yMax || $z < $zMin || $z > $zMax} {
|
||||||
|
puts "ERROR: point ($x; $y; $z) is out of bounding box"
|
||||||
|
set isOk false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if {$isOk} {
|
||||||
|
puts "OK: all sample points inside bounding box"
|
||||||
|
}
|
||||||
|
|
||||||
|
top; fit
|
||||||
|
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
Loading…
x
Reference in New Issue
Block a user