예제 #1
0
def build_curve_network(event=None):
    '''
    mimic the curve network surfacing command from rhino
    '''
    print 'Importing IGES file...',
    pth = os.path.dirname(os.path.abspath(__file__))
    pth = os.path.abspath(
        os.path.join(pth, '../data/IGES/curve_geom_plate.igs'))
    import ipdb
    ipdb.set_trace()
    iges = IGESImporter(pth)
    iges.read_file()
    print 'done.'
    # GetShapes returns 36 TopoDS_Shape, while the TopoDS_Compound contains
    # just the 6 curves I made in rhino... hmmm...
    print 'Building geomplate...',
    topo = Topo(iges.get_compound())
    edges_list = list(topo.edges())
    face = build_geom_plate(edges_list)
    print 'done.'

    print 'Cutting out of edges...',
    # Make a wire from outer edges
    _edges = [edges_list[2], edges_list[3], edges_list[4], edges_list[5]]
    outer_wire = make_wire(_edges)
예제 #2
0
def build_curve_network(event=None):
    '''
    mimic the curve network surfacing command from rhino
    '''
    print 'Importing IGES file...',
    pth = os.path.dirname(os.path.abspath(__file__))
    pth = os.path.abspath(os.path.join(pth, '../data/IGES/curve_geom_plate.igs'))
    import ipdb; ipdb.set_trace()
    iges = IGESImporter(pth)
    iges.read_file()
    print 'done.'
    # GetShapes returns 36 TopoDS_Shape, while the TopoDS_Compound contains
    # just the 6 curves I made in rhino... hmmm...
    print 'Building geomplate...',
    topo = Topo(iges.get_compound())
    edges_list = list(topo.edges())
    face = build_geom_plate(edges_list)
    print 'done.'
    
    print 'Cutting out of edges...',
    # Make a wire from outer edges
    _edges = [edges_list[2], edges_list[3], edges_list[4], edges_list[5]]
    outer_wire = make_wire(_edges)
예제 #3
0
def build_curve_network(event=None):
    '''
    mimic the curve network surfacing command from rhino
    '''
    print 'Importing IGES file...',
    pth = os.path.dirname(os.path.abspath(__file__))
    pth = os.path.abspath(os.path.join(pth, '../data/IGES/curve_geom_plate.igs'))
    iges = IGESImporter(pth)
    iges.read_file()
    print 'done.'

    print 'Building geomplate...',
    topo = Topo(iges.get_compound())
    edges_list = list(topo.edges())
    face = build_geom_plate(edges_list)
    print 'done.'
    display.EraseAll()
    display.DisplayShape(edges_list)
    display.DisplayShape(face)
    display.FitAll()
    print 'Cutting out of edges...',
    # Make a wire from outer edges
    _edges = [edges_list[2], edges_list[3], edges_list[4], edges_list[5]]
    outer_wire = make_wire(_edges)
예제 #4
0
def build_curve_network(event=None):
    '''
    mimic the curve network surfacing command from rhino
    '''
    print 'Importing IGES file...',
    pth = os.path.dirname(os.path.abspath(__file__))
    pth = os.path.abspath(os.path.join(pth, '../data/IGES/curve_geom_plate.igs'))
    iges = IGESImporter(pth)
    iges.read_file()
    print 'done.'
    
    print 'Building geomplate...',
    topo = Topo(iges.get_compound())
    edges_list = list(topo.edges())
    face = build_geom_plate(edges_list)
    print 'done.'
    display.EraseAll()
    display.DisplayShape(edges_list)
    display.DisplayShape(face)
    display.FitAll()
    print 'Cutting out of edges...',
    # Make a wire from outer edges
    _edges = [edges_list[2], edges_list[3], edges_list[4], edges_list[5]]
    outer_wire = make_wire(_edges)
예제 #5
0
##Copyright 2009-2011 Thomas Paviot ([email protected])
##
##This file is part of pythonOCC.
##
##pythonOCC is free software: you can redistribute it and/or modify
##it under the terms of the GNU Lesser General Public License as published by
##the Free Software Foundation, either version 3 of the License, or
##(at your option) any later version.
##
##pythonOCC is distributed in the hope that it will be useful,
##but WITHOUT ANY WARRANTY; without even the implied warranty of
##MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##GNU Lesser General Public License for more details.
##
##You should have received a copy of the GNU Lesser General Public License
##along with pythonOCC.  If not, see <http://www.gnu.org/licenses/>.

from OCC.DataExchange.IGES import IGESImporter
from OCC.Display.SimpleGui import *
display, start_display, add_menu, add_function_to_menu = init_display()

my_iges_importer = IGESImporter("../data/IGES/splines.igs")
my_iges_importer.read_file()
the_shapes = my_iges_importer.get_shapes()

display.DisplayShape(the_shapes, update=True)
start_display()
예제 #6
0
##Copyright 2009-2011 Thomas Paviot ([email protected])
##
##This file is part of pythonOCC.
##
##pythonOCC is free software: you can redistribute it and/or modify
##it under the terms of the GNU Lesser General Public License as published by
##the Free Software Foundation, either version 3 of the License, or
##(at your option) any later version.
##
##pythonOCC is distributed in the hope that it will be useful,
##but WITHOUT ANY WARRANTY; without even the implied warranty of
##MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##GNU Lesser General Public License for more details.
##
##You should have received a copy of the GNU Lesser General Public License
##along with pythonOCC.  If not, see <http://www.gnu.org/licenses/>.

from OCC.DataExchange.IGES import IGESImporter
from OCC.Display.SimpleGui import *

display, start_display, add_menu, add_function_to_menu = init_display()

my_iges_importer = IGESImporter("../data/IGES/splines.igs")
my_iges_importer.read_file()
the_shapes = my_iges_importer.get_shapes()

display.DisplayShape(the_shapes, update=True)
start_display()
예제 #7
0
##Copyright 2009-2011 Thomas Paviot ([email protected])
##
##This file is part of pythonOCC.
##
##pythonOCC is free software: you can redistribute it and/or modify
##it under the terms of the GNU Lesser General Public License as published by
##the Free Software Foundation, either version 3 of the License, or
##(at your option) any later version.
##
##pythonOCC is distributed in the hope that it will be useful,
##but WITHOUT ANY WARRANTY; without even the implied warranty of
##MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##GNU Lesser General Public License for more details.
##
##You should have received a copy of the GNU Lesser General Public License
##along with pythonOCC.  If not, see <http://www.gnu.org/licenses/>.

from OCC.DataExchange.IGES import IGESImporter
from OCC.Display.SimpleGui import *
display, start_display, add_menu, add_function_to_menu = init_display()

my_iges_importer = IGESImporter("../data/IGES/splines.igs")
my_iges_importer.read_file()

the_compound = my_iges_importer.get_compound()

display.DisplayShape(the_compound, update=True)
start_display()