ruststep icon indicating copy to clipboard operation
ruststep copied to clipboard

Specification for STEP file output

Open termoshtt opened this issue 4 years ago • 1 comments

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
    • [x] Serialize a single struct into a record #30
  • [ ] Duplication elimination
  • [ ] Update ARCHITECTURE.md

termoshtt avatar Mar 04 '21 10:03 termoshtt

Drop from 0.1.0 milestone

termoshtt avatar Sep 24 '21 15:09 termoshtt