blob: 3177ee963546b4ac832a8e337322254fbd19aa19 [file] [edit]
puts ""
puts "=========================================================================="
puts "OCC31016: Projection of an ellipse or a circle is a B-spline in some cases"
puts "=========================================================================="
puts ""
ellipse c 0 0 0 0.866025403784439 0 0.5 0.5 0 -0.866025403784439 20 10
plane p 0 0 0 0 0 1
projonplane r c p 0
if {![regexp {Circle} [dump r]]} {
puts "ERROR: Projected curve is not a circle"
}
# calculate a parametric shift on the projected curve
set pnt [ProjectCurvePointToPlaneAlongDir c 0 p]
parameters r [lindex $pnt 0] [lindex $pnt 1] [lindex $pnt 2] 0.1 shift
if {[CheckProjectionToPlane 100 c 0 [expr 2*[dval pi]] r [dval shift] [expr [dval shift]+2*[dval pi]] p]} {
puts ""
puts "OK: All sample points are projected correctly"
puts ""
} else {
puts ""
puts "ERROR: Projection is incorrect for some points"
puts ""
}