예제 #1
0
    def __init__(self, whichType, position = None, velocity = None, acceleration = None, flipped = False, projectile = False):
        """
        Creates a basic Entity of a specific type.
        """
        Object.__init__(self, whichType, position, flipped = flipped)
        Entity.Entities.append(self)
        Object.Objects.pop(-1)
        
        #Collision
        self.collideState = None
        self.collidingLeft,self.collidingRight,self.collidingTop,self.collidingBottom = [False] * 4

        #Physics
        self.acceleration = acceleration
        if acceleration == None:
            self.acceleration = Vector()
        self.velocity = velocity
        if velocity == None:
            self.velocity = Vector()
        
        self.wallSliding = False
        self.slidingSide = None

        self.projectile = projectile
        self.destroy = False
예제 #2
0
    def __init__(self,
                 whichType,
                 position=[0, 0],
                 velocity=[0, 0],
                 acceleration=[0, 0],
                 flipped=False,
                 projectile=False):
        """
        Creates a basic Entity of a specific type.
        """
        Object.__init__(self, whichType, position, flipped=flipped)
        Entity.Entities.append(self)
        Object.Objects.pop(-1)

        #Collision
        self.collideState = None
        self.collidingLeft, self.collidingRight, self.collidingTop, self.collidingBottom = [
            False
        ] * 4

        #Physics
        self.acceleration = acceleration
        self.velocity = velocity

        self.wallSliding = False
        self.slidingSide = None

        self.projectile = projectile
        self.destroy = False
예제 #3
0
    def __init__(self, path=None):
        self._startTime = time.time()

        global globalAppServer
        assert globalAppServer is None, 'more than one app server; or __init__() invoked more than once'
        globalAppServer = self

        ConfigurableForServerSidePath.__init__(self)
        Object.__init__(self)
        if path is None:
            path = os.path.dirname(__file__)  #os.getcwd()
        self._serverSidePath = os.path.abspath(path)
        self._webKitPath = os.path.abspath(os.path.dirname(__file__))
        self._webwarePath = os.path.dirname(self._webKitPath)

        self._verbose = self.setting('Verbose')
        self._plugIns = []
        self._reqCount = 0

        self.checkForInstall()
        self.config()  # cache the config
        self.printStartUpMessage()
        sys.setcheckinterval(self.setting('CheckInterval'))
        self._app = self.createApplication()
        self.loadPlugIns()

        self.running = 1

        if self.isPersistent():
            self._closeEvent = Event()
            self._closeThread = Thread(target=self.closeThread)
            ##			self._closeThread.setDaemon(1)
            self._closeThread.start()
예제 #4
0
파일: Program.py 프로젝트: cyplo/heekscnc
    def __init__(self):
        Object.__init__(self)
        config = CNCConfig()
        self.units = config.ReadFloat("ProgramUnits", 1.0)  # set to 25.4 for inches
        self.alternative_machines_file = config.Read("ProgramAlternativeMachinesFile", "")
        self.raw_material = RawMaterial()  # // for material hardness - to determine feeds and speeds.
        machine_name = config.Read("ProgramMachine", "emc2b")
        self.machine = self.GetMachine(machine_name)
        import wx

        default_output_file = (wx.StandardPaths.Get().GetTempDir() + "/test.tap").replace("\\", "/")
        self.output_file = config.Read(
            "ProgramOutputFile", default_output_file
        )  #  // NOTE: Only relevant if the filename does NOT follow the data file's name.
        self.output_file_name_follows_data_file_name = config.ReadBool(
            "OutputFileNameFollowsDataFileName", True
        )  #    // Just change the extension to determine the NC file name
        self.python_program = ""
        self.path_control_mode = config.ReadInt("ProgramPathControlMode", PATH_CONTROL_UNDEFINED)
        self.motion_blending_tolerance = config.ReadFloat(
            "ProgramMotionBlendingTolerance", 0.0
        )  # Only valid if m_path_control_mode == eBestPossibleSpeed
        self.naive_cam_tolerance = config.ReadFloat(
            "ProgramNaiveCamTolerance", 0.0
        )  # Only valid if m_path_control_mode == eBestPossibleSpeed
예제 #5
0
	def __init__(self, codigo, nombre, info, duracion):

		Object.__init__(self)
		self.codigo 	= codigo
		self.nombre 	= nombre
		self.duracion 	= duracion
		self.info 		= info
