-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
RFCRequest for commentsRequest for comments
Description
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
- Serialize a single struct into a record Record Serializer #30
- Duplication elimination
- Update ARCHITECTURE.md
Metadata
Metadata
Assignees
Labels
RFCRequest for commentsRequest for comments