mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0023203: STEP import produces wrong surface of revolution on ellipse
Checking of XAsis for ellipses was added. Adding test case for this fix
This commit is contained in:
parent
f5a6ee3c32
commit
41b3001c72
@ -57,7 +57,9 @@ Standard_Boolean StepToGeom_MakeSurfaceOfRevolution::Convert (const Handle(StepG
|
||||
if (rl.Distance(pc) < Precision::Confusion()) { //pc lies on A2
|
||||
const gp_Dir dirline = A.Direction();
|
||||
const gp_Dir norm = conic->Axis().Direction();
|
||||
if( dirline.IsNormal(norm,Precision::Angular()) ) { //A2 lies on plane of circle
|
||||
const gp_Dir xAxis = conic->XAxis().Direction();
|
||||
//checking A2 lies on plane of circle
|
||||
if( dirline.IsNormal(norm,Precision::Angular()) && (dirline.IsParallel(xAxis,Precision::Angular()) || C->IsKind(STANDARD_TYPE(Geom_Circle)))) {
|
||||
//change parametrization for trimming
|
||||
gp_Ax2 axnew(pc,norm,dirline.Reversed());
|
||||
conic->SetPosition(axnew);
|
||||
|
60
tests/bugs/step/bug23203
Executable file
60
tests/bugs/step/bug23203
Executable file
@ -0,0 +1,60 @@
|
||||
puts "========================"
|
||||
puts "OCC23203"
|
||||
puts "========================"
|
||||
puts ""
|
||||
#######################################################################
|
||||
# STEP import produces wrong surface of revolution on ellipse
|
||||
#######################################################################
|
||||
|
||||
ellipse e 0 0 0 0 -1 0 1 0 -1 10 5
|
||||
revsurf re e 0 0 0 0 0 1
|
||||
mkface f re 0 3 0 1
|
||||
newmodel
|
||||
|
||||
set aFile ${imagedir}/bug23203.stp
|
||||
file delete ${aFile}
|
||||
if { [file exists ${aFile}] } {
|
||||
puts "Error : There is old ${aFile} file."
|
||||
}
|
||||
|
||||
stepwrite 0 f ${aFile}
|
||||
stepread ${aFile} res *
|
||||
file delete ${aFile}
|
||||
|
||||
explode res_1 f
|
||||
mksurface ress1 res_1_1
|
||||
set log [dump ress1]
|
||||
|
||||
if {[regexp {Trimmed +curve} ${log}]} {
|
||||
puts "Error: bad basis curve"
|
||||
} else {
|
||||
puts "OK: good basis curve"
|
||||
}
|
||||
|
||||
regexp {XAxis :([-0-9.+eE]+), +([-0-9.+eE]+), +([-0-9.+eE]+)} ${log} full XAxis1 XAxis2 XAxis3
|
||||
regexp {YAxis :([-0-9.+eE]+), +([-0-9.+eE]+), +([-0-9.+eE]+)} ${log} full YAxis1 YAxis2 YAxis3
|
||||
|
||||
set good_XAxis1 0.707106781186548
|
||||
set good_XAxis2 0
|
||||
set good_XAxis3 -0.707106781186548
|
||||
set good_YAxis1 0.707106781186548
|
||||
set good_YAxis2 0
|
||||
set good_YAxis3 0.707106781186548
|
||||
|
||||
set Precision 1.e6
|
||||
|
||||
if {[expr abs(${XAxis1} - ${good_XAxis1})] > ${Precision} ||
|
||||
[expr abs(${XAxis2} - ${good_XAxis2})] > ${Precision} ||
|
||||
[expr abs(${XAxis3} - ${good_XAxis3})] > ${Precision}} {
|
||||
puts "Error : bad XAxis"
|
||||
} else {
|
||||
puts "OK : good XAxis"
|
||||
}
|
||||
|
||||
if {[expr abs(${YAxis1} - ${good_YAxis1})] > ${Precision} ||
|
||||
[expr abs(${YAxis2} - ${good_YAxis2})] > ${Precision} ||
|
||||
[expr abs(${YAxis3} - ${good_YAxis3})] > ${Precision}} {
|
||||
puts "Error : bad YAxis"
|
||||
} else {
|
||||
puts "OK : good YAxis"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user