예제 #6
0
    def __init__(self):

        Object.__init__(self)

        self.Temas = Temas("Todos")
        self.TemasSeleccion = Temas("Seleccion")
        self.Ubicaciones = Ubicaciones()
        self.Distancias = Distancias()
        self.Combinaciones = Combinaciones()
        self.Hitos = Hitos(self.Distancias)
        self.observers = []
        self.HoraDesdeFiltro = ""
        self.HoraHastaFiltro = ""
        self.algoritmos = [
            ("MT0-Todas las combinaciones", "generarCombinaciones_MT0", True),
            ("MT1-Randomización de hitos", "generarCombinaciones_MT1", True),
            ("MT2-Hitos ordenados por fecha", "generarCombinaciones_MT2",
             True),
            ("MT3-Orden por combinabilidad (desc)", "generarCombinaciones_MT3",
             True),
            ("MT4-Orden por combinabilidad (asc)", "generarCombinaciones_MT4",
             True),
            ("MT5-Orden por combinabilidad de temas (desc)",
             "generarCombinaciones_MT5", True)
        ]
        self.algoritmoDefault = "MT3-Orden por combinabilidad (desc)"

        self.__load_data()
예제 #7
0
 def __init__(self, x=0, y=0, hp=100, textures=textures, w=w, h=h):
     Object.__init__(self, x, y, textures[0], w, h)
     self.texLeftRight = image.load(textures[0]).convert()
     self.texUpDown = image.load(textures[1]).convert()
     self.hp = hp
     self.speed = 2
     self.mSpeed = 10
예제 #8
0
 def __init__(self):
     Object.__init__(self)
     config = CNCConfig()
     self.units = config.ReadFloat("ProgramUnits",
                                   1.0)  # set to 25.4 for inches
     self.alternative_machines_file = config.Read(
         "ProgramAlternativeMachinesFile", "")
     self.raw_material = RawMaterial(
     )  #// for material hardness - to determine feeds and speeds.
     machine_name = config.Read("ProgramMachine", "emc2b")
     self.machine = self.GetMachine(machine_name)
     import wx
     default_output_file = (wx.StandardPaths.Get().GetTempDir() +
                            "/test.tap").replace('\\', '/')
     self.output_file = config.Read(
         "ProgramOutputFile", default_output_file
     )  #  // NOTE: Only relevant if the filename does NOT follow the data file's name.
     self.output_file_name_follows_data_file_name = config.ReadBool(
         "OutputFileNameFollowsDataFileName", True
     )  #    // Just change the extension to determine the NC file name
     self.python_program = ""
     self.path_control_mode = config.ReadInt("ProgramPathControlMode",
                                             PATH_CONTROL_UNDEFINED)
     self.motion_blending_tolerance = config.ReadFloat(
         "ProgramMotionBlendingTolerance",
         0.0)  # Only valid if m_path_control_mode == eBestPossibleSpeed
     self.naive_cam_tolerance = config.ReadFloat(
         "ProgramNaiveCamTolerance",
         0.0)  # Only valid if m_path_control_mode == eBestPossibleSpeed
예제 #9
0
    def __init__(self, origen, destino, distancia):

        Object.__init__(self)

        self.origen = origen
        self.destino = destino
        self.distancia = distancia
예제 #10
0
    def __init__(self, distancias, horadesde="", horahasta=""):

        Object.__init__(self)
        self._items = []
        self.position = -1
        self.distancias = distancias
        self.horadesde = horadesde
        self.horahasta = horahasta
예제 #11
0
    def __init__(self, name = '' ):
        Object.__init__( self, name )
        
        # Electrical Stuff
        self.port_dict   = {}
        self.net_dict    = {}
        self.inst_dict   = {}
        self.param_dict  = {}

        self.port_name_list = []
예제 #12
0
    def __init__(self, name=''):
        Object.__init__(self, name)

        # Electrical Stuff
        self.port_dict = {}
        self.net_dict = {}
        self.inst_dict = {}
        self.param_dict = {}

        self.port_name_list = []
예제 #13
0
    def __init__(self, distancias, horadesde="", horahasta=""):

        Object.__init__(self)
        self.hitos = Hitos(distancias, horadesde, horahasta)
        self.horadesde = horadesde
        self.horahasta = horahasta
        self.descripcion = ""
        self.distancias = distancias
        self.numero = Combinacion.numero

        Combinacion.numero = Combinacion.numero + 1
예제 #14
0
파일: Gear.py 프로젝트: danheeks/PyCAD
 def __init__(self, mod=1.0, num_teeth=12):
     Object.__init__(self, 0)
     self.tm = geom.Matrix()
     self.numTeeth = num_teeth
     self.module = mod
     self.addendumOffset = 0.0
     self.addendumMultiplier = 1.0
     self.dedendumMultiplier = 1.0
     self.pressureAngle = 0.34906585039886  # 20 degrees
     self.tipRelief = 0.05
     self.color = cad.Color(128, 128, 128)
