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

Issue creating polyline in 0.5.0 #41

Open
btdevine opened this issue Apr 28, 2023 · 0 comments
Open

Issue creating polyline in 0.5.0 #41

btdevine opened this issue Apr 28, 2023 · 0 comments

Comments

@btdevine
Copy link

btdevine commented Apr 28, 2023

Hi,

First off, many thanks for creating this, I just started using it and it's awesome!

I'm running into an issue with creating polylines in version 0.5.0. When I upload the generated DXF to viewer.autodesk.com, I get the following error. Likewise, opening in Civil3D does not work.

Processing failed
Design is empty. Please check the design.
AutoCAD-InvalidFile Sorry, the drawing file is invalid and cannot be viewed. - Please try to recover the file in AutoCAD, and upload it again to view.
TranslationWorker-InternalFailure Unrecoverable exit code from extractor: -1073741831

I can, however, properly create a polyline in version 0.4.0; the exported file loads correctly into viewer.autodesk.com, and I can open it in Civil3D.

Looking at the diffs between the two output files (attached, converted to .txt files),
0.4.0-works.txt
0.5.0-broken.txt
it appears as though the primary difference, aside from what appear to be some numbering convention changes, is that 0.5.0 has added tables to the TABLES section, whereas tables are absent in the file created by 0.4.0.

The following works in v0.4.0

let mut drawing = Drawing::default();
let mut polyline = Polyline::default();

polyline.vertices = [
    Vertex::new(Point::new(0.0, 0.0, 0.0)),
    Vertex::new(Point::new(10.0, 0.0, 0.0)),
    Vertex::new(Point::new(10.0, 10.0, 10.0)),
    Vertex::new(Point::new(0.0, 10.0, 10.0)),
    Vertex::new(Point::new(0.0, 0.0, 0.0)),
]
.to_vec();

polyline.set_is_3d_polyline(true);
polyline.set_is_closed(true);

let polyline_entity = Entity::new(EntityType::Polyline(polyline));
drawing.entities.push(polyline_entity);

The following does not work in v0.5.0

let mut drawing = Drawing::new();
let mut polyline = Polyline::default();

polyline.add_vertex(&mut drawing, Vertex::new(Point::new(0.0, 0.0, 0.0)));
polyline.add_vertex(&mut drawing, Vertex::new(Point::new(10.0, 0.0, 0.0)));
polyline.add_vertex(&mut drawing, Vertex::new(Point::new(10.0, 10.0, 10.0)));
polyline.add_vertex(&mut drawing, Vertex::new(Point::new(0.0, 10.0, 10.0)));
polyline.add_vertex(&mut drawing, Vertex::new(Point::new(0.0, 0.0, 0.0)));

polyline.set_is_3d_polyline(true);
polyline.set_is_closed(true);

let polyline_entity = Entity::new(EntityType::Polyline(polyline));
drawing.add_entity(polyline_entity);
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