Skip to content

spec: guard MPOLYGON spline fitpts like HATCH - #1535

Merged
rurban merged 1 commit into
LibreDWG:masterfrom
mlightcad:fix/mpolygon-fitpts
Nov 15, 2026
Merged

rurban merged 1 commit into
LibreDWG:masterfrom
mlightcad:fix/mpolygon-fitpts

Conversation

@mlightcad

Copy link
Copy Markdown
Contributor

Summary

Fixes #1529.

HATCH already skips fitpts/tangents when num_fitpts == 0. MPOLYGON still called FIELD_2RD_VECTOR on a zero count and omitted the tangents that follow a non-empty fit-point edge.

Change

Mirror HATCH: read fitpts + start/end tangents only when num_fitpts > 0. Also assign curve_type via segx[] in the default arm.

Test plan

  • Decode an MPOLYGON (or hatch-like polygon) with spline edges where some edges have num_fitpts == 0
  • Confirm remaining edges/paths still decode after a fit-point edge

HATCH already skips fitpts/tangents when num_fitpts is 0. MPOLYGON still
called FIELD_2RD_VECTOR on a zero count (VALUEOUTOFBOUNDS) and omitted
the start/end tangents that follow a non-empty fit-point edge.

* src/dwg.spec (MPOLYGON): Read fitpts and tangents only when
  num_fitpts > 0; fix default curve_type assignment to use segx[].
@rurban rurban self-assigned this Nov 15, 2026
@rurban rurban added the bug Something isn't working label Nov 15, 2026
@rurban rurban added this to the 0.14.1 milestone Nov 15, 2026
@rurban
rurban merged commit a106ebe into LibreDWG:master Nov 15, 2026
21 checks passed
@mlightcad
mlightcad deleted the fix/mpolygon-fitpts branch November 15, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spec: MPOLYGON spline edges still read fitpts when num_fitpts is 0

2 participants