Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dxf/wipeout : support the translation of WIPEOUT entities #11720

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

Jwohnlf
Copy link

@Jwohnlf Jwohnlf commented Jan 26, 2025

DXF: new function adding a light support for parsing WIPEOUT DXF entities. This feature is now able to translate the outer line of WIPEOUT entities to get them in the output data.

Fixes #11022

@Jwohnlf Jwohnlf changed the title Dxf/wipeout Dxf/wipeout : support the translation of WIPEOUT entities Jan 26, 2025
@rouault
Copy link
Member

rouault commented Jan 26, 2025

CC @atlight

Copy link
Contributor

@atlight atlight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works nicely, just a few comments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jwohnlf could you please PURGE this file and downsave it to an earlier AutoCAD version to reduce the file size? There doesn't seem to be any loss of functionality when I downsave to AutoCAD 2000. After "purging all" three times and saving in 2000 format, the file size is only 194 KB - and it can be reduced further by manually deleting the XRECORD entity at the end with all the RTVS garbage.

/* Group codes 10, 20 and 30 control the insertion point of the lower */
/* left corner of your image. */
case 10:
if (bHaveX && bHaveY)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this if block needed? I don't see any reason why there would ever be more than one 10,20 point

break;

case 20:
if (bHaveX && bHaveY)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

@@ -160,6 +160,9 @@ The following entity types are supported:
label. Block content for MULTILEADERS is treated as for INSERT.
Spline leaders are tessellated into line segments.

- WIPEOUT: a light support of WIPEOUT entities can parse the outline
geometry of WIPEOUT entities and translate it into a POLYGON feature.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should make it clear this is 2D support only - Z coordinates are ignored

break;

case 71:
break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DXF spec seems to say that the format of the 14,24 points is different when 71 is set to 1 (as opposed to 2). I can't get AutoCAD to generate 71 = 1 WIPEOUTS, but QCAD claims to be able to do it. If you're not going to implement support for 71 = 1, you should at least output a warning and ignore the rest of the entity, rather than translating the geometry wrongly.

case 24:
if (bHaveX && bHaveY)
{
smoothPolyline.AddPoint(dfXOffset + (0.5 + dfX) * dfXscale,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the final vertex will never be added. I can see why you have chosen to write it this way, but it should be explicitly mentioned in a comment somewhere in case someone thinks it's a mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DXF: add the support of AutoCAD Wipeout object
3 participants