Skip to content

Instantly share code, notes, and snippets.

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
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
@kwahoo2
kwahoo2 / sdl-example-coin-test.py
Created August 23, 2023 21:18
Paste in FreeCAD console to get OpenXR viewer
# 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 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 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
@kwahoo2
kwahoo2 / attachment-animation-with-pauses.py
Created February 4, 2023 12:54
This script animates "Box" attached to an curve with MapPathParameter # It can be used for animation of indexing conveyor (start/stop)
# This script animates "Box" attached to an curve with MapPathParameter
# It can be used for animation of indexing conveyor (start/stop)
import FreeCAD as App, FreeCADGui as Gui, Part, time
from PySide2 import QtGui,QtCore
class Animation(object):
def __init__(self):
App.Console.PrintMessage('Animation has started\n')
App.ActiveDocument.recompute()
@kwahoo2
kwahoo2 / FreeCAD attachment animation
Created February 4, 2023 12:06
# This script aniamtes "Box" attached to an curve with MapPathParameter
# This script aniamtes "Box" attached to an curve with MapPathParameter
import FreeCAD as App, FreeCADGui as Gui, Part, time
from PySide2 import QtGui,QtCore
class Animation(object):
def __init__(self):
App.Console.PrintMessage('Animation has started\n')
App.ActiveDocument.recompute()
self.timer = QtCore.QTimer()
Informacje o komputerze:
Producent: Unknown
Model: Unknown
Rodzaj: Komputer stacjonarny
Nie wykryto panelu dotykowego
Informacje o procesorze:
Dostawca CPU: AuthenticAMD
Marka procesora: AMD Ryzen 7 1700 Eight-Core Processor
Rodzina CPU: 0x17
GameAction [AppID 220, ActionID 1] : LaunchApp changed task to ProcessingInstallScript with ""
GameAction [AppID 220, ActionID 1] : LaunchApp changed task to SynchronizingCloud with ""
GameAction [AppID 220, ActionID 1] : LaunchApp changed task to SiteLicenseSeatCheckout with ""
GameAction [AppID 220, ActionID 1] : LaunchApp changed task to CreatingProcess with ""
GameAction [AppID 220, ActionID 1] : LaunchApp waiting for user response to CreatingProcess ""
GameAction [AppID 220, ActionID 1] : LaunchApp continues with user response "CreatingProcess"
/bin/sh\0-c\0/home/adi/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=220 -- '/mnt/ssd/SteamLibrary/steamapps/common/Half-Life 2/hl2.sh' -game hl2 -steam -vulkan\0
Game process added : AppID 220 "/home/adi/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=220 -- '/mnt/ssd/SteamLibrary/steamapps/common/Half-Life 2/hl2.sh' -game hl2 -steam -vulkan", ProcID 17050, IP 0.0.0.0:0
ERROR: ld.so: object '/home/adi/.local/share/Steam/ubuntu12_32/gameoverlayre
--- Serious Engine Startup ---
SeriousEngine Build: 10000.10
Executable: D:\ssrt\Bin\SeriousSamTFE.exe
Assumed engine directory: `\„ä
Examining underlying OS...
Type: WinNT
Version: 6.2, build 9200