pageldev/libOpenDRIVE

get .obj file from the code

Closed this issue · 5 comments

  1. I want to get .obj file from the code How Could i get it..?!

  2. In web site (https://odrviewer.io/), if i push 'export .obj' button, the screen become black like under picture.
    How could i use the function? please explain the function, thank you.
    image
    image

Thanks for noticing! It should be fixed now.

I re-added the functionality of getting a road network mesh in commit 74a5d07 This was accidentally removed when deprecating the viewer. You can now get an .obj like this via code:

odr::OpenDriveMap odr_map("test.xodr");
odr::RoadNetworkMesh road_network_mesh = odr_map.get_road_network_mesh(0.1 /*eps*/);
std::ofstream out_file("out.obj");
out_file << road_network_mesh.get_mesh().get_obj() << std::endl;
out_file.close();

Thank you for your help @grepthat
But, I couldn't get some more information such as middle line, junction, etc.. in obj picture(3D Viewer).

image

Could i get more information from the code?

Do you mean the junction areas are missing in the generated .obj file?

Best provide an example .xodr

Thank you for your reply @grepthat

I mean that I can get road outline in the generated .obj file, but I can't get the others such as center line.

"Best provide an example .xodr", In this sentence, you mean my opendrive file is something wrong??