Skip to content

Commit

Permalink
PD: Fix w[z] plot in ShaftWizard
Browse files Browse the repository at this point in the history
  • Loading branch information
chennes committed Jun 1, 2022
1 parent a0c0b26 commit d860c4b
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/Mod/PartDesign/WizardShaft/SegmentFunction.py
Expand Up @@ -375,21 +375,19 @@ def evaluate(self, maxX, pointsX):
yresult = []
# Coverity has reported a problem that I_i, C_i0 or C_i1:
# Bad use of null-like value (CIDs are 192609, 192611, 192616)
# Since this code doesn't seem to be used anywhere the problematic
# part will be commented out
#for xval in sorted(xvals):
# if xval in divs:
# i = self.intfunc.index(xval)
# (begin, length) = self.intfunc.interval(xval)
# I_i = self.intfunc.value(xval)
# C_i0 = self.boundaries[2 * i]
# C_i1 = self.boundaries[2 * i + 1]
# FreeCAD.Console.PrintMessage("Interval %u: %f to %f, I_i: %f, C_i0: %f, C_i1: %f\n" % (i, begin, length, I_i, C_i0, C_i1))
#
# xresult.append(xval)
# # w(xval) = (transfunc(xval) + C_i0 * xval + C_i1) / (E * I_i)
# value = (self.transfunc.value(xval) + C_i0 * xval + C_i1) / (E * I_i)
# yresult.append(value)
for xval in sorted(xvals):
if xval in divs:
i = self.intfunc.index(xval)
(begin, length) = self.intfunc.interval(xval)
I_i = self.intfunc.value(xval)
C_i0 = self.boundaries[2 * i]
C_i1 = self.boundaries[2 * i + 1]
FreeCAD.Console.PrintMessage("Interval %u: %f to %f, I_i: %f, C_i0: %f, C_i1: %f\n" % (i, begin, length, I_i, C_i0, C_i1))

xresult.append(xval)
# w(xval) = (transfunc(xval) + C_i0 * xval + C_i1) / (E * I_i)
value = (self.transfunc.value(xval) + C_i0 * xval + C_i1) / (E * I_i)
yresult.append(value)

return (xresult, yresult)

0 comments on commit d860c4b

Please sign in to comment.