Hi @kbwbe, care to post a link to said thread?
Edit: found it
https://forum.freecadweb.org/viewtopic. ... 92#p453592
Hi @kbwbe, care to post a link to said thread?
I'd be very interested in this also
Resulting principle from help-request ( https://forum.freecadweb.org/viewtopic. ... 11#p453711) is:
Code: Select all
import FreeCADGui
import FreeCAD
from PySide import QtGui
from PySide import QtCore
from pivy import coin
#setup the contour
color = coin.SoBaseColor()
color.rgb = (1, 0, 0)
points=coin.SoCoordinate3()
lines=coin.SoLineSet()
points.point.values = ( (0,0,0),(10,10,10),(10,10,0) )
#feed data to separator
sep=coin.SoSeparator()
sep.addChild(points)
sep.addChild(color)
sep.addChild(lines)
#add separator to sceneGraph
sg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()
sg.addChild(sep)
I will now create some functionality according to this within the workbench.
First quick and dirty test: Convergency (red = spin vector, blue = move vector) tracked on screen...
Thank you very much. Sounds very, very interesting. I did some first tests. For a very small system, solving was succesful. For a medium sized model solving failed. I attach the test file.
I think i cannot grant commit permissions to a single branch only. That's a problem.
I have integrated some helper tools for this now.
Code: Select all
#===================================================
# do debug settings here:
#===================================================
A2P_DEBUG_LEVEL = A2P_DEBUG_NONE #normal: A2P_DEBUG_NONE
GRAPHICALDEBUG = True #normal: False
# for debug purposes
# 0:normal
# 1:one step in each worklist
# 2:one step in first worklist
SOLVER_ONESTEP = 1 #normal: 0
#===================================================
Code: Select all
def drawDebugVectorAt(position,direction,rgbColor):
'''
function draws a vector directly to 3D view using pivy/Coin
expects position and direction as Base.vector type
color as tuple like (1,0,0)
'''
color = coin.SoBaseColor()
color.rgb = rgbColor
# Line style.
lineStyle = coin.SoDrawStyle()
lineStyle.style = coin.SoDrawStyle.LINES
lineStyle.lineWidth = 2
points=coin.SoCoordinate3()
lines=coin.SoLineSet()
startPoint = position.x,position.y,position.z
ep = position.add(direction)
endPoint = ep.x,ep.y,ep.z
points.point.values = (startPoint,endPoint)
#create and feed data to separator
sep=coin.SoSeparator()
sep.addChild(points)
sep.addChild(color)
sep.addChild(lineStyle)
sep.addChild(lines)
#add separator to sceneGraph
sg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()
sg.addChild(sep)
solver_debug_objects.append(sep)