Beispiel #1
0
def iges_144_000():
    import pyiges.IGESGeomLib as IGES
    from pyiges.IGESCore import IGEStorage
    from pyiges.IGESGeomLib import IGESPoint

    filename = "144-000-example-1.igs"

    system = IGEStorage()
    examples.benchmarks.standard_iges_setup(system, filename)

    # Circular flat surface profile
    circular_flat_surface_profile = IGES.IGESGeomCircle(
        IGESPoint(0, 0, 0), IGESPoint(10, 10, 0))
    system.Commit(circular_flat_surface_profile)

    # Make the surface from out outer profile, this is to be trimmed
    circular_flat_surface = IGES.IGESGeomPlane(circular_flat_surface_profile)
    system.Commit(circular_flat_surface)

    # We're going to put a bunch of holes into the surface
    hole = []  # Hole profiles
    hole_copse = []  # Curve on Parametric Surface entries (required!)

    for i in range(0, 6):
        hole.append(
            IGES.IGESGeomCircle(IGESPoint(-5 + i * 3, 0, 0),
                                IGESPoint(-5 + i * 3, 1, 0)))
        system.Commit(hole[-1])

        # Make those tubes, given we are not using them as a reference,
        # Lets directly add them to the system.
        system.Commit(IGES.IGESExtrude(hole[-1], IGESPoint(0, 0, i + 1)))
        system.Commit(IGES.IGESExtrude(hole[-1], IGESPoint(0, 0, -i - 1)))

        hole_copse.append(
            IGES.IGESCurveOnParametricSurface(circular_flat_surface, hole[-1],
                                              hole[-1], 1))
        system.Commit(hole_copse[-1])

    # Setup the surface we are to put holes into, we're using the whole surface,
    #   as indicated by the 0 in the outer profile parameter
    trimmed_surface = IGES.IGESTrimmedParaSurface(circular_flat_surface, 0)
    trimmed_surface.N1 = 0

    # Lets put those holes in!
    for _hole in hole_copse:
        trimmed_surface.add_bounding_profile(_hole)

    system.Commit(trimmed_surface)

    system.save(filename)

    if not os.environ.get('READTHEDOCS', None):
        print(system)
        os.startfile(filename)
Beispiel #2
0
def iges_144_000():
    import pyiges.IGESGeomLib as IGES
    from pyiges.IGESGeomLib import IGESPoint
    from pyiges.IGESCore import IGEStorage

    system = IGEStorage()
    examples.benchmarks.standard_iges_setup(system, "144-000-benchmark.igs")

    para_spline_surface = IGES.IGESTestSplineSurf()
    system.Commit(para_spline_surface)

    circle = IGES.IGESGeomCircle(IGESPoint(6, 7.25, 0), IGESPoint(6.25, 7.25))
    system.Commit(circle)

    para_spline_curve = IGES.IGESTestSplineCurve()
    system.Commit(para_spline_curve)

    curve_on_parametric_surface = IGES.IGESCurveOnParametricSurface(
        para_spline_surface, circle, para_spline_curve, 2)
    system.Commit(curve_on_parametric_surface)

    trimmed_parametric_surface = IGES.IGESTrimmedParaSurface(
        para_spline_surface, curve_on_parametric_surface)
    system.Commit(trimmed_parametric_surface)

    system.save("144-000-benchmark.igs")

    if not os.environ.get('READTHEDOCS', None):
        print(system)
        os.startfile("144-000-benchmark.igs")
Beispiel #3
0
def testrun_arc_circle(filename="IGESFile_arc_circle.igs"):
    """draw an arc and a circle, both in a plane paralell to the X-Y-plane"""
    system = IGEStorage()
    system.StartSection.Prolog = " "
    system.GlobalSection.IntegerBits = int(32)
    system.GlobalSection.SPMagnitude = int(38)
    system.GlobalSection.SPSignificance = int(6)
    system.GlobalSection.DPMagnitude = int(38)
    system.GlobalSection.DPSignificance = int(15)
    system.GlobalSection.MaxNumberLineWeightGrads = int(8)
    system.GlobalSection.WidthMaxLineWeightUnits = float(0.016)
    system.GlobalSection.MaxCoordValue = float(71)

    arc = IGES.IGESGeomArc(-3, IGESPoint(2, 5, 0), IGESPoint(-3, 0, 0), IGESPoint(2, 10, 0))
    system.Commit(arc)

    circ = IGES.IGESGeomCircle(IGESPoint(5, 5, 5), 5)
    system.Commit(circ)

    system.save(filename)