How to learn about the STEP file format?
Asked Answered
I

3

6

I would like to create STEP files of geometry that I have generated using custom numerical methods. Given a list of coordinates, I would like to be able to write these into a file with valid STEP format. To this end, I have been searching for an introduction to the STEP file format.

I can easily create STEP files using a variety of CAD applications, and I have been scrutinizing these files in an effort to understand their structure. A lot of it makes sense, but also a lot of it remains opaque. For instance consider the following item which describes a spline.

#38=B_SPLINE_CURVE_WITH_KNOTS('',5,(#43,#44,#45,#46,#47,#48),.UNSPECIFIED.,.F.,.F.,(6,6),(0.,1.),.UNSPECIFIED.);

I have been unable to find a description anywhere of what the nine arguments to this element are. I paid a substantial sum to ISO for something called SMRL_v6_rc1, and I got in return a massive database with entries such as:

ENTITY b_spline_curve_with_knots
  SUBTYPE OF (b_spline_curve);
  knot_multiplicities : LIST[2:?] OF INTEGER;
  knots : LIST[2:?] OF parameter_value;
  knot_spec : knot_type;
DERIVE
  upper_index_on_knots : INTEGER := SIZEOF(knots);
WHERE
  WR1: constraints_param_b_spline(degree, upper_index_on_knots, upper_index_on_control_points, knot_multiplicities, knots);
  WR2: SIZEOF(knot_multiplicities) = upper_index_on_knots;
END_ENTITY;

Although the title is the same as the line from the STEP file, I don't see a list of nine arguments. I have a suspicion that I'm approaching this whole thing the wrong way, and so any comments or suggestions would be very much appreciated.

(Ideally I'm looking for a well written guide to the STEP file format, similar to the PDF Reference published by Adobe.)

Isolation answered 31/7, 2019 at 14:51 Comment(1)
I
5

After digging into this more, I found that the ISO spec for STEP files actually explains itself. The relevant spec is ISO 10303, and the key parts are as follows:

ISO 10303-11 explains the EXPRESS schema, which is the language used to articulate abstract structures and relationships within ISO 10303.

ISO 10303-21 explains the concrete format of a STEP file. Or rather, how you get from the EXPRESS schema to the file format.

ISO 10303-42 has all the math of curves, surfaces, etc, all expressed in the EXPRESS schema language.

These document sets need to be purchased for hundreds of dollars from a standards vendor e.g., I have done this and am now attempting to decipher the documents. If I have any more insights into this process I'll post them here.

Isolation answered 2/8, 2019 at 3:3 Comment(2)
I did the same in the past and guess what? I asked a refund. Those document are undecyphrable!Isostasy
you can take a look at stepcode.github.io/docs/home, and its Google Group: groups.google.com/forum/#!forum/scl-dev. Try to look at stepmod as well.Quartile
I
4

I work on STEP file format from years and guess what, I still don't fully understand how it works. The biggest problem is the lack of a detailed specification document as you requested. On the other side, you can find many schema definitions that I consider simply useless. The most useful resources available today are these definitions from the BuildingSmart website. At least they contain a drawing and some useful specs.

For all the rest you need to study how other CAD systems write the STEP file, starting from the specific entities that you need. Good luck!

Isostasy answered 31/7, 2019 at 17:9 Comment(0)
P
4

I have the SMRL version 7, and it has some more information on the b_spline_curve_with_knots. I'm not sure if it contains more than the version you have, but the code you referenced, is the EXPRESS code specifying b_spline_curve_with_knots. This I think is publically available. What the SMRL and payed ISO documents should contain is not only the code, but textual information on each entity.

Anyway, the b_spline_curve_with_knots is part of hierachy of entities. And it goes like this;

b_spline_curve_with_knots is a subtype of

b_spline_curve which is subtype of

bounded_curve which is subtype of

curve which is subtype of

geometric_representation_item which is subtype of

representation_item

Each of these entities have their own attributes. An each entity that inherit another entity, inherits the attributes.

From this line: #38=B_SPLINE_CURVE_WITH_KNOTS('',5,(#43,#44,#45,#46,#47,#48),.UNSPECIFIED.,.F.,.F.,(6,6),(0.,1.),.UNSPECIFIED.); we can break it down like this:

#38= The identifier of this entity instance in the STEP file.

B_SPLINE_CURVE_WITH_KNOTS( The entity name

'', The 1st attribute, named name, inherited from representation_item. It is set to an empty string, but could give a name to the curve.

5, The 2nd attribute, named degree, inherited from b_spline_curve. Specifies the degree of the b-spline base function.

(#43,#44,#45,#46,#47,#48), The 3rd attribute, named control_points_list, inherited from b_spline_curve. It is a list of references to cartesian_points that defines the coordinates of the control points.

.UNSPECIFIED., The 4th attribute, named curve_form, inherited from b_spline_curve. It is an enumeration that could specify the type of curve, but here it is unspecified.

.F., The 5th attribute, named closed_curve, inherited from b_spline_curve. Set to false here.

.F., The 6th attribute, named self_intersect, inherited from b_spline_curve. Set to false here.

(6,6), The 7th attribute, named knot_multiplicities. This list defines the number of times each knot in the knots list is to be repeated in constructing the knot array.

(0.,1.), The 8th attribute, named knots. The list of distinct knots used to define the B-spline basis functions.

.UNSPECIFIED.); The 9th attribute, named knot_spec The description of the knot type. In this case is not specified.

Puzzler answered 8/10, 2019 at 11:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.