Dev logs of Rebar Addon for FreeCAD - GSoC project

Contributions from the participants, questions and answers to their projects.
Discussions of proposals for upcoming events.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Dev logs of Rebar Addon for FreeCAD - GSoC project

Post by ebrahim raeyat »

for solids that aren't in X, Y or Z direction, that seems it get wrong location for reinforcement:
rebar.png
rebar.png (51.37 KiB) Viewed 1789 times
freecad .18, python 3, pyqt5, manjaro linux, conda build
User avatar
hardeeprai
Posts: 177
Joined: Sun May 23, 2010 2:41 pm
Location: Ludhiana, Punjab, India
Contact:

list index out of range

Post by hardeeprai »

I can put straight rebars.

But on putting vertical straight rebars or stirrups, I am getting
error: Out of range.

What solution can be there?

See below signature.

Issue is same on FreCAD.17 on Linux, but it works fine on .18 (not testing on .17, but expected that it will work) on MSWindows.

My system is:

OS: Ubuntu 16.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15215 (Git)
Build type: Release
Branch: master
Hash: 54799368944d408a09fcdde41f89f20d282a9b8a
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)

--
H.S.Rai
.Org.Com
http://hsrai.wordpress.com/

File "/home/hsrai/.FreeCAD/Mod/Reinforcement/Stirrup.py", line 151, in clicked
self.accept(button)
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/Stirrup.py", line 175, in accept
rounding, True, amount, self.SelectedObj, self.FaceName)
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/Stirrup.py", line 220,
in makeStirrup
FacePRM = getParametersOfFace(structure, facename, False)
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/Rebarfunc.py", line
166, in getParametersOfFace
x = face_center_pt[0]
<type 'exceptions.IndexError'>: list index out of range
Traceback (most recent call last):
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/Stirrup.py", line 151, in clicked
self.accept(button)
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/Stirrup.py", line 175, in accept
rounding, True, amount, self.SelectedObj, self.FaceName)
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/Stirrup.py", line 220,
in makeStirrup
FacePRM = getParametersOfFace(structure, facename, False)
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/Rebarfunc.py", line
166, in getParametersOfFace
x = face_center_pt[0]
<type 'exceptions.IndexError'>: list index out of range
Traceback (most recent call last):
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/Stirrup.py", line 175, in accept
rounding, True, amount, self.SelectedObj, self.FaceName)
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/Stirrup.py", line 220,
in makeStirrup
FacePRM = getParametersOfFace(structure, facename, False)
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/Rebarfunc.py", line
166, in getParametersOfFace
x = face_center_pt[0]
<type 'exceptions.IndexError'>: list index out of range
Traceback (most recent call last):
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/StraightRebar.py", line
134, in clicked
self.accept(button)
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/StraightRebar.py", line
154, in accept
rebar = makeStraightRebar(f_cover, (coverAlong, cover), rt_cover,
lb_cover, diameter, True, amount, orientation, self.SelectedObj,
self.FaceName)
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/StraightRebar.py", line
208, in makeStraightRebar
FacePRM = getParametersOfFace(structure, facename)
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/Rebarfunc.py", line
167, in getParametersOfFace
y = face_center_pt[1]
<type 'exceptions.IndexError'>: list index out of range
Traceback (most recent call last):
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/StraightRebar.py", line
154, in accept
rebar = makeStraightRebar(f_cover, (coverAlong, cover), rt_cover,
lb_cover, diameter, True, amount, orientation, self.SelectedObj,
self.FaceName)
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/StraightRebar.py", line
208, in makeStraightRebar
FacePRM = getParametersOfFace(structure, facename)
File "/home/hsrai/.FreeCAD/Mod/Reinforcement/Rebarfunc.py", line
167, in getParametersOfFace
y = face_center_pt[1]
<type 'exceptions.IndexError'>: list index out of range
User avatar
amrit3701
Posts: 343
Joined: Mon Jun 13, 2016 5:37 pm

Re: Dev logs of Rebar Addon for FreeCAD - GSoC project

Post by amrit3701 »

ebrahim raeyat wrote: Mon Oct 08, 2018 7:21 pm Thank you amrit for your great work. I am very interesting to it. is there any effort to port reinforcement to python3 and pyqt5?
very thanks.
Yeah! I am working on this issue. I will give updates soon.

Thanks,
Amritpal Singh
Github, Like my work, sponsor me!
User avatar
amrit3701
Posts: 343
Joined: Mon Jun 13, 2016 5:37 pm

Re: Dev logs of Rebar Addon for FreeCAD - GSoC project

Post by amrit3701 »

ebrahim raeyat wrote: Mon Oct 08, 2018 9:21 pm for solids that aren't in X, Y or Z direction, that seems it get wrong location for reinforcement:

rebar.png

freecad .18, python 3, pyqt5, manjaro linux, conda build
At initial, this addon was mainly created for vertical and horizontal structural element (as this type of structure are in most of the cases). But you are right. Rebars can hold its position in any structure either it is horizontal, vertical or inclined at some angle. However, this problem can be solved if we constraint the sketch with structure face but because of a topological naming problem we cannot choose this path. So, we have to think something better.
Amritpal Singh
Github, Like my work, sponsor me!
User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Dev logs of Rebar Addon for FreeCAD - GSoC project

Post by ebrahim raeyat »

amrit3701 wrote: Sat Nov 17, 2018 3:52 pm
Yeah! I am working on this issue. I will give updates soon.

Thanks,
@amrit it works with command line and therefore it didn't have any problem with python3, but some minor change need for pyqt5 to work and show panel.

Thanks.
User avatar
amrit3701
Posts: 343
Joined: Mon Jun 13, 2016 5:37 pm

Re: Dev logs of Rebar Addon for FreeCAD - GSoC project

Post by amrit3701 »

ebrahim raeyat wrote: Sat Nov 17, 2018 5:59 pm @amrit it works with command line and therefore it didn't have any problem with python3, but some minor change need for pyqt5 to work and show panel.

Thanks.
Congratulations guys!, now rebar addon supports QT5 and Python3. You may try this.

Thanks,
Amritpal Singh
Github, Like my work, sponsor me!
User avatar
amrit3701
Posts: 343
Joined: Mon Jun 13, 2016 5:37 pm

Re: list index out of range

Post by amrit3701 »

hardeeprai wrote: Sat Nov 17, 2018 3:07 pm I can put straight rebars.

But on putting vertical straight rebars or stirrups, I am getting
error: Out of range.

What solution can be there?

See below signature.

Issue is same on FreCAD.17 on Linux, but it works fine on .18 (not testing on .17, but expected that it will work) on MSWindows.
I have fixed this issue. Commit: https://github.com/amrit3701/FreeCAD-Re ... 829dd649bb

Thanks,
Amritpal Singh
Github, Like my work, sponsor me!
User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Dev logs of Rebar Addon for FreeCAD - GSoC project

Post by ebrahim raeyat »

amrit3701 wrote: Sun Dec 02, 2018 4:03 pm
Congratulations guys!, now rebar addon supports QT5 and Python3. You may try this.

Thanks,
Very thanks. It works perfectly. thanks you so much
Post Reply