コード例 #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
ファイル: brep.py プロジェクト: gitter-badger/AFEM
def write_brep(shape, fn):
    """
    Write a BREP file using the shape.

    :param afem.topology.entities.Shape shape: The shape.
    :param str fn: The filename.

    :return: None.
    """
    BRepTools.Write_(shape.object, fn)
コード例 #3
0
    def outer_wire(face):
        """
        Get outer wire of face.

        :param OCCT.TopoDS.TopoDS_Face face: The face.

        :return: Outer wire.
        :rtype: OCCT.TopoDS.TopoDS_Wire
        """
        return BRepTools.OuterWire_(face)
コード例 #4
0
    def write_brep(shape, fn):
        """
        Write a BREP file using the shape.

        :param OCCT.TopoDS.TopoDS_Shape shape: The shape to export.
        :param str fn: Filename.

        :return: ``True`` if successful, ``False`` otherwise.
        :rtype: bool
        """
        return BRepTools.Write_(shape, fn)
コード例 #5
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
コード例 #6
0
ファイル: brep.py プロジェクト: gitter-badger/AFEM
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)
コード例 #7
0
ファイル: entities.py プロジェクト: trelau/AFEM
 def outer_wire(self):
     """
     :return: The outer wire of the face.
     :rtype: afem.topology.entities.Wire
     """
     return Wire(BRepTools.OuterWire_(self.object))
コード例 #8
0
ファイル: occ_part.py プロジェクト: hixio-mh/declaracad
 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)]