diff --git a/doc/img/Beam-Image-2-SFD - POI labeled.png b/doc/img/Beam-Image-2-SFD - POI labeled.png new file mode 100644 index 0000000..b51c8f0 Binary files /dev/null and b/doc/img/Beam-Image-2-SFD - POI labeled.png differ diff --git a/doc/readthedocs/planesections/builder.py b/doc/readthedocs/planesections/builder.py index 1a5eba8..b3bd503 100644 --- a/doc/readthedocs/planesections/builder.py +++ b/doc/readthedocs/planesections/builder.py @@ -340,7 +340,6 @@ def getDOF(self): """ return self._ndf - def _initArrays(self): self.nodeLabels = {} self.nodes:list[Node] = [] diff --git a/doc/readthedocs/planesections/diagram/components/basic.py b/doc/readthedocs/planesections/diagram/components/basic.py index f042399..ee03161 100644 --- a/doc/readthedocs/planesections/diagram/components/basic.py +++ b/doc/readthedocs/planesections/diagram/components/basic.py @@ -532,6 +532,7 @@ def __init__(self, loadBox, diagramOptions:DistLoadOptions, # self.pointUp = loadBox.pointUp self.options = diagramOptions self.plOptions = plOptions + self.minNbar = 3 def plot(self, ax): @@ -547,7 +548,7 @@ def plot(self, ax): x1, x2 = self.loadBox.x y1, y2 = self.loadBox.y - N = int((x2 - x1) / spacing) + 1 + N = max(int((x2 - x1) / spacing) + 1, self.minNbar) xVals = np.linspace(x1, x2, N) ystart = self.loadBox.fout[0] @@ -574,6 +575,7 @@ def __init__(self, loadBox, diagramOptions:LinLoadOptions, self.loadBox = loadBox self.options = diagramOptions self.plOptions = plOptions + self.minNbar = 3 def plot(self, ax): @@ -592,7 +594,8 @@ def plot(self, ax): # baseLineWidth = 0.015 - Nlines = int((x2 - x1) / spacing) + 1 + Nlines = max(int((x2 - x1) / spacing) + 1, self.minNbar) + xVals = np.linspace(x1, x2, Nlines) q1, q2 = self.loadBox.fout diff --git a/doc/readthedocs/planesections/postprocess/plot.py b/doc/readthedocs/planesections/postprocess/plot.py index 12c90a8..d14a774 100644 --- a/doc/readthedocs/planesections/postprocess/plot.py +++ b/doc/readthedocs/planesections/postprocess/plot.py @@ -466,8 +466,6 @@ def plotRotation2D(beam:Beam, scale=1000, yunit = 'mRad', **kwargs): return plotDisp2D(beam, ind, scale, yunit= yunit, **kwargs) - - def plotPOI(fig, ax, xcoords, force, labels, filteredPoiInd): labelX = [] diff --git a/example/1. Demo.py b/example/1. Demo.py index d890d7e..e1906a9 100644 --- a/example/1. Demo.py +++ b/example/1. Demo.py @@ -32,5 +32,5 @@ analysis.runAnalysis() # Plot the SFD and BMD -ps.plotShear(beam, scale = 0.001, yunit = 'kN') -ps.plotMoment(beam, scale = 0.001, yunit = 'kNm') \ No newline at end of file +ps.plotShear(beam, scale = 0.001, yunit = 'kN',labelPOI=True) +ps.plotMoment(beam, scale = 0.001, yunit = 'kNm',labelPOI=True) \ No newline at end of file diff --git a/example/2. Analysis/Ex2a-Basic Beam.py b/example/2. Analysis/Ex2a-Basic Beam.py index f09057c..95f43ae 100644 --- a/example/2. Analysis/Ex2a-Basic Beam.py +++ b/example/2. Analysis/Ex2a-Basic Beam.py @@ -63,4 +63,8 @@ ps.plotDisp(beam, scale=1000, yunit = 'mm') ps.plotRotation(beam, scale=1000, yunit = 'mrad') +""" +Plot the shear force, and show labeling. +""" ps.plotVertDisp(beam) +ps.plotShear(beam,labelPOI=True) \ No newline at end of file diff --git a/src/builder.py b/src/builder.py index 1a5eba8..b3bd503 100644 --- a/src/builder.py +++ b/src/builder.py @@ -340,7 +340,6 @@ def getDOF(self): """ return self._ndf - def _initArrays(self): self.nodeLabels = {} self.nodes:list[Node] = [] diff --git a/src/diagram/components/basic.py b/src/diagram/components/basic.py index f042399..ee03161 100644 --- a/src/diagram/components/basic.py +++ b/src/diagram/components/basic.py @@ -532,6 +532,7 @@ def __init__(self, loadBox, diagramOptions:DistLoadOptions, # self.pointUp = loadBox.pointUp self.options = diagramOptions self.plOptions = plOptions + self.minNbar = 3 def plot(self, ax): @@ -547,7 +548,7 @@ def plot(self, ax): x1, x2 = self.loadBox.x y1, y2 = self.loadBox.y - N = int((x2 - x1) / spacing) + 1 + N = max(int((x2 - x1) / spacing) + 1, self.minNbar) xVals = np.linspace(x1, x2, N) ystart = self.loadBox.fout[0] @@ -574,6 +575,7 @@ def __init__(self, loadBox, diagramOptions:LinLoadOptions, self.loadBox = loadBox self.options = diagramOptions self.plOptions = plOptions + self.minNbar = 3 def plot(self, ax): @@ -592,7 +594,8 @@ def plot(self, ax): # baseLineWidth = 0.015 - Nlines = int((x2 - x1) / spacing) + 1 + Nlines = max(int((x2 - x1) / spacing) + 1, self.minNbar) + xVals = np.linspace(x1, x2, Nlines) q1, q2 = self.loadBox.fout diff --git a/src/postprocess/plot.py b/src/postprocess/plot.py index 12c90a8..d14a774 100644 --- a/src/postprocess/plot.py +++ b/src/postprocess/plot.py @@ -466,8 +466,6 @@ def plotRotation2D(beam:Beam, scale=1000, yunit = 'mRad', **kwargs): return plotDisp2D(beam, ind, scale, yunit= yunit, **kwargs) - - def plotPOI(fig, ax, xcoords, force, labels, filteredPoiInd): labelX = []