Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot parse STEP AP203 output of Plasticity #252

Open
crabdancing opened this issue Mar 6, 2025 · 0 comments
Open

Cannot parse STEP AP203 output of Plasticity #252

crabdancing opened this issue Mar 6, 2025 · 0 comments

Comments

@crabdancing
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant