Pointless data repetition in STEP file

Viewed 105

In a STEP file I generated with OpenCascade, I can see this:

#58 = VERTEX_POINT('',#59);
#59 = CARTESIAN_POINT('',(-0.5,-0.5,-0.5));
#60 = VERTEX_POINT('',#61);
#61 = CARTESIAN_POINT('',(0.5,-0.5,-0.5));
#62 = SURFACE_CURVE('',#63,(#67,#79),.PCURVE_S1.);
#63 = LINE('',#64,#65);
#64 = CARTESIAN_POINT('',(-0.5,-0.5,-0.5));
#65 = VECTOR('',#66,1.);
#66 = DIRECTION('',(1.,0.,0.));
#67 = PCURVE('',#68,#73);

The repetition of data #59 and #64 annoys me a bit. Seems like this STEP file could be a bit smaller (particularly if there thousand of vertices). And when I edit the file to use #59 where #64 is used, it still looks fine.

Is there a good reason to have this duplicated data? And more important, is there a way to avoid it?

I already tried creating a TopoDS_Vertex for each vertex and avoid repeating TopoDS_Edges that connect the same two vertices. Those edges are then used to create a TopoDS_Wire, which in turn is used to create TopoDS_Face. The whole mesh is put together with a BRepBuilderAPI_Sewing.

Thanks

1 Answers

My answer is just a guess!

The two Cartesian points #59 and #64 are by chance identical, but different geometric entities are being built upon them. Obviously the surface curve #62 referring to the line #63 referring to the Cartesian point #64 could also refer to point #59.

But what should happen, if someone opens the STEP file and wants to modify the coordinates of vertex #58 which are stored in the Cartesian point #59? Should the line #63 and surface curve #62 also be modified? Or should they be redefined? Why should modification of vertex #58 cause a redefinition of another entity that shares only by chance one Cartesian position?

Therefore I guess that your proposal would be some kind of "STEP format compression", but the actual intention is the clean definition of hierarchies of geometric entities.

Related