示例#1
0
    def final_example(self):
        from hotwing_core import Profile
        from hotwing_core import Rib
        from hotwing_core import Machine
        from hotwing_core import Panel
        from hotwing_core import Coordinate

        ## Setup Rib
        r1 = Rib(
            "http://airfoiltools.com/airfoil/seligdatfile?airfoil=s6063-il",
            scale=10,
            xy_offset=None,
            top_sheet=0.0625,
            bottom_sheet=0.0625,
            front_stock=0.5,
            tail_stock=1.25)
        r2 = Rib(
            "http://airfoiltools.com/airfoil/seligdatfile?airfoil=rg14-il",
            scale=10,
            xy_offset=Coordinate(0, 0),
            top_sheet=0.0625,
            bottom_sheet=0.0625,
            front_stock=0.5,
            tail_stock=1.25)
        # Setup Panel
        p = Panel(r1, r2, 24)
        # Trim Panel
        p1 = Panel.trim(p, 0, 12)
        # Setup Machine
        m = Machine(24, kerf=0.075, profile_points=200)
        # Load panel into machine
        m.load_panel(panel=p1, left_offset=6)
        # Generate GCode
        gcode = m.generate_gcode(safe_height=5)
示例#2
0
    def test_create_machine(self):
        from hotwing_core import Coordinate
        from hotwing_core import Profile
        from hotwing_core import Rib
        from hotwing_core import Panel

        ## Create Root Rib
        r1 = Rib(
            "http://airfoiltools.com/airfoil/seligdatfile?airfoil=s6063-il",
            scale=10,
            xy_offset=None,
            top_sheet=0.0625,
            bottom_sheet=0.0625,
            front_stock=0.5,
            tail_stock=1.25)

        ## Create Tip Rib
        r2 = Rib(
            "http://airfoiltools.com/airfoil/seligdatfile?airfoil=rg14-il",
            scale=10,
            xy_offset=Coordinate(0, 0),
            top_sheet=0.0625,
            bottom_sheet=0.0625,
            front_stock=0.5,
            tail_stock=1.25)

        # Setup Panel - takes the two ribs, at a specified distance of 24 units (inches or centimeters)
        p = Panel(r1, r2, 24)

        # A Panel can be trimmed.  Say for example, the machine you will be using to cut your wing will
        # only cut wings up to 12 units.  We can use the Panel.trim classmethod to create a new,
        # Panel.  The trim will handle the interpolation and creation of a new Rib and Panel.
        p1 = Panel.trim(
            p, 0, 12
        )  # cut at 0 (no cut will occur) and at 12 - new panel is 12 units long.
        p2 = Panel.trim(
            p, 12, 24
        )  # cut at 12 and at 24 (no cut will occur) - new panel is 12 units long.
        from hotwing_core import Machine
        # Setup Machine
        m = Machine(
            24,  # Width between pillars of machine
            kerf=0.075,  # Allowance for wire size and melted foam
            profile_points=
            200,  # number of points to use for each surface when iterpolating
        )

        # Load panel into machine (p1 is the panel created in the previous step)
        # The offset is the distance the left of the panel will be from the left of the machine --
        #     If you want it centered, for this example use an offset of 6 --
        #        (24-12[machine width-panel width]) -> 12/2(equal amount on each side)
        m.load_panel(panel=p1, left_offset=6)

        # Generate GCode
        # safe_height is where the machine can move without hitting anything
        gcode = m.generate_gcode(safe_height=5)
    def test_cutting_strategies(self):
        from hotwing_core import Profile
        from hotwing_core import Rib
        from hotwing_core import Machine
        from hotwing_core import Panel
        from hotwing_core import Coordinate

        ## Setup Rib
        r1 = Rib("http://m-selig.ae.illinois.edu/ads/coord/ah83159.dat",
                 scale=10,
                 xy_offset=None,
                 top_sheet=0.0625,
                 bottom_sheet=0.0625,
                 front_stock=0.5,
                 tail_stock=1.25 )
                 
        r2 = Rib("http://m-selig.ae.illinois.edu/ads/coord/rg14.dat",
                 scale=10,
                 xy_offset=Coordinate(0, 0),
                 top_sheet=0.0625,
                 bottom_sheet=0.0625,
                 front_stock=0.5,
                 tail_stock=1.25 )

        # Setup Panel
        p = Panel(r1, r2, 24)

        cutting_strategy_names=["CuttingStrategy1","CuttingStrategy2"]

        for csn in cutting_strategy_names:
            # Setup Machine
            m = Machine(24, kerf=0.075, units="inches", cutting_strategy_name=csn, profile_points=300)
            # Load panel into machine
            m.load_panel(p)
            # Generate GCode
            gcode = m.generate_gcode(safe_height=3)

        # test default
        m = Machine(24, kerf=0.075, units="inches", cutting_strategy_name="default", profile_points=300)
        # Load panel into machine
        m.load_panel(p)
        # Generate GCode
        gcode = m.generate_gcode(safe_height=3)

        # test invalid
        m = Machine(24, kerf=0.075, units="inches", cutting_strategy_name="bad name", profile_points=300)
        # Load panel into machine
        m.load_panel(p)
        # Generate GCode
        gcode = m.generate_gcode(safe_height=3)