예제 #15
0
파일: HImage.py 프로젝트: danheeks/PyCAD
 def __init__(self, filepath=None):
     Object.__init__(self, 0)
     self.filepath = filepath
     self.texture_number = None
     self.width = None
     self.height = None
     self.textureWidth = None
     self.textureHeight = None
     self.bottom_left = None
     self.bottom_right = None
     self.top_right = None
     self.top_left = None
     self.opacity = 1.0
예제 #16
0
    def __init__(self, name = '', module_ref_name = '' ):

        Object.__init__( self, name ) 

        # Electrical Stuff
        self.module_ref_name = module_ref_name # String
        self.module_ref = None # vv.Module Instance
        self.port_dict  = {}
        self.param_dict = {}

        # Derived Electrical Stuff
        self.num_inputs  = 0
        self.num_outputs = 0
예제 #17
0
	def __init__(self, path=None):
		"""Sets up and starts the `AppServer`.

		`path` is the working directory for the AppServer
		(directory in which AppServer is contained, by default)

		This method loads plugins, creates the Application object,
		and starts the request handling loop.

		"""
		self._running = 0
		self._startTime = time.time()

		global globalAppServer
		if globalAppServer:
			raise ProcessRunning('More than one AppServer'
				' or __init__() invoked more than once.')
		globalAppServer = self

		# Set up the import manager:
		self._imp = ImportManager()

		ConfigurableForServerSidePath.__init__(self)
		Object.__init__(self)
		if path is None:
			path = os.path.dirname(__file__) # os.getcwd()
		self._serverSidePath = os.path.abspath(path)
		self._webKitPath = os.path.abspath(os.path.dirname(__file__))
		self._webwarePath = os.path.dirname(self._webKitPath)

		self.recordPID()

		self._verbose = self.setting('Verbose')
		self._plugIns = []
		self._requestID = 0

		self.checkForInstall()
		self.config() # cache the config
		self.printStartUpMessage()
		sys.setcheckinterval(self.setting('CheckInterval'))
		self._app = self.createApplication()
		self.loadPlugIns()

		# @@ 2003-03 ib: shouldn't this just be in a subclass's __init__?
		if self.isPersistent():
			self._closeEvent = Event()
			self._closeThread = Thread(target=self.closeThread,
				name="CloseThread")
			# self._closeThread.setDaemon(1)
			self._closeThread.start()
		self._running = 1
예제 #18
0
파일: wing.py 프로젝트: danheeks/IbusOrni
    def __init__(self):
        Object.__init__(self)
        self.SetUsesGLList(True)

        # properties
        self.sketch_ids = [0, 0, 0, 0, 0]
        self.values = {
            'mirror': False,
            'centre_straight': True,
        }
        self.color = cad.Color(128, 128, 128)

        self.box = None  # if box is None, then the curves need reloading
        self.ResetCurves()
예제 #19
0
    def __init__(self):
        Object.__init__(self)
        self.layer = 75
        self.name = "Creature"

        self.__seeInvisibleAbility = False
        self.__handItem = None
        self.__clothes = {}

        self.AddComponent("Control")
        self.control = self.GetComponent("Control")
        self.DefineUI(self.control.ui)

        self.AddVerb("drop", lambda player: self.Drop())
예제 #20
0
    def __init__(self, warehouse, uid, action_topic, cmd_vel_topic, scan_topic, odom_topic, amcl_topic, vision_topic, tf_prefix, robot_description):
        Agent.__init__(self, warehouse, uid, action_topic)
        Object.__init__(self, uid, shapely.geometry.Point(tuple(robot_description['pos'])), shapely.geometry.Polygon([tuple(v) for v in robot_description['footprint']]))
        Vessel.__init__(self, uid)
        self.orientation = 0 #radian
        rospy.Subscriber(cmd_vel_topic, geometry_msgs.msg.Twist, self.cmd_vel_handler)

        self.robot_description = robot_description
        
        if scan_topic:
            self.scan_pub = rospy.Publisher(scan_topic, sensor_msgs.msg.LaserScan)
            self.scan_data = sensor_msgs.msg.LaserScan()
            self.scan_data.header.frame_id = tf_prefix + '/base_link'
            self.scan_data.angle_min = self.robot_description['laser_angle_min']
            self.scan_data.angle_max = self.robot_description['laser_angle_max']
            self.scan_data.angle_increment = self.robot_description['laser_angle_increment']
            self.scan_data.range_min = self.robot_description['laser_range_min']
            self.scan_data.range_max = self.robot_description['laser_range_max']
        else:
            self.scan_pub = None
        if odom_topic:
            self.odom_pub = rospy.Publisher(odom_topic, nav_msgs.msg.Odometry)
            self.odom_broadcaster = tf.TransformBroadcaster()
            self.odom_data = nav_msgs.msg.Odometry()
            self.odom_data.header.frame_id = tf_prefix + '/odom'
            self.odom_data.child_frame_id = tf_prefix + '/base_link'
            self.init_pos = self.pos
            self.init_orientation = self.orientation
            self.init_time = rospy.Time.now()
        else:
            self.odom_pub = None
        if amcl_topic:
            self.amcl_pub = rospy.Publisher(amcl_topic, geometry_msgs.msg.PoseWithCovarianceStamped)
            self.amcl_data = geometry_msgs.msg.PoseWithCovarianceStamped()
            self.amcl_data.header.frame_id = '/map'
        else:
            self.amcl_pub = None
        self.vision_pub = rospy.Publisher(vision_topic, warehouse_simulator.msg.AbstractVision)
        
        for command in self.robot_description['actions'].keys():
            self.add_command(command)
        self.add_command('vel')
        
        self.battery = Battery(self.robot_description['battery_max_quantity'], self.robot_description['battery_max_quantity'], self.robot_description['battery_recharge_rate'])
        self.vel = geometry_msgs.msg.Twist()
        self.vel_odom = geometry_msgs.msg.Twist()
        self.vel_target = geometry_msgs.msg.Twist()
        
        self.broken = False
