Automate Reinforcement GSoC proposal
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- Suraj Dadral
- Posts: 307
- Joined: Fri Sep 07, 2018 5:32 pm
- Contact:
Re: Automate Reinforcement GSoC proposal
I have done all changes as suggested above. And UI file can be found in attachment.
Preview:
Clicking on button "Edit Number and Diameter" will open a new dialog box similar to "Rebar Distribution" dialog box
Regards,
Preview:
Clicking on button "Edit Number and Diameter" will open a new dialog box similar to "Rebar Distribution" dialog box
Regards,
- Attachments
-
- ColumnReinforcement.ui
- (16.11 KiB) Downloaded 78 times
Last edited by Suraj Dadral on Sun May 12, 2019 6:21 pm, edited 1 time in total.
- Suraj Dadral
- Posts: 307
- Joined: Fri Sep 07, 2018 5:32 pm
- Contact:
Re: Automate Reinforcement GSoC proposal
Thanks @amrit3701amrit3701 wrote: ↑Sun May 12, 2019 7:35 am
Instead of using QLineEdit fields, you should use our FreeCAD Gui::InputField, which supports units, expressions, etc. These should normally be in your QDesigner if you compiled the FreeCAD plugin for it.
See QDesigner plugin section: https://www.freecadweb.org/wiki/CompileOnUnix
https://github.com/FreeCAD/FreeCAD/tree ... ins/widget
I have compiled FreeCAD plugin for Qt Designer and now using this.
Regards,
- Suraj Dadral
- Posts: 307
- Joined: Fri Sep 07, 2018 5:32 pm
- Contact:
Re: Automate Reinforcement GSoC proposal
Dimension in images are estimated as @amrit3701 said here.hardeeprai wrote: ↑Sat May 11, 2019 11:13 pm
With respect to image attached, for dia 20, extension should be 20*bentFactor = 20*4 = 80, but you showed 80.24 and 80.21. Like wise 39.86 and 40.38 should be 40, if whatever you wrote is correct. How you put dimensions on image? Exact or these are estimated?
Done in new UI. I will modify script accordingly.hardeeprai wrote: ↑Sat May 11, 2019 11:13 pm
As per you: length of extended part of stirrup = (dia_of_stirrup) x (bentFactor)
Don't call it bentFactor, call it "extensionFactor".
I think I wrongly called dimension of length 40mm(estimated) as "rounding of stirrups" in image: https://forum.freecadweb.org/download/file.php?id=83413
If so, what is the name of that length?
Thanks,
- Suraj Dadral
- Posts: 307
- Joined: Fri Sep 07, 2018 5:32 pm
- Contact:
Re: Automate Reinforcement GSoC proposal
Hello @all
Today, I implemented the front end of UI (work in progress) and here are related commits: commit1, commit2
Code of ColumnReinforcement.py file:
UI preview:
Please review and give your suggestions:
Thanks,
Today, I implemented the front end of UI (work in progress) and here are related commits: commit1, commit2
Code of ColumnReinforcement.py file:
Code: Select all
from RebarDistribution import runRebarDistribution, removeRebarDistribution
from Rebarfunc import getSelectedFace
from PySide import QtGui
import FreeCADGui
import os
class _ColumnTaskPanel:
def __init__(self, Rebar=None):
self.customSpacing = None
if not Rebar:
selected_obj = FreeCADGui.Selection.getSelectionEx()[0]
self.SelectedObj = selected_obj.Object
self.FaceName = selected_obj.SubElementNames[0]
else:
self.FaceName = Rebar.Base.Support[0][1][0]
self.SelectedObj = Rebar.Base.Support[0][0]
self.form = FreeCADGui.PySideUic.loadUi(os.path.splitext(__file__)[0] + ".ui")
self.form.setWindowTitle(
QtGui.QApplication.translate("RebarAddon", "Column Reinforcement", None)
)
self.form.image.setPixmap(
QtGui.QPixmap(
os.path.split(os.path.split(os.path.abspath(__file__))[0])[0]
+ "/icons/Column_CustomConfiguration.png"
)
)
self.addDropdownMenuItems()
self.connectSignalSlots()
def addDropdownMenuItems(self):
self.form.columnConfiguration.addItems(
["Custom Configuration", "SingleTieFourRebars"]
)
self.form.bentAngle.addItems(["90", "135"])
self.form.mainRebarType.addItems(["StraightRebar", "LShapeRebar"])
self.form.x_dirRebarType.addItems(["StraightRebar", "LShapeRebar"])
self.form.y_dirRebarType.addItems(["StraightRebar", "LShapeRebar"])
def connectSignalSlots(self):
self.form.columnConfiguration.currentIndexChanged.connect(
self.changeColumnConfiguration
)
self.form.amount_radio.clicked.connect(self.amount_radio_clicked)
self.form.spacing_radio.clicked.connect(self.spacing_radio_clicked)
self.form.customSpacing.clicked.connect(lambda: runRebarDistribution(self))
self.form.removeCustomSpacing.clicked.connect(
lambda: removeRebarDistribution(self)
)
self.form.PickSelectedFace.clicked.connect(lambda: getSelectedFace(self))
def getStandardButtons(self):
return (
int(QtGui.QDialogButtonBox.Ok)
| int(QtGui.QDialogButtonBox.Apply)
| int(QtGui.QDialogButtonBox.Cancel)
| int(QtGui.QDialogButtonBox.Help)
| int(QtGui.QDialogButtonBox.Reset)
)
def changeColumnConfiguration(self):
column_configuration = self.form.columnConfiguration.currentText()
if column_configuration == "Custom Configuration":
self.form.image.setPixmap(
QtGui.QPixmap(
os.path.split(os.path.split(os.path.abspath(__file__))[0])[0]
+ "/icons/Column_CustomConfiguration.png"
)
)
# if self.form.columnConfiguration.oldText() == "SingleTieFourRebars":
self.showXdirRebarsForm()
self.showYdirRebarsForm()
elif column_configuration == "SingleTieFourRebars":
self.form.image.setPixmap(
QtGui.QPixmap(
os.path.split(os.path.split(os.path.abspath(__file__))[0])[0]
+ "/icons/Column_SingleTieFourRebars.png"
)
)
self.hideXdirRebarsForm()
self.hideYdirRebarsForm()
def amount_radio_clicked(self):
self.form.spacing.setEnabled(False)
self.form.amount.setEnabled(True)
def spacing_radio_clicked(self):
self.form.amount.setEnabled(False)
self.form.spacing.setEnabled(True)
def hideXdirRebarsForm(self):
self.form.x_dirRebarsWidget.hide()
def hideYdirRebarsForm(self):
self.form.y_dirRebarsWidget.hide()
def showXdirRebarsForm(self):
self.form.x_dirRebarsWidget.show()
def showYdirRebarsForm(self):
self.form.y_dirRebarsWidget.show()
Please review and give your suggestions:
Thanks,
Re: Automate Reinforcement GSoC proposal
just would like to throw in we gone use two or three stirrups quite often ... See attached pic ... This is some real drawing just some weeks old ...
- hardeeprai
- Posts: 177
- Joined: Sun May 23, 2010 2:41 pm
- Location: Ludhiana, Punjab, India
- Contact:
Re: Automate Reinforcement GSoC proposal
Yes, I would like to do that way.
Agree. A beginner or casual user may like that, but for heavy user, entering data, the way I suggested will be very efficient.
If both ways we can have, then that will be great.
--
H.S.Rai
H.S.Rai
- Suraj Dadral
- Posts: 307
- Joined: Fri Sep 07, 2018 5:32 pm
- Contact:
Re: Automate Reinforcement GSoC proposal
Thanks @bernd
It is there in my project proposal.
Image: https://www.freecadweb.org/wiki/File:Co ... types1.png
Regards,
- hardeeprai
- Posts: 177
- Joined: Sun May 23, 2010 2:41 pm
- Location: Ludhiana, Punjab, India
- Contact:
Re: Automate Reinforcement GSoC proposal
"@" is normally used for spacing, “ϕ” or "#" is used for diameter. So better in above replace @ with #.Suraj Dadral wrote: ↑Sat May 11, 2019 3:18 pmSo, we will take input for diameter and amount of rebars as:
Amount@Diameter: amount@diameter + amount@diameter + amount@diameter
In your post https://forum.freecadweb.org/viewtopic. ... 90#p307712 and in image https://forum.freecadweb.org/download/file.php?id=83472 use Number in place of Amount in 7th option under ties ( i.e. Radio button Amount | Spacing ).
--
H.S.Rai
H.S.Rai
- hardeeprai
- Posts: 177
- Joined: Sun May 23, 2010 2:41 pm
- Location: Ludhiana, Punjab, India
- Contact:
Re: Automate Reinforcement GSoC proposal
@bernd
Which tool you are using to produce such drawings?
--
H.S.Rai
H.S.Rai
- Suraj Dadral
- Posts: 307
- Joined: Fri Sep 07, 2018 5:32 pm
- Contact:
Re: Automate Reinforcement GSoC proposal
OK, I will enable field "Number@Diameter" in UI.hardeeprai wrote: ↑Mon May 13, 2019 12:58 pmYes, I would like to do that way.
Agree. A beginner or casual user may like that, but for heavy user, entering data, the way I suggested will be very efficient.
If both ways we can have, then that will be great.
So that user can either directly enter field or use button instead.
Thanks,