0031016: Projection of an ellipse is a B-spline in some cases
[occt.git] / tests / bugs / modalg_7 / bug31016_14
1 puts ""
2 puts "=========================================================================="
3 puts "OCC31016: Projection of an ellipse or a circle is a B-spline in some cases"
4 puts "=========================================================================="
5 puts ""
6
7 set projDir { 1 1 1 }
8 set startPar 1
9 set endPar 4.5
10
11 ellipse c 0 0 0  0 0 1  2 1 0  20 10
12 trim c c $startPar $endPar
13 plane p 0 0 0  0 1 10
14 projonplane r c p [lindex $projDir 0] [lindex $projDir 1] [lindex $projDir 2] 0
15
16 if {![regexp {Ellipse} [dump r]]} {
17   puts "ERROR: Projected curve is not an ellipse"
18 }
19
20 # calculate a parametric shift on the projected curve
21 set pnt [ProjectCurvePointToPlaneAlongDir c $startPar p $projDir]
22 trim ru r
23 parameters ru [lindex $pnt 0] [lindex $pnt 1] [lindex $pnt 2] 0.1 shift
24
25 if {[CheckProjectionToPlane 100 c $startPar $endPar r [dval shift] [expr $endPar-$startPar+[dval shift]] p $projDir]} {
26   puts ""
27   puts "OK: All sample points are projected correctly"
28   puts ""
29 } else {
30   puts ""
31   puts "ERROR: Projection is incorrect for some points"
32   puts ""
33 }