예제 #21
0
파일: Net.py 프로젝트: Harnesser/wxDebuggy
    def __init__(self,
                 name ='',
                 nettype = 'wire',
                 msb = 0,
                 lsb = 0
                 ):
        
        Object.__init__( self, name )
        
        self.nettype = nettype
        self.msb = msb
        self.lsb = lsb
        self.size = 0
        self.sigtype = 'normal' # or 'clock' or 'reset' - should be an enumneration
        self.module_ref  = None

        self.Calc_Size()
예제 #22
0
    def __init__(self,
                 tema,
                 ubicacion,
                 inicio,
                 fechahora,
                 fecha=None,
                 hora=None):

        Object.__init__(self)
        self.nro = 0
        self.tema = tema
        self.ubicacion = ubicacion
        self.inicio = inicio
        self.fechahora = fechahora
        self.fecha = fecha
        self.hora = hora
        self.fin = inicio + tema.duracion
예제 #23
0
	def __init__(self, sequence, \
			id, subtype, name, \
			desc, \
			parent, \
			contains, \
			modify_time, \
			*args, **kw):
		Object.__init__(self, sequence, id, subtype, name, desc, parent, contains, modify_time)

		assert subtype == self.subtype, "Type %s does not match this class %s" % (subtype, self.__class__)

		if len(self.properties) != len(args):
			raise TypeError("The args where not correct, they should be of length %s" % len(self.properties))

		for property, arg in zip(self.properties, args):
			self.length += property.length(arg)
			setattr(self, property.name, arg)
예제 #24
0
 def __init__(self,
              name="Empty bottle",
              value=0,
              health=0,
              shield=0,
              mana=0,
              xp=0,
              libelle="empty_bottle"):
     Object.__init__(self,
                     name,
                     value,
                     typeObject="consumable",
                     libelle=libelle)
     self.health = health
     self.shield = shield
     self.mana = mana
     self.xp = xp
예제 #25
0
	def __init__(self, server, useSessionSweeper=1):
		"""Called only by `AppServer`, sets up the Application."""

		self._server = server
		self._serverSidePath = server.serverSidePath()

		self._imp = server._imp # the import manager

		ConfigurableForServerSidePath.__init__(self)
		Object.__init__(self)

		print 'Initializing Application...'
		print 'Current directory:', os.getcwd()

		if self.setting('PrintConfigAtStartUp'):
			self.printConfig()

		self.initVersions()
		self.initErrorPage()

		self._shutDownHandlers = []

		# Initialize TaskManager:
		if self._server.isPersistent():
			from TaskKit.Scheduler import Scheduler
			self._taskManager = Scheduler(1)
			self._taskManager.start()
		else:
			self._taskManager = None

		# Define this before initializing URLParser, so that contexts have a
		# chance to override this. Also be sure to define it before loading the
		# sessions, in case the loading of the sessions causes an exception.
		self._exceptionHandlerClass = ExceptionHandler

		self.initSessions()
		self.makeDirs()

		URLParser.initApp(self)
		self._rootURLParser = URLParser.ContextParser(self)

		self._running = 1

		if useSessionSweeper:
			self.startSessionSweeper()
