Skip to content

Cannot parse STEP AP203 output of Plasticity #252

@crabdancing

Description

@crabdancing

I'm not sure if I'm doing something wrong, but I have ruststep added to my Cargo.toml like so:

[dependencies]
ruststep = { version = "0.4.0", features = ["ap201", "ap203"] }

With this as my test code:

fn main() {
    let string = std::fs::read_to_string("idler.step").unwrap();
    ruststep::parser::parse(&string).unwrap();
}

Which then errors like so:

thread 'main' panicked at src/main.rs:3:38:
called `Result::unwrap()` on an `Err` value: TokenizeFailed(Error while tokenizing STEP input
0: at line 20, in Tag:
DATA;
^

)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The start of the file looks like this:

ISO-10303-21;
HEADER;

/* File generated by HOOPS Exchange Version 24.2.0 */

FILE_DESCRIPTION(('HOOPS Exchange Step'),'2;1');

FILE_NAME('/home/nikoru/Downloads/idler.step',
'2025-03-05T17:10:01+17:00',
('nikoru'),
('Unknown organisation'),
'HOOPS Exchange 2024.2',
'HOOPS Exchange',
'Unknown authorisation');

FILE_SCHEMA( ('AP203_CONFIGURATION_CONTROLLED_3D_DESIGN_OF_MECHANICAL_PARTS_AND_ASSEMBLIES_MIM_LF') );

ENDSEC;

DATA;
#3=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
#4=PLANE_ANGLE_MEASURE_WITH_UNIT(PLANE_ANGLE_MEASURE(0.0174532925),#3);
#5=(CONVERSION_BASED_UNIT('DEGREE',#4)NAMED_UNIT(#6)PLANE_ANGLE_UNIT());

With the line DATA; being where the parser breaks.

I have attached the full file here:

idler.step.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions