2

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

widgg
  • 1,358
  • 2
  • 16
  • 35
  • Currently on version `7.1.0`. I know there's more recent versions and that could be the actual cause. – widgg Feb 18 '21 at 21:57

1 Answers1

2

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.

Benjamin Bihler
  • 1,612
  • 11
  • 32
  • I can see your point for potential modification of the data. But a good editor should be able to go around this. Also, the line definition could be simplified by attaching two cartesian points together instead of relying on a vector (vector that is the difference between two cartesian points, which is a different way of data duplication). – widgg Feb 23 '21 at 14:33
  • I guess you are right - but why change anything? If minimal file size was the intention of the STEP file format, it would be a binary format anyway! – Benjamin Bihler Feb 23 '21 at 20:59