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
# Ref: https://github.com/Beastmaster/itk-python-example/blob/master/vtkSlidebar.py | |
# Ref: https://kitware.github.io/vtk-examples/site/Cxx/Widgets/Slider/ | |
import vtk | |
sphereSource = vtk.vtkSphereSource() | |
sphereSource.SetCenter(0.0,0.0,0.0) | |
sphereSource.SetRadius(4.0) | |
sphereSource.Update() |
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 | |
import vtkmodules.all as vtk | |
from vtkmodules.util import numpy_support as nps | |
from vtkmodules.vtkCommonCore import vtkCommand | |
class InteractorStyleDrawPolygon(vtk.vtkInteractorStyle): | |
""" | |
InteractorStyleDrawPolygon is a re-write of the vtk class of the same name in python. |
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
# Using QThreads in PyQt5 using worker model | |
# There is so many conflicting posts on how QThreads should be used in pyqt. I had | |
# been subclassing QThread, overriding the run function, and calling start to run | |
# the thread. I did it this way, because I couldn't get the worker method (where | |
# an object is moved to a thread using moveToThread) to do what I wanted. It turns | |
# out that I just didn't understand why. But, once I worked it out I have stuck with | |
# the moveToThread method, as this is recommended by the official docs. | |
# | |
# The key part for me to understand was that when I am running a heavy calculation in |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Code to show two plots of simulated streamed data. Data for each plot is processed (generated) | |
# by separate threads, and passed back to the gui thread for plotting. | |
# This is an example of using movetothread, which is the correct way of using QThreads | |
# Michael Hogg, 2015 | |
import time, sys | |
from pyqtgraph.Qt import QtGui, QtCore | |
from PyQt4.Qt import QMutex | |
import pyqtgraph as pg |
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 os | |
root = r'D:\temp' | |
m = mdb.models['Model-1'] | |
a = m.rootAssembly | |
p = m.parts['Part-1'] | |
elements = p.elements | |
foutName = 'eConn2.txt' | |
npFace = 3 # Number of nodes per face. If using C3D4 elems, this will be 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
from abaqus import * | |
from abaqusConstants import * | |
from odbAccess import * | |
odb = session.viewports[session.currentViewportName].displayedObject | |
instName = 'MALE' | |
elements = odb.rootAssembly.instances[instName].elements | |
foutName = 'elementConnectivity.txt' |
NewerOlder