Exemplo n.º 1
0
def iges_414_000():
    import pyiges.IGESGeomLib as IGES
    from pyiges.IGESCore import IGEStorage
    from pyiges.IGESGeomLib import IGESPoint

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

    line_1 = IGES.IGESGeomLine(IGESPoint(-0.13, 0, 0), IGESPoint(0, 0.25, 0))

    line_2 = IGES.IGESGeomLine(IGESPoint(0, 0.25, 0), IGESPoint(0.13, 0, 0))

    line_3 = IGES.IGESGeomLine(IGESPoint(0, 0.25, 0), IGESPoint(0, 0.44, 0))

    line_4 = IGES.IGESGeomLine(IGESPoint(0, 0.38, 0), IGESPoint(0.09, 0.28, 0))

    line_5 = IGES.IGESGeomLine(IGESPoint(0, 0.38, 0),
                               IGESPoint(-0.09, 0.28, 0))

    circle_1 = IGES.IGESGeomArc(0, IGESPoint(0, 0.5), IGESPoint(0.06, 0.5),
                                IGESPoint(0.06, 0.5))

    system.Commit(line_1)
    system.Commit(line_2)
    system.Commit(line_3)
    system.Commit(line_4)
    system.Commit(line_5)
    system.Commit(circle_1)

    person_group = IGES.IGESGroup("PERSON", line_1, line_2, line_3, line_4,
                                  line_5, circle_1)

    system.Commit(person_group)

    person_array = IGES.IGESCircularArray(person_group, 3,
                                          IGESPoint(5.5, 1.5, 0), 0.5, 0.52,
                                          2.09)

    system.Commit(person_array)

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

    if not os.environ.get('READTHEDOCS', None):
        print(system)
        os.startfile("414-000-benchmark.igs")
Exemplo n.º 2
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)
Exemplo n.º 3
0
def testrun_extrude_arc(filename="IGESFile_extrude_arc.igs"):
    """draw arc and extrude it to a target points"""
    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(0, IGESPoint(20, 11, 0), IGESPoint(20.25, 11, 0), IGESPoint(19.75, 11, 0))
    system.Commit(arc)

    ext = IGES.IGESExtrude(arc, IGESPoint(20.4857, 11.2357, -0.9428))
    system.Commit(ext)

    system.save(filename)
Exemplo n.º 4
0
system.GlobalSection.SPSignificance = 15
system.GlobalSection.DPMagnitude = 13
system.GlobalSection.DPSignificance = 15
system.GlobalSection.ProductIdentificationForReceiver = "122-000"
system.GlobalSection.ModelSpaceScale = 1.0
system.GlobalSection.Units.setInches()
system.GlobalSection.MaxNumberLineWeightGrads = 8
system.GlobalSection.WidthMaxLineWeightUnits = 0.016
system.GlobalSection.MaxUserResolution = 0.0001
system.GlobalSection.MaxCoordValue = 20.4857
system.GlobalSection.NameOfAuthor = "github.com"
system.GlobalSection.AuthorOrg = "pyIGES"
system.GlobalSection.VersionFlag = 11
system.GlobalSection.DraftStandardFlag = 3
system.GlobalSection.AppProtocol = "pyIGES"

arc = IGES.IGESGeomArc(0, IGES.IGESPoint(20, 11), IGES.IGESPoint(20.25, 11),
                       IGES.IGESPoint(19.75, 11))
arc.Color.setYellow()
arc.StatusNumber.Hierachy.setGlobalDefer()
arc.StatusNumber.EntityUseFlag.setGeometry()
arc.StatusNumber.Subordinate.setPhysicallyDependent()
arc.StatusNumber.Visablilty.setVisible()
system.Commit(arc)

extr = IGES.IGESExtrude(arc, IGES.IGESPoint(20.4857, 11.2357, -0.9428))
arc.Color.setYellow()
system.Commit(extr)

system.save(filename=filename)
Exemplo n.º 5
0
point.StatusNumber.Visablilty.setVisible()
system.Commit(point)

line = IGES.IGESGeomLine(IGES.IGESPoint(3.5, 15.0, 0.0),
                         IGES.IGESPoint(3.5, 15.5, 0.0))
line.LineFontPattern.setSolid()
line.LineWeightNum = 2
line.Color.setBlue()
line.StatusNumber.Hierachy.setGlobalDefer()
line.StatusNumber.EntityUseFlag.setGeometry()
line.StatusNumber.Subordinate.setPhysicallyDependent()
line.StatusNumber.Visablilty.setVisible()
system.Commit(line)

arc = IGES.IGESGeomArc(0.0, IGES.IGESPoint(0.0, 0.0, 0.0),
                       IGES.IGESPoint(0.0, 0.5, 0.0),
                       IGES.IGESPoint(-0.5, 0.0, 0.0))
arc.TransfrmMat = trans.DirectoryDataPointer.data
arc.LineFontPattern.setSolid()
arc.LineWeightNum = 2
arc.Color.setRed()
arc.StatusNumber.Hierachy.setGlobalDefer()
arc.StatusNumber.EntityUseFlag.setGeometry()
arc.StatusNumber.Subordinate.setPhysicallyDependent()
arc.StatusNumber.Visablilty.setVisible()
system.Commit(arc)

scurve = IGES.IGESSplineCurve(3, 1, 3)
scurve.addSegment(0.0, [
    4., 0.5625, 0., -0.0625, 15., -0.312501, 1.430510000000000E-006, 0.0624995,
    0., 0., 0., 0.