vagran / dxf-viewer

DXF 2D viewer written in JavaScript
Mozilla Public License 2.0
290 stars 86 forks source link

How to adopt this for BabylonJS #98

Closed MartinPyka closed 6 months ago

MartinPyka commented 6 months ago

I am wondering, how I would interface BabylonJS with this dxf-viewer. I was looking through you code and thought that maybe the file DxfScene.js is one where I would need to replace the ThreeJS-way of creating 3d objects by the BabylonJS-way. What do you think? Where should I start, when I would try to replace ThreeJS with BabylonJS for the view.

Best, Martin

vagran commented 6 months ago

Unfortunately, I am not familiar with BabylonJS. However, I doubt you need to modify DxfScene.js for that. It produces DXF scene which is platform-independent representation of DXF entities, optimized for high-performant batch rendering. In contrast, DxfViewer.js contains code which converts this pure geometry data to three.js-specific scene. That is what you need to rewrite.

MartinPyka commented 6 months ago

Alright, thanks for the hint. I will dig deeper into that