Esempio n. 1
0
def test_export_vtk_surface_evalpts(bspline_surface):
    fname = FILE_NAME + ".vtk"

    bspline_surface.sample_size = SAMPLE_SIZE
    exchange_vtk.export_polydata(bspline_surface, fname, point_type="evalpts")

    assert os.path.isfile(fname)
    assert os.path.getsize(fname) > 0

    # Clean up temporary file if exists
    if os.path.isfile(fname):
        os.remove(fname)
Esempio n. 2
0
def test_export_vtk_surface_evalpts(bspline_surface):
    fname = FILE_NAME + ".vtk"

    bspline_surface.sample_size = SAMPLE_SIZE
    exchange_vtk.export_polydata(bspline_surface, fname, point_type="evalpts")

    assert os.path.isfile(fname)
    assert os.path.getsize(fname) > 0

    # Clean up temporary file if exists
    if os.path.isfile(fname):
        os.remove(fname)
Esempio n. 3
0
# -*- coding: utf-8 -*-
"""
    Examples for the NURBS-Python Package
    Released under MIT License
    Developed by Onur Rauf Bingol (c) 2019

    Exporting multiple NURBS surfaces in VTK Polydata format
"""

from geomdl.shapes import surface
from geomdl import operations
from geomdl import multi
from geomdl import exchange_vtk

# Create a cylindrical surface
cylinder = surface.cylinder(radius=5.0, height=22.5)

# Decompose to generate multiple surfaces
cylinder_decomposed = operations.decompose_surface(cylinder)

# Add decomposed surfaces to a surface container
surf_container = multi.SurfaceContainer(cylinder_decomposed)

# Export evaluated points as a .vtk file
exchange_vtk.export_polydata(surf_container,
                             "cylindrical_surface_decomposed_evalpts.vtk",
                             tessellate=True)

# Good to have something here to put a breakpoint
pass
Esempio n. 4
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
    Examples for the NURBS-Python Package
    Released under MIT License
    Developed by Onur Rauf Bingol (c) 2019

    Exporting a NURBS surface in VTK Polydata format
"""

from geomdl.shapes import surface
from geomdl import exchange_vtk

# Create a cylindrical surface
cylinder = surface.cylinder(radius=5.0, height=22.5)

# Export evaluated points as a .vtk file
exchange_vtk.export_polydata(cylinder,
                             "cylindrical_surface_evalpts.vtk",
                             tessellate=True)

# Export control points as a .vtk file (optionally tessellated as quads)
exchange_vtk.export_polydata(cylinder,
                             "cylindrical_surface_ctrlpts.vtk",
                             point_type="ctrlpts",
                             tessellate=False)

# Good to have something here to put a breakpoint
pass