Forum Replies Created
-
AuthorPosts
-
JerryBlocked
Hi Hugo,
Thanks for your help! I got a lot done thanks to you. Hope sofa can export internal stress in the future.
Best,
JerryJerryBlockedHi Hugo,
Thank for the tips and sorry for the late reply. I have built it on Windows and writeState and monitor works fine! However, I am now wondering if there is anyway that sofa can output internal force in the object? eg. the internal stress between mesh vertices. Or is there any way I can calculate that from output force or deformation of the object? My goal is to explore the reacting force my object can provide when I am pulling it using a cable (ie. simply the tension of cable).
JerryBlockedHi Hugo,
Sure thing. In my case I am trying to export force data of a beam with monitor as follows:
eobject.createObject('Monitor', name="forces", template="Vec3d", listening="1", indices="@boxROI.indices", showPositions="0", PositionsColor="1 1 0 1", showVelocities="0", VelocitiesColor="1 1 0 1", showForces="1", ForcesColor="1 0 0 0.5", showMinThreshold="0.01", sizeFactor="0.5", ExportForces='true', TrajectoriesPrecision="0.1", TrajectoriesColor="1 1 0 1")
I think this component works because in my simulation there are red arrows representing forces, and no error present in sofa.
However, no file is exported no matter whether I select ExportForces/ExportVelocities/ExportPositions or not.For writeState, I wrote for the cable that pulls on the beam:
cable.createObject('WriteState', name='export', filename='cableTension.txt', writeX='false', writeV='false', writeF='true', time='0', period='0.01')
In this case, sofa says “Error creating file cableTension.txt”, and nothing is exported.
By the way, I tried the example examples/Components/misc/WriteState.xml, and this WriteState also fail to create file, which makes me think if I missed anything during download.Best,
JerryJerryBlockedHi Sarah,
Thanks for the reply! That is actually what I wrote. I think the monitor component does work because I can see force vectors during simulation.
Is it because I built my sofa wrong so I missed the export feature? Because my writeState component also does not work. I’m running a mac, and I just downloaded runSofa and moved softRobots plugin into the plugins folder.Thank you,
QifanJerryBlockedHi,
another question is that I found that the force it shows is actually net force on the particles, but I want the internal force on each particle (ie. stress of each vertices) Is there a way I can acquire that? Or at least the tension in the cable.
Best,
JerryJerryBlockedHi Sarah and Hugo,
That is really useful, thank you so much Sarah! But now I’m having a problem of exporting .txt files… Every time I export .txt, sofa always exports the same files: velocity and position of mechanical object of each object, plus one mass-energy.txt, no matter what I put into the monitor component. I actually want force of a few specific vertices, is there anything I did wrong?
Thank you,
JerryJerryBlockedHi all,
This is a follow-up question. I am now using another monitor component, and it is much more powerful! But I feel it is slow if I have to choose the indices of my object one by one, since my object is made of a mesh with ten thousands of vertices…
Is there any way I can appoint all vertices whose z > 10, or like manually select vertices or something like that?Thanks,
Jerry -
AuthorPosts