Пример #1
0
    def getDaoOffsetWire(self, offset):

        classicWire = self.getCached('getDaoClassicWire')

        tool = BRepOffsetAPI_MakeOffset()
        tool.AddWire(classicWire)
        tool.Perform(-offset)
        offsetWire = tool.Shape()

        return offsetWire
Пример #2
0
def create_offsets(face, nr_of_counters, distance_between_contours):
    offset = BRepOffsetAPI_MakeOffset()
    offset.Init(GeomAbs_Arc)

    for wi in TopologyExplorer(face).wires():
        offset.AddWire(wi)

    for i in range(nr_of_counters):
        offset.Perform(-distance_between_contours * i)
        if offset.IsDone():
            yield offset.Shape()
Пример #3
0
def make_offsets(face, num, distance):
    offset = BRepOffsetAPI_MakeOffset(face, GeomAbs_Arc, False)
    # add all wires to offset algo
    for w in TopologyExplorer(face).wires():
        offset.AddWire(w)
    result = []
    # perform offsets
    for i in range(num):
        offset.Perform(-1 * distance * i)
        if offset.IsDone():
            # display.DisplayShape(offset.Shape(), update=True)
            result.append(offset.Shape())

    return result
Пример #4
0
def makeOffsetWire(aWire, offset):
    tool = BRepOffsetAPI_MakeOffset()
    tool.AddWire(aWire)
    tool.Perform(offset)
    aOffsetWire = tool.Shape()
    return aOffsetWire
Пример #5
0
def getShapeOffset(shape, offset):
    tool = BRepOffsetAPI_MakeOffset()
    tool.AddWire(shape)
    tool.Perform(offset)
    shape = tool.Shape()
    return shape