예제 #26
0
    def __init__(
            self,
            name='Automa',
            dimension=[1, 1, 1],
            mass=100,
            maxLoad=500,
            resilience=100,
            power=100,
            emissivity={
                "radio": 50,
                "thermal": 50,
                "optical": 100,
                "nuclear": 0,
                "electric": 50,
                "acoustics": 100,
                "chemist": 0
            },
            coord=None,
            sensors=None,
            actuators=None):

        Object.__init__(self,
                        name=name,
                        dimension=dimension,
                        mass=mass,
                        resilience=resilience,
                        emissivity=emissivity,
                        coord=coord)

        self._ai = AI()  #AI Engine
        self._power = power  # nota l'energia è gestita nello stato in quanto è variabile
        self._state = State(run=True)  #Class State
        self._sensors = sensors  # list of Sensor objects
        self._actuators = actuators  # list of Actuator objects. NO DEVE ESSERE UNA CLASSE CHE CONTIENE LA LISTA DEGLI ATTUATORI. QUESTA CLASSE DEVE IMPLEMENTARE IL METODO PER VALUTARE QUALI ATTUATORI ATTIVARE IN BASE AL COMANDO RICEVUTO
        self.action_executed = None
        self._eventsQueue = {}  #  {key: event id, value = event}
        self._actionsQueue = {}  #  {key: event id, value = action}
        self._objectCatched = []
        self._maxLoad = maxLoad

        if not self.checkParamAutoma(power, sensors, actuators, maxLoad):
            raise Exception("Invalid properties! Automata not istantiate.")

        logger.logger.info("Automa {0} created".format(self._id))
예제 #27
0
    def __init__(self):
        Object.__init__(self, 0)

        # properties
        self.sketch_ids = [0, 0, 0, 0, 0]
        self.mirror = False
        self.centre_straight = True
        self.render_wing = True
        self.render_pattern = False
        self.pattern_border = 0.0
        self.pattern_x_step = 30.0
        self.pattern_wall = 2.0
        self.split_into_pieces = 0
        self.split_wall_width = 0.0
        self.color = cad.Color(128, 128, 128)
        self.draw_list = None

        self.box = None  # if box is None, then the curves need reloading
        self.ResetCurves()
예제 #28
0
    def __init__(self, texture, frame_x = 1, frame_y = 1, clickable = False):
        Object.__init__(self, texture)
        self.position = (0, 0)

        self.frame_size = (1/float(frame_x), 1/float(frame_y))
        self.rect = (0, 0, self.frame_size[0], self.frame_size[1])
        self.pixel_size = (self.texture.pixel_size[0]/frame_x,
                           self.texture.pixel_size[1]/frame_y)

        self.width, self.height = self.pixel_size
        self.size = (self.width, self.height)

        self.frames = [frame_x, frame_y]
        self.current_frame = (frame_x, frame_y)
        self.reverse_animation = False

        if clickable:
            ImageObject.clickables.append(self)

        self.create_arrays()
예제 #29
0
    def __init__(self, texture, frame_x=1, frame_y=1, clickable=False):
        Object.__init__(self, texture)
        self.position = (0, 0)

        self.frame_size = (1 / float(frame_x), 1 / float(frame_y))
        self.rect = (0, 0, self.frame_size[0], self.frame_size[1])
        self.pixel_size = (self.texture.pixel_size[0] / frame_x,
                           self.texture.pixel_size[1] / frame_y)

        self.width, self.height = self.pixel_size
        self.size = (self.width, self.height)

        self.frames = [frame_x, frame_y]
        self.current_frame = (frame_x, frame_y)
        self.reverse_animation = False

        if clickable:
            ImageObject.clickables.append(self)

        self.create_arrays()
예제 #30
0
    def __init__(self, x, y, tile_mng, color, typ, _id, number_body):
        Object.__init__(self, x, y, tile_mng, color, typ)
        self._id = _id  # Set id of snake

        self.score = 0  # Set score of snake
        self.x_pos = [
            self.get_x() - (number_body - 1 - i) * self.get_width()
            for i in range(number_body)
        ]  #Set all x postion
        self.y_pos = [self.get_y()] * number_body  # Set all y position
        self.dx = self.get_width()  # Set speed of x
        self.dy = 0  # Set speed of y
        self.move_list = {
            'left': False,
            'right': False,
            'up': False,
            'down': False
        }  # Set move state list
        self.move = 'right'  # Move state
        self.state = 'move'  # State of snake

        self.walk_counter = CounterTime()  # Timer of walking
        self.snake_walk_delay = 0.06  # Walking delay
        self.walk_counter.restart()  # Walking's timer start

        self.slide_counter = CounterTime()  # Timer of slide skill
        self.slide_delay = 5  # Delay of slide skill
        self.slide_counter.restart()  # Timer of slide skill start

        self.running_counter = CounterTime()  # Timer of running skill
        self.running_delay = 1.5  # Running skill Delay

        self.run_use_counter = CounterTime()  # Timer of wait running again
        self.run_use_delay = 3  # Delay of wait running again
        self.run_use_counter.restart()  # Start wait running timer

        self.dead_counter = CounterTime()  # Dead timer
        self.dead_delay = 3  # Dead delay

        self.prepare_walk_counter = CounterTime()  # Prepare to walk counter
        self.prepare_walk_delay = 3  # Prepare to walk delat
