libredwg icon indicating copy to clipboard operation
libredwg copied to clipboard

LibreDWG for Unreal Engine 4.

Open tincivilfx opened this issue 4 years ago • 5 comments

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!

tincivilfx avatar Aug 05 '20 01:08 tincivilfx

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

rurban avatar Aug 05 '20 06:08 rurban

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.

eryar avatar Aug 05 '20 06:08 eryar

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)?

tincivilfx avatar Aug 05 '20 23:08 tincivilfx

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.

rurban avatar Aug 06 '20 05:08 rurban

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

Begalov avatar Sep 01 '20 11:09 Begalov