This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# Steam Deck UNOFFCIAL Tilt Five install script | |
# Save to a directory with the tiltfive_driver_1.4.1_amd64.unpacked_debs.tar.xz archive | |
# chmod +x steamdeck-install.sh | |
# sudo sh ./steamdeck-install.sh | |
# Adjust paths if necessary | |
TILTFIVE_HOME_DIR="/var/opt/tiltfive" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import FreeCADGui as Gui | |
import FreeCAD as App | |
import Part | |
def pick_ray(start_vec, dir_vec): | |
Gui.Selection.clearSelection() | |
if App.ActiveDocument.getObject('Line_dir'): | |
App.ActiveDocument.removeObject('Line_dir') | |
if App.ActiveDocument.getObject('Line_ray'): | |
App.ActiveDocument.removeObject('Line_ray') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from OpenGL.GL import * | |
WINDOW_LIBRARY = 'GLFW' # GLFW or GLUT | |
TRY_FRAMEBUFFER = True | |
GENERATE_TEXTURE_ID_PROBLEM = False # Follow this global variable to see the error in texture ID generation | |
SIDE = 800 # window size | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SoEnvironment usage in FreeCAD scene | |
# https://www.coin3d.org/coin/classSoEnvironment.html | |
# https://forum.freecad.org/viewtopic.php?p=785643#p785643 | |
from pivy.coin import SoEnvironment | |
se = SoEnvironment() # create a new node | |
sg = Gui.ActiveDocument.ActiveView.getSceneGraph() | |
sg.insertChild(se, 1) # add the node at the beginning of our scene | |
se.ambientIntensity.getValue() # read value for current ambient light eg.: 0.2 | |
se.ambientIntensity.setValue(0.8) # set a new value for ambient light, can be higher than 1 too, since it is multiplied by AmbientColor property of a material |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import FreeCAD as App, FreeCADGui as Gui, time | |
from PySide2 import QtGui,QtCore | |
class Animation(object): | |
def __init__(self): | |
App.Console.PrintMessage("init \n") | |
App.ActiveDocument.recompute() | |
self.timer = QtCore.QTimer() | |
QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.my_update) | |
self.timer.start(100) #100ms for step, adjust to performance of the PC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import FreeCAD as App, FreeCADGui as Gui, Part, time | |
from PySide2 import QtGui,QtCore | |
from pivy import coin | |
import math | |
class CustomArrow(object): | |
def __init__(self): | |
self.cyl_height = 6 | |
cyl_radius = 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on gl_example.py https://github.com/cmbruns/pyopenxr_examples | |
import ctypes | |
import logging | |
from threading import Thread | |
import sdl2 | |
import platform | |
from OpenGL import GL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script creates a simple Qt Widget, renders it to a Coin3D texture (SoTexture2), and creates a cube (SoCube) with that texture. | |
# It also simulates (def simulate_picking(self)) a 3D ray that intersects with Coin3D render of the QWidget. If the point of intersection is on the "Hello World" button widget, then QMouseEvent (pressed and relesed) is triggered and button activation is animated. | |
from OpenGL import GL | |
from PySide2.QtWidgets import QOpenGLWidget, QApplication | |
from PySide2.QtCore import Qt, QTimer, Signal, Slot | |
from PySide2.QtGui import QOpenGLContext | |
from PySide2.QtGui import qGray, qRed, qGreen, qBlue, qAlpha | |
from pivy.coin import SoFrustumCamera |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script creates ABENICS (half of) cross gear in FreeCAD | |
import FreeCAD as App | |
import Part | |
import InvoluteGearFeature | |
doc = App.ActiveDocument | |
mod = 2.0 # gear tooth module | |
monopole_teeth = 12 # number of teeth | |
cross_teeth = monopole_teeth * 2 | |
height = 20 # height of the monopole gear |
NewerOlder