예제 #31
0
파일: Tool.py 프로젝트: tonykuo222/heekscnc
    def __init__(self,
                 diameter=3.0,
                 title=None,
                 tool_number=0,
                 type=TOOL_TYPE_SLOTCUTTER):
        Object.__init__(self)
        self.tool_number = tool_number
        self.type = type
        self.diameter = diameter
        self.material = TOOL_MATERIAL_UNDEFINED
        self.tool_length_offset = 0.0
        self.x_offset = 0.0
        self.front_angle = 0.0
        self.tool_angle = 0.0
        self.back_angle = 0.0
        self.orientation = 0
        '''
        // also m_corner_radius, see below, is used for turning tools and milling tools


        /**
                The next three parameters describe the cutting surfaces of the bit.

                The two radii go from the centre of the bit -> flat radius -> corner radius.
                The vertical_cutting_edge_angle is the angle between the centre line of the
                milling bit and the angle of the outside cutting edges.  For an end-mill, this
                would be zero.  i.e. the cutting edges are parallel to the centre line
                of the milling bit.  For a chamfering bit, it may be something like 45 degrees.
                i.e. 45 degrees from the centre line which has both cutting edges at 2 * 45 = 90
                degrees to each other

                For a ball-nose milling bit we would have
                        - m_corner_radius = m_diameter / 2
                        - m_flat_radius = 0    // No middle bit at the bottom of the cutter that remains flat
                                                // before the corner radius starts.
                        - m_vertical_cutting_edge_angle = 0

                For an end-mill we would have
                        - m_corner_radius = 0
                        - m_flat_radius = m_diameter / 2
                        - m_vertical_cutting_edge_angle = 0

                For a chamfering bit we would have
                        - m_corner_radius = 0
                        - m_flat_radius = 0    // sharp pointed end.  This may be larger if we can't use the centre point.
                        - m_vertical_cutting_edge_angle = 45    // degrees from centre line of tool
         */
        '''
        self.corner_radius = 0.0
        self.flat_radius = 0.0
        self.cutting_edge_angle = 0.0
        self.cutting_edge_height = 0.0  # How far, from the bottom of the cutter, do the flutes extend?
        self.max_advance_per_revolution = 0.0
        '''    // This is the maximum distance a tool should advance during a single
                                                // revolution.  This value is often defined by the manufacturer in
                                                // terms of an advance no a per-tooth basis.  This value, however,
                                                // must be expressed on a per-revolution basis.  i.e. we don't want
                                                // to maintain the number of cutting teeth so a per-revolution
                                                // value is easier to use.
        '''
        self.automatically_generate_title = True  #// Set to true by default but reset to false when the user edits the title.
        '''
        // The following coordinates relate ONLY to touch probe tools.  They describe
        // the error the probe tool has in locating an X,Y point.  These values are
        // added to a probed point's location to find the actual point.  The values
        // should come from calibrating the touch probe.  i.e. set machine position
        // to (0,0,0), drill a hole and then probe for the centre of the hole.  The
        // coordinates found by the centre finding operation should be entered into
        // these values verbatim.  These will represent how far off concentric the
        // touch probe's tip is with respect to the quil.  Of course, these only
        // make sense if the probe's body is aligned consistently each time.  I will
        // ASSUME this is correct.
        '''
        self.probe_offset_x = 0.0
        self.probe_offset_y = 0.0
        '''
        // The following  properties relate to the extrusions created by a reprap style 3D printer.
        // using temperature, speed, and the height of the nozzle, and the nozzle size it's possible to create
        // many different sizes and shapes of extrusion.
        typedef std::pair< eExtrusionMaterial_t, wxString > ExtrusionMaterialDescription_t
        typedef std::vector<ExtrusionMaterialDescription_t > ExtrusionMaterialsList_t

        static ExtrusionMaterialsList_t GetExtrusionMaterialsList()
        {
                ExtrusionMaterialsList_t ExtrusionMaterials_list

                ExtrusionMaterials_list.push_back( ExtrusionMaterialDescription_t( eABS, wxString(_("ABS Plastic")) ))
                ExtrusionMaterials_list.push_back( ExtrusionMaterialDescription_t( ePLA, wxString(_("PLA Plastic")) ))
                ExtrusionMaterials_list.push_back( ExtrusionMaterialDescription_t( eHDPE, wxString(_("HDPE Plastic")) ))

                return(ExtrusionMaterials_list)
        }
        '''
        self.extrusion_material = EXTRUSION_MATERIAL_ABS
        self.feedrate = 0.0
        self.layer_height = 0.1
        self.width_over_thickness = 1.0
        self.temperature = 200
        self.flowrate = 10
        self.filament_diameter = 0.2
        '''
        // The gradient is the steepest angle at which this tool can plunge into the material.  Many
        // tools behave better if they are slowly ramped down into the material.  This gradient
        // specifies the steepest angle of decsent.  This is expected to be a negative number indicating
        // the 'rise / run' ratio.  Since the 'rise' will be downward, it will be negative.
        // By this measurement, a drill bit's straight plunge would have an infinite gradient (all rise, no run).
        // To cater for this, a value of zero will indicate a straight plunge.
        '''
        self.gradient = 0.0
        '''
        // properties for tapping tools
        int m_direction    // 0.. right hand tapping, 1..left hand tapping
        double m_pitch     // in units/rev
        '''

        if title != None:
            self.title = title
        else:
            self.title = self.GenerateMeaningfulName()

        self.ResetParametersToReasonableValues()
