b939a139 |
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 | ellipse c 0 0 0 0.866025403784439 0 0.5 0.5 0 -0.866025403784439 20 10 |
8 | plane p 0 0 0 0 0 1 |
9 | projonplane r c p 0 |
10 | |
11 | if {![regexp {Circle} [dump r]]} { |
12 | puts "ERROR: Projected curve is not a circle" |
13 | } |
14 | |
15 | # calculate a parametric shift on the projected curve |
16 | set pnt [ProjectCurvePointToPlaneAlongDir c 0 p] |
17 | parameters r [lindex $pnt 0] [lindex $pnt 1] [lindex $pnt 2] 0.1 shift |
18 | |
19 | if {[CheckProjectionToPlane 100 c 0 [expr 2*[dval pi]] r [dval shift] [expr [dval shift]+2*[dval pi]] p]} { |
20 | puts "" |
21 | puts "OK: All sample points are projected correctly" |
22 | puts "" |
23 | } else { |
24 | puts "" |
25 | puts "ERROR: Projection is incorrect for some points" |
26 | puts "" |
27 | } |