Forum Replies Created
-
AuthorPosts
-
17 September 2018 at 10:48 in reply to: Runge Kutta issue: 'Segmentation fault (core dumped)' #11950quentinBlocked
Hello @Hugo,
To clarify, we have to add the UncoupledConstraintCorrection to correct the free calculation (without constraints), don’t we ? But you say that this correction needs to an implicit scheme, or in other words not RungeKutta, is it correct ?
Thanks for your help
Q
quentinBlockedHi @Hugo,
Thanks for the help ! The sum that you talk about, is it a temporal sum or just a sum of all the forces at the precise time ?
Thanks for the help
quentinBlockedTo resolve my problem, I juste have to see the value of the force really applied on each point. Is it possible to access it with the indices or an option like that ?
quentinBlockedHi everyone,
I found in the oxygen that the
totalForce
is the sum of all the forces applied at each point : https://www.sofa-framework.org/api/master/sofa/html/classsofa_1_1component_1_1forcefield_1_1_constant_force_field.html#a7f45cdbc837c9ac22f44763806e0823fThat’s why we have the deformation which is not following the force signal. The problem is when I use the
force
attribute I have the value of the force applied on each point and not divided by the number of points. Is there another attribute that I didn’t find to apply a force which will not be summed in time to all the points (and not to each point) ?quentinBlockedYes I mean it, I see the force arrows as before but I still have the problem of the displacement which isn’t following the force signal. The situation hasn’t changed.
quentinBlockedHi Hugo,
Thanks for your help ! I tried to directly update the data as you said. The vector is a column one therefore I can access the value like that :
print(self.forceField.findData('totalForce').value[0][1])
Nevertheless, it is impossible to edit it directly, it seems that I have to edit all the vector.
This isn’t working :
self.forceField.findData('totalForce').value[0][1] = force
This is working :
self.forceField.findData('totalForce').value = [0, force, 0]
quentinBlockedHi Jean-Nicolas,
Thanks for your help ! I changed the string I sent to the totalForce in a vector like that :
self.forceField.findData('totalForce').value = [0, force, 0]
I display the new totalForce on the terminal like that :
print(self.forceField.findData('totalForce').value)
I have the good value as I want with my negative sinus square (I see the force arrow s on the GUI) but the deformation doesn’t seem to follow the force signal. In fact, I have a tube with a spring in the middle and I try to compress it. I block the bottom and apply the force on the top part. The problem is that the force is a sinus and the deformation continues to increase permanently (so a line). Here you can see the force applied in the vector lines and the position of the point just under each vector.
[[0.0, -0.0, 0.0]] 1000.0 [[0.0, -21067.05423352457, 0.0]] 998.210218854 [[0.0, -81309.41177357652, 0.0]] 996.376814199 [[0.0, -172266.21253047822, 0.0]] 993.959163958 [[0.0, -281162.84414120595, 0.0]] 991.292846044 [[0.0, -392705.09831248416, 0.0]] 987.782535008 [[0.0, -491227.196924607, 0.0]] 983.855256778 [[0.0, -562892.0040131591, 0.0]] 979.023956496 [[0.0, -597634.4103943433, 0.0]] 973.678487509 [[0.0, -590574.9483385893, 0.0]] 967.601948838 [[0.0, -542705.0983124842, 0.0]] 961.047161738 [[0.0, -460748.03849369887, 0.0]] 954.060967265 [[0.0, -356214.3943757172, 0.0]] 946.75375456 [[0.0, -243785.6056242822, 0.0]] 939.283539129 [[0.0, -139251.96150630055, 0.0]] 931.704832793 [[0.0, -57294.90168751533, 0.0]] 924.099724048 [[0.0, -9425.051661410507, 0.0]] 916.501371709 [[0.0, -2365.5896056567476, 0.0]] 908.91719647 [[0.0, -37107.99598684137, 0.0]]
23 May 2018 at 18:06 in reply to: [SOLVED] Get the position value from a MechanicalObject point in Python #11089quentinBlockedHi Hugo,
I just tried to implement the code you proposed and it’s working. I made a loop to find the point at the end of my shape (the point with the biggest x coordinate) before the beginning of the scene :
def bwdInitGraph(self,node): # find the position at the end of the shape (which has the biggest x coordinate) Positions = self.MechaNode.findData('position').value max = 0 for i in range(len(Positions)): if Positions[i][0] > max: self.pos = i max = Positions[i][0] print(self.pos) print(Positions[self.pos][0]) return 0
After that, I just displayed the value at each time step like that :
# called on each animation step (end) def onEndAnimationStep(self, dt): # access the 'position' state vector Positions = self.MechaNode.findData('position').value # print the value of the DOF self.pos (Vec3 : x,y,z) x for 0, y for 1, z for 2 print str(Positions[self.pos][0]) return 0
Thank’s for your help !
18 May 2018 at 18:43 in reply to: [SOLVED] Get the position value from a MechanicalObject point in Python #11065quentinBlockedHi Hugo,
It’s perfect thank you ! I just have a last question about the point you can access. How can you find the label of the point ? I mean that I want to choose a specific point of the mesh, so how to proceed ? Do I have to look inside the mesh file and find the good line for the point and that’s the label I have to use in x here
myMOpositions[x][0]
?Thank’s for you help !
quentinBlockedThanks for the answer, I just added
accordion.createObject('MechanicalObject', name='tetras', template='Vec3d', showObject="1")
and it changed nothingI think I have a problem with the loader and there is no object so the box isn’t defined.
quentinBlockedIt works, thank’s ! The error was the GUI which is QGL by default.
Quentin
26 March 2018 at 09:25 in reply to: [SOLVED] Visualization bug with a SoftRobots plugin example #10719quentinBlocked-> subject moved to the SoftRobots Github page
-
AuthorPosts