Exemplo n.º 1
0
def test_export_off_single(nurbs_surface):
    fname = FILE_NAME + ".off"

    nurbs_surface.sample_size = SAMPLE_SIZE
    exchange.export_off(nurbs_surface, fname)

    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)
def test_export_off_single(nurbs_surface):
    fname = FILE_NAME + ".off"

    nurbs_surface.sample_size = SAMPLE_SIZE
    exchange.export_off(nurbs_surface, fname)

    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)
def test_export_off_multi(nurbs_surface_decompose):
    fname = FILE_NAME + ".off"

    nurbs_multi = operations.decompose_surface(nurbs_surface_decompose)

    nurbs_multi.sample_size = SAMPLE_SIZE
    exchange.export_off(nurbs_multi, fname)

    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)
Exemplo n.º 4
0
def test_export_off_multi(nurbs_surface_decompose):
    fname = FILE_NAME + ".off"

    data = operations.decompose_surface(nurbs_surface_decompose)
    nurbs_multi = multi.SurfaceContainer(data)

    nurbs_multi.sample_size = SAMPLE_SIZE
    exchange.export_off(nurbs_multi, fname)

    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)
Exemplo n.º 5
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
    Examples for the NURBS-Python Package
    Released under MIT License
    Developed by Onur Rauf Bingol (c) 2018

    Exporting a NURBS surface as .off file
"""

from geomdl.shapes import surface
from geomdl import exchange

cylinder = surface.cylinder(radius=5.0, height=22.5)
cylinder.delta = 0.01

# Export the surface as a .off file
exchange.export_off(cylinder, "cylindrical_surface.off")

# Good to have something here to put a breakpoint
pass