libredwg icon indicating copy to clipboard operation
libredwg copied to clipboard

Add common preR13 POLYLINE and VERTEX entities

Open michal-josef-spacek opened this issue 1 year ago • 12 comments

In https://github.com/LibreDWG/libredwg/issues/713 we discussed that PR is ugly and we need common POLYLINE and VERTEX entities.

michal-josef-spacek avatar May 10 '23 19:05 michal-josef-spacek

I created https://github.com/LibreDWG/libredwg/pull/724 with:

  • Comment updates
  • New preR13 POLYLINE and VERTEX structures and API
  • preR13 decoding and encoding of DWG.

michal-josef-spacek avatar May 10 '23 19:05 michal-josef-spacek

@rurban What should be next? Do we need conversion to special entities like POLYLINE_2D in decoding/encoding? Or in different place?

michal-josef-spacek avatar May 10 '23 19:05 michal-josef-spacek

Hmm, still ugly. I'm experimenting with both

rurban avatar May 11 '23 08:05 rurban

I will update PR with renamed variables. Thank you.

michal-josef-spacek avatar May 11 '23 09:05 michal-josef-spacek

@rurban Do we need some update in dwg_api.c for this new POLYLINE_R11 entity?

michal-josef-spacek avatar May 11 '23 13:05 michal-josef-spacek

Sure, see my fixups

rurban avatar May 11 '23 13:05 rurban

Or just use common POLYLINE_R11 and VERTEX_R11 macros in the dwg.spec. This way no need for extra structs and seperation.

rurban avatar May 12 '23 08:05 rurban

I am working on it. I will prepare a new PR for it. I was fixing DXF yesterday.

michal-josef-spacek avatar May 12 '23 09:05 michal-josef-spacek

I'll add the other branch soon, with a COMMON_POLYLINE_R11 and VERTEX macro in the spec.

rurban avatar Jun 03 '23 05:06 rurban

So now we have now alternative implementations.

  • The elegant one with an extra POLYLINE_R11 entity, which has the missing problem of up- downconverting across r11.
  • The simple one, with common entity fields, including all the r11 fields, which are not relevant to the special entity in question. We could skip them with compile-time branches (macros).

I"m tending to the 1st branch, with the converters.

rurban avatar Jun 05 '23 05:06 rurban

Thank you for the implementation of the second one.

I wrote this first one because I thought that you don't want to have all variables in structure. I tend to implementation with the simplest structures personally, but conversions are not easy too. Conversions are only in s few use cases too.

michal-josef-spacek avatar Jun 05 '23 08:06 michal-josef-spacek

It's not so important, more convenience.

I"m still fixing other bugs with r11 plines and vertices, but it"s ready soon. #754

rurban avatar Jun 05 '23 11:06 rurban