示例#1
0
文件: brep.py 项目: ylwb/declaracad
def load_brep(filename):
    """ Load a brep model """
    shape = TopoDS_Shape()
    builder = BRep_Builder()
    BRepTools.Read_(shape, filename, builder, None)
    # TODO: Load colors
    return [TopoShape(shape=shape)]
示例#2
0
    def read_brep(fn):
        """
        Read a BREP file and return as a single shape.

        :param str fn: Filename.

        :return: The shape.
        :rtype: OCCT.TopoDS.TopoDS_Shape
        """
        shape = TopoDS_Shape()
        builder = BRep_Builder()
        BRepTools.Read_(shape, fn, builder)
        return shape
示例#3
0
def read_brep(fn):
    """
    Read a BREP file and return the shape.

    :param str fn: The filename.

    :return: The shape.
    :rtype: afem.topology.entities.Shape
    """
    shape = TopoDS_Shape()
    builder = BRep_Builder()
    BRepTools.Read_(shape, fn, builder)

    return Shape.wrap(shape)
示例#4
0
 def load_brep(self, path):
     """ Load a brep model """
     shape = TopoDS_Shape()
     builder = BRep_Builder()
     BRepTools.Read_(shape, path, builder, None)
     return [TopoShape(shape=shape)]