js-dxf icon indicating copy to clipboard operation
js-dxf copied to clipboard

Add support for including images

Open omkarap55 opened this issue 3 years ago • 9 comments

Hi, any plans to add support for including images in DXF file?

omkarap55 avatar Dec 09 '21 05:12 omkarap55

Hi,

I have not had such a plan. I do not know how complicated would that be, do you have the idea?

ognjen-petrovic avatar Dec 09 '21 06:12 ognjen-petrovic

Actually, I do not have any idea about the level of complexity of this feature. I have seen this feature in LibreCAD. Maybe this could be useful reference for you. Let me know your thoughts.

omkarap55 avatar Dec 09 '21 13:12 omkarap55

Hi,

After some research the js-dxf need a dynamic API for managing sections. In order to implement an IMAGE entity we need tow objects in OBJECTS section IMAGEDEF and IMAGEDEF_REACTOR and I think we need a class in CLASSES section. I am curently aiming to implementig this feature but I am strugling with DXF reference, also finding a good algorithm for the current api.

tarikjabiri avatar Dec 22 '21 22:12 tarikjabiri

I'm also very intersted in being able to add raster images!

Kinatzo avatar Jan 01 '22 15:01 Kinatzo

Hi, now i have problems, how to fill the color for the graphics, and my English is bad ,sry

SinMayFly avatar Mar 10 '22 08:03 SinMayFly

Hi,

After some research the js-dxf need a dynamic API for managing sections. In order to implement an IMAGE entity we need tow objects in OBJECTS section IMAGEDEF and IMAGEDEF_REACTOR and I think we need a class in CLASSES section. I am curently aiming to implementig this feature but I am strugling with DXF reference, also finding a good algorithm for the current api.

hi, I see that you added image support for your TypeScript library. Can we add the same here for js-dxf? I was hoping that js-dxf supports hatch. Without hatch support, can image be used to tiled in a polygon?

novotechsoft avatar Jun 13 '22 22:06 novotechsoft

Hi, @ognjen-petrovic said to keep js-dxf simple as possible so implementing Image entity is a bit tricky because needs objects to be implemented.

I am working on my lib so the next version support as many features as possible but I am struggling with time(I am not free) and the dxf spec. And about hatch I will see if can implement it

tarikjabiri avatar Jun 13 '22 22:06 tarikjabiri

thanks very much! Hatch is a very vital part of DXF or DWG files, so adding it to js-dxf will be a great step ahead. Thank you again for the quick reply.

novotechsoft avatar Jun 13 '22 22:06 novotechsoft

Hi,

The HATCH, IMAGE, INSERT and BLOCKS are implemented in my lib, and I published a pre-release see NPM or Github. For more informations see Documantation.

And I want to say sorry I can't implent them in js-dxf because focusing in tow libs is hard for me, I will add features that are easy to implement.

Thank you.

tarikjabiri avatar Jun 18 '22 11:06 tarikjabiri