DXF-экспорт теряет внутренние кольца (отверстия) участка/пятна застройки — вырезы зарисовываются сплошняком #1599

Closed
opened 2026-06-16 17:16:25 +00:00 by bot-backend · 0 comments
Collaborator

Severity: low · Категория: data-loss · Файл: backend/app/services/generative/exporters/dxf.py:46-52, 74-83

Файл backend/app/services/generative/exporters/dxf.py:46-52. Хелпер _polygon_points() сериализует только poly.exterior.coords; poly.interiors (отверстия) никогда не эмитируются. Через этот хелпер рисуются и граница участка (строки 74-78, слой PARCEL), и пятно застройки (строки 79-83, слой BUILDABLE). Импакт: parcel_geojson приходит от пользователя/фронта, а geometry._parse_polygon() через shape() сохраняет внутренние кольца (двор, охранная зона, существующее строение, сервитут). Эмпирически подтверждено: GeoJSON-полигон 100x100 с дырой 20x20 сохраняет interior после shape(), внутренний отступ polygon_m.buffer(-3) тоже сохраняет дыру (8160 м2 с interiors=1), но _polygon_points() рисует только внешнее кольцо → площадь 10000 вместо истинных 9600. В DXF (бинарный R2010 — hand-off артефакт для архитекторов) участок с легальным вырезом (no-build зона) отрисуется сплошным пятном, скрывая ограничение, вокруг которого архитектор обязан проектировать. Тихая потеря геометрии в поставляемом файле. Severity low: затрагивает только входной участок, который САМ несёт дыры (внутренний setback-buffer простого полигона дыр не создаёт, поэтому buildable_m обычно без дыр). Фикс: эмитить каждое interior-кольцо отдельной замкнутой LWPolyline (например _polygon_points вернуть exterior + по кольцу на poly.interiors, и в add_lwpolyline добавить отдельные полилинии для дыр на том же слое).

Почему баг: The DXF is the hand-off artifact for architects (binary R2010). A parcel with a legal cutout (no-build zone, existing structure) would be drawn as a solid plot, hiding the constraint the architect must design around. Silent geometric data loss in the deliverable. Edge-case (an inward setback buffer of a simple polygon never creates holes, so buildable_m is normally hole-free; only an input parcel that itself carries holes is affected), hence low severity, but it is genuine corruption of the exported geometry.

Как чинить: In _polygon_points / export_concept_dxf, also emit a closed LWPolyline for each ring in poly.interiors (on the same layer), so holes appear as separate boundaries rather than being absorbed into the filled exterior.


deep-audit backend v2 (после PR #1543) · verify+harden, confidence 0.82 · unit B28

**Severity:** low · **Категория:** data-loss · **Файл:** `backend/app/services/generative/exporters/dxf.py:46-52, 74-83` Файл backend/app/services/generative/exporters/dxf.py:46-52. Хелпер _polygon_points() сериализует только poly.exterior.coords; poly.interiors (отверстия) никогда не эмитируются. Через этот хелпер рисуются и граница участка (строки 74-78, слой PARCEL), и пятно застройки (строки 79-83, слой BUILDABLE). Импакт: parcel_geojson приходит от пользователя/фронта, а geometry._parse_polygon() через shape() сохраняет внутренние кольца (двор, охранная зона, существующее строение, сервитут). Эмпирически подтверждено: GeoJSON-полигон 100x100 с дырой 20x20 сохраняет interior после shape(), внутренний отступ polygon_m.buffer(-3) тоже сохраняет дыру (8160 м2 с interiors=1), но _polygon_points() рисует только внешнее кольцо → площадь 10000 вместо истинных 9600. В DXF (бинарный R2010 — hand-off артефакт для архитекторов) участок с легальным вырезом (no-build зона) отрисуется сплошным пятном, скрывая ограничение, вокруг которого архитектор обязан проектировать. Тихая потеря геометрии в поставляемом файле. Severity low: затрагивает только входной участок, который САМ несёт дыры (внутренний setback-buffer простого полигона дыр не создаёт, поэтому buildable_m обычно без дыр). Фикс: эмитить каждое interior-кольцо отдельной замкнутой LWPolyline (например _polygon_points вернуть exterior + по кольцу на poly.interiors, и в add_lwpolyline добавить отдельные полилинии для дыр на том же слое). **Почему баг:** The DXF is the hand-off artifact for architects (binary R2010). A parcel with a legal cutout (no-build zone, existing structure) would be drawn as a solid plot, hiding the constraint the architect must design around. Silent geometric data loss in the deliverable. Edge-case (an inward setback buffer of a simple polygon never creates holes, so buildable_m is normally hole-free; only an input parcel that itself carries holes is affected), hence low severity, but it is genuine corruption of the exported geometry. **Как чинить:** In _polygon_points / export_concept_dxf, also emit a closed LWPolyline for each ring in poly.interiors (on the same layer), so holes appear as separate boundaries rather than being absorbed into the filled exterior. --- <sub>deep-audit backend v2 (после PR #1543) · verify+harden, confidence 0.82 · unit B28</sub>
bot-backend added the
week ревью 1
label 2026-06-16 17:16:25 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lekss361/gendesign#1599
No description provided.