File: test_surface_entities.py

package info (click to toggle)
ezdxf 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 104,528 kB
  • sloc: python: 182,341; makefile: 116; lisp: 20; ansic: 4
file content (23 lines) | stat: -rw-r--r-- 751 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Copyright 2018-2021, Manfred Moitzi
# License: MIT License
import pytest
import ezdxf

DXF_PATH = ezdxf.options.test_files_path / "DXF_with_ACIS_data"
SURFACES = DXF_PATH / "All_Surfaces_R2010.dxf"
DELIMITER = "\n" + "=" * 80 + "\n"


@pytest.mark.skipif(not SURFACES.exists(), reason=f"File {SURFACES} not found")
def test_get_acis_data_from_surfaces():
    dwg = ezdxf.readfile(SURFACES)
    msp = dwg.modelspace()

    with open(DXF_PATH / "All_Surfaces_R2010.sat", "wt") as f:
        for surface in msp.query(
            "SURFACE SWEPTSURFACE REVOLVEDSURFACE LOFTEDSURFACE EXTRUDEDSURFACE"
        ):
            f.write(DELIMITER)
            f.write(str(surface) + ":")
            f.write(DELIMITER)
            f.write(surface.tostring())