예제 #32
0
 def __init__(self,x,y,angle,radius,speed):
     Object.__init__(self,x,y,radius)
     self._angle = angle
     self._speed = speed
     self._color = (0,0,0)
예제 #33
0
 def __init__(self, guid):
     Object.__init__(self, guid)
예제 #34
0
 def __init__(self, name="Toon"):
     Object.__init__(self, name)
     self.setModel(ActorToon("neutral", False))
예제 #35
0
 def __init__(self,x,y):
     Object.__init__(self,x,y,PLAYER_RADIUS)
     self._color = PLAYER_COLOR
예제 #36
0
 def __init__(self, name, value, typeObject, libelle):
     Object.__init__(self, name, value, typeObject, libelle)
예제 #37
0
 def __init__(self):
     Object.__init__(self)
예제 #38
0
 def __init__(self,mass,material,color):
     Object.__init__(self,mass=mass,color=color)
     self.setMaterial(material)
예제 #39
0
 def __init__(self):
     Object.__init__(self)
     self.faces = []
예제 #40
0
 def __init__(self):
     Object.__init__(self)
예제 #41
0
 def __init__(self):
     Object.__init__(self)
     self.active = True
     self.comment = ''
     self.title = self.TypeName()
     self.tool_number = 0
예제 #42
0
	def __init__(self, nombre):

		Object.__init__(self)
		self.nombre	= nombre
		self._items	= []
예제 #43
0
파일: Operation.py 프로젝트: kaben/heekscnc
 def __init__(self):
     Object.__init__(self)
     self.active = True
     self.comment = ''
     self.title = self.TypeName()
     self.tool_number = 0
