Is it a bug of exporting extrude surface to iges file?

Hi All,

I am not sure whether it's a bug of exporting extrude surface to iges file.
My procedures list as follows:
1. Create a simple b-spline curve edge (planar or spatial)
2. Create a extrude face by API BRepPrimAPI_MakePrism, the profile curve is just the curve created at step 1.
3. Export the extrude face by API IGESControl_Writer to iges file
4. Reload the iges file by OCAF iges reader, the extrude surface can't be imported. I traced the code and find it returns error in:
TopoDS_Shape IGESToBRep_TopoSurface::TransferTabulatedCylinder
(const Handle(IGESGeom_TabulatedCylinder)& st)
the specific error happens at:
gp_Pnt pt2 = st->EndPoint();
pt2.Scale(gp_Pnt(0,0,0),GetUnitFactor());
TheULength = pt1.Distance(pt2);
if(TheULength Message_Msg msg("Tabulated cylinder with zero length");
SendFail (st, msg); // TabulatedCylinder was built with continuity C0
return res;
}

In fact, my I/O module have worked well for a long time. Does anyone find the similar problem?

Any suggestion is welcome. Thanks in advance.

PS: I suspect gp_Pnt pt2 = st->EndPoint(); should be replaced by pt2 = st->StartPoint()

Ding

Roman Lygin's picture

Hi Ding,
Yep, indeed there seems to be some problem.
In DRAW:
> pload all
> bsplinecurve bs 2 2 0 3 2 3 0 0 0 1 1 1 0 1 2 0 0 1
> mkedge e bs
> prism p e 0 0 5
> brepiges p newp.igs
# An exception was caught 00544B00 : Standard_DivideByZero: FLT DIVIDE BY ZERO
** Exception ** 00544B00 : Standard_DivideByZero: FLT DIVIDE BY ZERO

The problem is in export not in import as you supposed (IGESToBRep is part of importer).
Thanks for reporting the issue. Will try to investigate if have some spare time.
Roman

Cauchy Ding's picture

Hi Roman and Forum supervisor,

Thanks to both of you. Thanks to your explanations.

Ding

Forum supervisor's picture

Hello Ding,

Thank you for the bug report. This problem is now registered with reference number OCC21906.

By the way, here is another way to construct similar face export of which works well.

pload ALL
bsplinecurve bs 2 2 0 3 2 3 0 0 0 1 1 1 0 1 2 0 0 1
extsurf s bs 0 0 1
trimv s s 0 5
mkface p s
brepiges p newp.igs

Best regards,
Forum supervisor