🍰
Grasshopper ES por BetweenRealities
  • Using and Generating Documentation
    • GitHub
    • Discord
      • Speckle Webhooks
    • Speckle Client
  • Potencial technological implementations
  • 🧞Compute
    • Introducción a Grasshopper
      • Customizar Entorno
        • VSCode
      • Rhinoceros 3d
      • Hops
      • Galapagos
    • Modelos Informados
      • Comportamiento Estructural
        • Automatizar cálculo Python
      • OOP
      • Rhino Inside Revit
        • Revit
          • Modelado 3d en Revit
          • Certificación profesional Revit
      • Energía
    • Procesos Urbanos
      • Automatizar Qgis
      • Librerías Python
      • Librerías Grasshopper
      • Stable Diffusion
    • Programación
      • RhinoPython
        • Anatomía del script
        • Python básico
        • Tuples, listas y diccionarios
        • Operadores y funciones
        • Ejecución condicional
        • Geometría
        • Clases
      • Multithread
  • 🪅Database
    • Lenguaje Python
      • Types and operations
      • Statements and syntax
      • Function and generators
      • Modules and packages
      • Classes and OPP
      • Exception and tools
      • Advance topics
    • Análisis de la Información
      • Comparison with SQL
      • Comparison with R / R libraries
      • Pandas
    • Abrir Acceso
      • Rest API Abierta
    • Blockchain Descentralización
  • 🕸️COLLECT
    • Captura de Datos
      • Raspberry Pi
        • Encendido y apagado automático
      • Arduino
      • UAS
      • Fotogrametría
        • Crashes
    • Técnicas Machine Learning
      • Clasificación
      • Computer Vision
    • Computación en la Nube
      • Contenedores
      • Azure
      • Ubuntu Server Deploy
      • PostgreSQL Server
      • Rhino Compute Deploy
  • 🍭INTERACT
    • Introducción a Unreal Engine
      • Ejecutar Python
      • Datasmith
      • Materiales
        • Crear PBR
        • Materiales Introducción
      • Iluminación
        • Iluminación Introducción
        • Raytraced Iluminación Cinemática
      • Assets Management
    • Interacción Inmersiva
      • Blueprints
        • Blueprints estandar
        • Blueprints Introducción
        • Diseño Nivel
      • Packaging
      • Performance
    • Interfaces Bidimensionales
Con tecnología de GitBook
En esta página

¿Te fue útil?

  1. Compute
  2. Programación
  3. RhinoPython

Clases

Classes

  • class syntax: add another level of functionality and type of programming called Object-Oriented programming. We can create objects, a class with internal attributes, functions and any other of characteristics and then create multiple instances. Organize your code based on object, these objects can relate to one another with inheritance, add or remove information/characteristics though functions and actually exhibit polymorphism. Polymorphism is the ability to create one object or class that can exhibit multiple characteristics and commonly respond to similar functions. Class can describe geometry -ie a surface is an object with curvature, centroid, number of u and v, point, etc. also ask for information about surface based on functions embedded within the class and create your own types of objects like 'connection' or 'apertures'.

Class can be nested, have multiple function privacy, modularity.

        class MyClass:

                """A simple example"""

                x = 10

                def test(self): # self is a convention

                        return 'hello'

  

                obj = MyClass()

                print obj.x     # return 10

                print obj.test()# return hello

  

                obj.x = 5

                print obj.x # return 5. We can change the attribute of an object and call functions outside of the class

  
  

                class Harder:

                        def __init__(self,m,n): # force the class to give certain attributes whenever it is created (rather than adding them later)

                                self.i = m

                                self.j = n

                newObj = Harder(10,20)

                print newObj.i

                print newObj.j

  
  

                class Weird(MyClass):   # example of inheritance, or the ability for a class to take on the qualities of another class, yet have its own differences.

                        k = 17

                newerObj = Weird()

                print newerObj.test()   # return hello
AnteriorGeometríaSiguienteMultithread

Última actualización hace 2 años

¿Te fue útil?

🧞