Skip to content

Specification for STEP file output #13

@termoshtt

Description

@termoshtt

STEP file input (load) has been specified in ARCHITECTURE.md and implemented partially in ruststep::parser with later process by #12 . But, its output spec is not determined.

Duplication Elimination

For example, let us consider the entities discussed in ARCHITECTURE.md:

ENTITY a;
  x: INTEGER;
  y: INTEGER;
END_ENTITY;

ENTITY b;
  z: INTEGER;
  w: a;
END_ENTITY;

If a user has two instances of b

let b1 = B(1, A(1, 2));
let b2 = B(2, A(1, 2));

The problem here is how to eliminate the duplicated instance A(1, 2):

DATA;
#1 = A(1, 2);
#2 = B(1, @1);
#3 = B(2, @1);
ENDSEC;

We can also emit duplicated instances without elimination process, and it would be somewhat easy to implement:

DATA;
#1 = A(1, 2);
#2 = B(1, @1);
#3 = A(1, 2);
#4 = B(2, @3);
ENDSEC;

Rust API

Rust struct like

struct A {
  x: f64,
  y: f64,
}

struct B {
  z: f64,
  a: A,
}

into a STEP Record B((1.0, A((2.0, 3.0)) will be done by serde. The data mapping from Rust struct to serde data model has introduced in #18, #20, #21, and the responsibility of this issue is to implement serde::Serialize compatible for these existing implementations.

TODO

  • Implement STEP output using serde::Serialize
  • Duplication elimination
  • Update ARCHITECTURE.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCRequest for comments

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions