[bug] crash when saving an ellipse prism as iges in Draw

Standard_DivideByZero exception caught when saving an ellipse prism with draw

to reproduce :

Draw[27]> ellipse el 0 0 0 0 0 1 50 20
Draw[28]> mkedge e el
Draw[29]> wire w e
Draw[30]> mkplane p w
Draw[31]> prism pr p 0 0 100
Draw[32]> brepiges pr e:/pr.iges
An exception was caught 00A3BA00 : Standard_DivideByZero: FLT DIVIDE BY ZERO
** Exception ** 00A3BA00 : Standard_DivideByZero: FLT DIVIDE BY ZERO

Draw[33]> stepwrite 0 pr e:/pr.step
works

Draw[34]> save pr pr.brep
works too

OCCT 6.3.0

Stephane

sergey zaritchny's picture

Hi Stephane,
The posted problem is checked and reproduced.
The corresponding issue with ID = OCC22056 has been registered.
Later you can know if the issue is resolved by checking references to the specified ID in OCCT Release Notes. The analysis of the issue will take some time depending on our technical capability and availability of resources.
If you can't wait and the problem is urgent for you, you may contact us via Contact Form http://www.opencascade.org/about/contacts/.
We will try to find a solution/workaround acceptable for you.
Thanks for your contribution.
Regards
Sergey

P G's picture

Hi, tried to trim the ellipse between 0 to 360 degrees, not getting a
full ellipse.
Draw[32]> trim t e 0 6.28571428571428571428

to check whether an IGES file from this trimmed curve is created OK.
regards
-PG

sergey zaritchny's picture

Hi,
If you second parameter means 2*PI,
it seems that you are using incorrect PI value
3.1415926535897932384626433832795 * 2 = 6.283185307179586476925286766559.
Regards
Sergey

P G's picture

tried this to make a full 'trimmed' ellipse,

Draw[3]> ellipse e 0 0 0 0 0 1 50 20
Draw[4]> trim t e 0 2*PI
An exception was caught 002EB850 : Standard_ConstructionError: Geom_TrimmedCurve
::U1 == U2
** Exception ** 002EB850 : Standard_ConstructionError: Geom_TrimmedCurve::U1 ==
U2

sergey zaritchny's picture

Hi,
Draw has predefined variable (but not ):
Draw[2]> dval pi
3.1415926535897931
Draw[4]> dval PI
0
As result you got the exception.
Regards
Sergey

P G's picture

Thanks Sergey,
After trimming the ellipse, still getting exception in writing
IGES file. FYI only

sergey zaritchny's picture

Hi,
If you are referring to the last script:
>> ellipse e 0 0 0 0 0 1 50 20
>> trim t e 0 2*pi

It should work (see below):
Draw[30]> ellipse e 0 0 0 0 0 1 50 20
Draw[31]> trim t e 0 2*pi
Draw[32]> brepiges e w:/t2.iges
unit (write) : MM
mode write : Faces
To modifiy : command param
1 Shapes written, giving 1 Entities
Now, to write a file, command : writeall filename
Output on file : w:/t2.iges
Write OK

Draw[33]> brepiges t w:/t1.iges
unit (write) : MM
mode write : Faces
To modifiy : command param
1 Shapes written, giving 1 Entities
Now, to write a file, command : writeall filename
Output on file : w:/t1.iges
Write OK

Regards
Sergey

P G's picture

No , i created a prism from the trimmed ellipse(t)and
tried to write to IGES, then getting the same exception.
Yes, I am able to write ellipse/trim ellipse to an IGES files.
thanks Sergey.

sergey zaritchny's picture

For case with prism the bug with ID = 22056
is already registered.
Regards
Sergey

Roman Lygin's picture

Just for a record.
The bug was fixed in 6.5.0 (or rather in 6.4.1 if to track back using Release Notes). However in RN it is referred to as 22156.

Roman Lygin's picture

Sorry - OCC22126 in RN.
(Editing the forum posts would really be helpful to avoid re-posting).