예제 #44
0
파일: Tool.py 프로젝트: AlanZheng/heekscnc
    def __init__(self, diameter = 3.0, title = None, tool_number = 0, type = TOOL_TYPE_SLOTCUTTER):
        Object.__init__(self)
        self.tool_number = tool_number
        self.type = type
        self.diameter = diameter
        self.material = TOOL_MATERIAL_UNDEFINED
        self.tool_length_offset = 0.0
        self.x_offset = 0.0
        self.front_angle = 0.0
        self.tool_angle = 0.0
        self.back_angle = 0.0
        self.orientation = 0
        
        '''
        // also m_corner_radius, see below, is used for turning tools and milling tools


        /**
                The next three parameters describe the cutting surfaces of the bit.

                The two radii go from the centre of the bit -> flat radius -> corner radius.
                The vertical_cutting_edge_angle is the angle between the centre line of the
                milling bit and the angle of the outside cutting edges.  For an end-mill, this
                would be zero.  i.e. the cutting edges are parallel to the centre line
                of the milling bit.  For a chamfering bit, it may be something like 45 degrees.
                i.e. 45 degrees from the centre line which has both cutting edges at 2 * 45 = 90
                degrees to each other

                For a ball-nose milling bit we would have
                        - m_corner_radius = m_diameter / 2
                        - m_flat_radius = 0    // No middle bit at the bottom of the cutter that remains flat
                                                // before the corner radius starts.
                        - m_vertical_cutting_edge_angle = 0

                For an end-mill we would have
                        - m_corner_radius = 0
                        - m_flat_radius = m_diameter / 2
                        - m_vertical_cutting_edge_angle = 0

                For a chamfering bit we would have
                        - m_corner_radius = 0
                        - m_flat_radius = 0    // sharp pointed end.  This may be larger if we can't use the centre point.
                        - m_vertical_cutting_edge_angle = 45    // degrees from centre line of tool
         */
        '''
        self.corner_radius = 0.0
        self.flat_radius = 0.0
        self.cutting_edge_angle = 0.0
        self.cutting_edge_height = 0.0    # How far, from the bottom of the cutter, do the flutes extend?
        self.max_advance_per_revolution = 0.0
        '''    // This is the maximum distance a tool should advance during a single
                                                // revolution.  This value is often defined by the manufacturer in
                                                // terms of an advance no a per-tooth basis.  This value, however,
                                                // must be expressed on a per-revolution basis.  i.e. we don't want
                                                // to maintain the number of cutting teeth so a per-revolution
                                                // value is easier to use.
        '''
        self.automatically_generate_title = True    #// Set to true by default but reset to false when the user edits the title.
        '''
        // The following coordinates relate ONLY to touch probe tools.  They describe
        // the error the probe tool has in locating an X,Y point.  These values are
        // added to a probed point's location to find the actual point.  The values
        // should come from calibrating the touch probe.  i.e. set machine position
        // to (0,0,0), drill a hole and then probe for the centre of the hole.  The
        // coordinates found by the centre finding operation should be entered into
        // these values verbatim.  These will represent how far off concentric the
        // touch probe's tip is with respect to the quil.  Of course, these only
        // make sense if the probe's body is aligned consistently each time.  I will
        // ASSUME this is correct.
        '''
        self.probe_offset_x = 0.0
        self.probe_offset_y = 0.0
        '''
        // The following  properties relate to the extrusions created by a reprap style 3D printer.
        // using temperature, speed, and the height of the nozzle, and the nozzle size it's possible to create
        // many different sizes and shapes of extrusion.
        typedef std::pair< eExtrusionMaterial_t, wxString > ExtrusionMaterialDescription_t
        typedef std::vector<ExtrusionMaterialDescription_t > ExtrusionMaterialsList_t

        static ExtrusionMaterialsList_t GetExtrusionMaterialsList()
        {
                ExtrusionMaterialsList_t ExtrusionMaterials_list

                ExtrusionMaterials_list.push_back( ExtrusionMaterialDescription_t( eABS, wxString(_("ABS Plastic")) ))
                ExtrusionMaterials_list.push_back( ExtrusionMaterialDescription_t( ePLA, wxString(_("PLA Plastic")) ))
                ExtrusionMaterials_list.push_back( ExtrusionMaterialDescription_t( eHDPE, wxString(_("HDPE Plastic")) ))

                return(ExtrusionMaterials_list)
        }
        '''
        self.extrusion_material = EXTRUSION_MATERIAL_ABS
        self.feedrate = 0.0
        self.layer_height = 0.1
        self.width_over_thickness = 1.0
        self.temperature = 200
        self.flowrate = 10
        self.filament_diameter = 0.2
        '''
        // The gradient is the steepest angle at which this tool can plunge into the material.  Many
        // tools behave better if they are slowly ramped down into the material.  This gradient
        // specifies the steepest angle of decsent.  This is expected to be a negative number indicating
        // the 'rise / run' ratio.  Since the 'rise' will be downward, it will be negative.
        // By this measurement, a drill bit's straight plunge would have an infinite gradient (all rise, no run).
        // To cater for this, a value of zero will indicate a straight plunge.
        '''
        self.gradient = 0.0
        '''
        // properties for tapping tools
        int m_direction    // 0.. right hand tapping, 1..left hand tapping
        double m_pitch     // in units/rev
        '''
        
        if title != None:
            self.title = title
        else:
            self.title = self.GenerateMeaningfulName()
            
        self.ResetParametersToReasonableValues()
예제 #45
0
 def __init__(self,x,y):
     Object.__init__(self,x,y,POWERUP_RADIUS)
     self._color = (0,0,0)
     self._timer = 10
     self._type = 'BASIC'
예제 #46
0
    def __init__(self):

        Object.__init__(self)
        self._items = set()
예제 #47
0
 def __init__(self, type = 0, id_named = False):
     Object.__init__(self, type, id_named)
예제 #48
0
 def __init__(self, list):
     Object.__init__(self, None, None, None, None, None, None, None, None,
                     None, None)
     self.list = list
     self.ExternalForces = []
     self.Force = Force()
예제 #49
0
파일: BarObject.py 프로젝트: dujodujo/lemur
    def __init__(self, texture, length):
        Object.__init__(self, texture)

        self.length = length
        self.position = (0, 0)
        self.create_arrays()