示例#4
0
    def test_create_rib(self):
        from hotwing_core import Rib
        ## Create Rib
        r1 = Rib(
            "http://m-selig.ae.illinois.edu/ads/coord/e374.dat",  # Dat file to use -  File or URL
            scale=10,  # Width of the Rib - Scales the dat file profile
            xy_offset=None,  # Offset 
            top_sheet=
            0.0625,  # Sheeting allowance top - this will make the foil smaller by this 
            #     amount
            bottom_sheet=0.0625,  # Sheeting allowance bottom
            front_stock=
            0.5,  # Trims the front of the airfoil by this amount.  You would glue 
            #     wooden stock here and shape it
            tail_stock=
            1.25,  # Trims the trailing edge of the foil.  You would put tail stock 
            #     here and shape to the foil.
            rotation=
            0,  # The angle to rotate the rib in degrees - positive number points 
            #     the nose upward
            rotation_pos=0.5
        )  # Where the rotation point should occur.  0.25 = 25% along the
        #     chord (starting from the front)

        # you can get the manipulated profile
        r1.profile
        # you can get the manipulated profile (pre-sheeting)
        r1.airfoil_profile
    def test_gcode_formatters(self):
        from hotwing_core import Profile
        from hotwing_core import Rib
        from hotwing_core import Machine
        from hotwing_core import Panel
        from hotwing_core import Coordinate

        ## Setup Rib
        r1 = Rib("http://m-selig.ae.illinois.edu/ads/coord/ah83159.dat",
                 scale=10,
                 xy_offset=None,
                 top_sheet=0.0625,
                 bottom_sheet=0.0625,
                 front_stock=0.5,
                 tail_stock=1.25)

        r2 = Rib("http://m-selig.ae.illinois.edu/ads/coord/rg14.dat",
                 scale=10,
                 xy_offset=Coordinate(0, 0),
                 top_sheet=0.0625,
                 bottom_sheet=0.0625,
                 front_stock=0.5,
                 tail_stock=1.25)

        # Setup Panel
        p = Panel(r1, r2, 24)

        gcode_formatter_names = [
            "GenericGcodeFormatter", "DebugGcodeFormatter", "default"
        ]

        for gfn in gcode_formatter_names:
            # Setup Machine
            m = Machine(24,
                        kerf=0.075,
                        units="inches",
                        gcode_formatter_name=gfn,
                        profile_points=300)
            # Load panel into machine
            m.load_panel(p)
            # Generate GCode
            gcode = m.generate_gcode(safe_height=3)
示例#6
0
    def test_create_panel(self):
        from hotwing_core import Coordinate
        from hotwing_core import Profile
        from hotwing_core import Rib
        from hotwing_core import Panel

        ## Create Root Rib
        r1 = Rib(
            "http://airfoiltools.com/airfoil/seligdatfile?airfoil=s6063-il",
            scale=10,
            xy_offset=None,
            top_sheet=0.0625,
            bottom_sheet=0.0625,
            front_stock=0.5,
            tail_stock=1.25)

        ## Create Tip Rib
        r2 = Rib(
            "http://airfoiltools.com/airfoil/seligdatfile?airfoil=rg14-il",
            scale=10,
            xy_offset=Coordinate(0, 0),
            top_sheet=0.0625,
            bottom_sheet=0.0625,
            front_stock=0.5,
            tail_stock=1.25)

        # Setup Panel - takes the two ribs, at a specified distance of 24 units (inches or centimeters)
        p = Panel(r1, r2, 24)

        # A Panel can be trimmed.  Say for example, the machine you will be using to cut your wing will
        # only cut wings up to 12 units.  We can use the Panel.trim_panel classmethod to create a new,
        # Panel.  The trim_panel will handle the interpolation and creation of a new Rib and Panel.
        p1 = Panel.trim(
            p, 0, 12
        )  # cut at 0 (no cut will occur) and at 12 - new panel is 12 units long.
        p2 = Panel.trim(
            p, 12, 24
        )  # cut at 12 and at 24 (no cut will occur) - new panel is 12 units long.
示例#7
0
from hotwing_core import Profile
from hotwing_core import Rib
from hotwing_core import Machine
from hotwing_core import Panel
from hotwing_core import Coordinate

## Setup Rib
r1 = Rib("http://m-selig.ae.illinois.edu/ads/coord/ah83159.dat",
         scale=10,
         xy_offset=None,
         top_sheet=0.0625,
         bottom_sheet=0.0625,
         front_stock=0.5,
         tail_stock=1.25)

r2 = Rib("http://m-selig.ae.illinois.edu/ads/coord/rg14.dat",
         scale=10,
         xy_offset=Coordinate(0, 0),
         top_sheet=0.0625,
         bottom_sheet=0.0625,
         front_stock=0.5,
         tail_stock=1.25)

# Setup Panel
p = Panel(r1, r2, 24)

# Trim Panel
p = Panel.trim(p, 0, 12)

# Setup Machine
m = Machine(24, kerf=0.075, units="inches", profile_points=300)