LibreDWG / libredwg

Official mirror of libredwg. With CI hooks and nightly releases. PR's ok
https://savannah.gnu.org/projects/libredwg/
GNU General Public License v3.0
896 stars 222 forks source link

LibreDWG for Unreal Engine 4. #266

Open tincivilfx opened 3 years ago

tincivilfx commented 3 years ago

Hi,

We would like to know if we can use LibreDWG to import meshes from .dwg to the real time engine for rendering.

Thanks for your work on this so far!

rurban commented 3 years ago

No idea how the Unreal Engine represents 3D data. But you certainly can use LibreDWG to import DWG or DXF and then convert some of the 3D objects to your format. As I read here https://docs.unrealengine.com/en-US/Engine/Content/Types/StaticMeshes/HowTo/Importing/index.html UE4 prefers the FBX format, so you need to find a dwg2fbx or dxf2fbx converter, and appartently there exists a SDK for that: https://en.wikipedia.org/wiki/FBX Blender can do it also. https://code.blender.org/2013/08/fbx-binary-file-format-specification/

Easiest would be to import the DXF into blender and export it as FBX, I think

eryar commented 3 years ago

If your 3d in DWG/DXF in the form of 3DFACE or MESH, I think you can use LibreDWG to convert these 3d data to Unreal Engine. If the 3d in DWG/DXF is 3DSOLID, I think you need a geometry kernel to convert ACIS of 3DSOLID.

tincivilfx commented 3 years ago

Thanks both for detailed comments. My .dwg files would always contain valid 3d meshes.

Is there an existing framework in the library to pull out: vertices positions, triangles, normals, uv0, vertexcolors, tangents of a given mesh (layer)?

rurban commented 3 years ago

Nope, no API around objects so far. Only raw access to the fields and vectors. dwg_api.h has s little bit of vertex accesses, but not much. And geom.c does little bit of OCS to UCS conversion for SVG.

Begalov commented 3 years ago

I can recommend blender as an intermediary for DXF import, model processing and export to OBJ or FBX