File format for swept profile with changing normal I have to create a file describing a 3d surface with the following properties:


a circular arc cross section is swept along a closed 2d curve spine defined with equations
the normal direction of the arc is not always tangential to the spine, the direction is defined with an equation
the surface should be analytic (defined by equations), but a tesselated surface is also acceptable (with an external script I can derive the x,y,z coords of the vertexes for a tesselated surface)
the file will be modified by an external script (python), so it should be editable with text editor
the file should be opened by Creo(Proe), Catia and NX


The question:
Which is the best file format for making this feature?

What I tried:


step: buying the ISO standard is unavoidable, as I cannot figure out on my own how the definition works
vrml: only tesselated seems to be feasible
x3d: same as vrml, as it has a sweep (extrusion) feature, but the normal direction is the same as the local spine direction, and Proe does not seem to open it


The egg-shaped curve is the trajectory, the arc is the curve to be swept along it.
The plane of the arc is close to parallel to the plane "Top", but this angle varies between 0-30 degrees
Well realistically your choices are either IGES or STEP. IGES is slightly simpler but you will not successfully write either format without buying the standard (which in case of step is actually so many pages that by the time you have read them a year has passed, and lots of money is wasted on paper). You could also use one of the nonstandard kernel internal formats like Parasolid as its also commonly supported. Most other formats are polygon data so not suitable.

I would explore an alternative option to writing your own exporter, buy a commercial or take a free CAD kernel and let the kernel (open CASCADE) do the exporting for you.

On the other hand this is not hard to do inside your CAD application. Which you will need anyway to verify the result. Most CAD applications have a COM API's (don't know about NX most likely, but both creo and catia do have this) so you can edit, even do the generation from a text editor via python if you so wish. This is by far the least amount of effort (and it's usually less work to set up than using just the kernel).



Image 1: Swept with spine angle $60 \cos(4 t)+110$ and polar trajectory with $r = \cos(4 t)+3$ in Creo. All input from program injection.

So the approach depends on why you want to do what you do. And what your budget/time constraint is.

PS: NURBS (the underlying format of CAD data) solutions are not necessarily analytic, but parametric fits to analytical solutions. Sometimes these are exact sometimes not so exact as not all functions can be fitted to rational spline (though many can). Even when they can fitting is a more general solution.