Dev logs of Rebar Addon for FreeCAD - GSoC project

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
thschrader
Posts: 1416
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

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

Postby thschrader » Wed Jul 12, 2017 8:49 am

Amrit,
as info on "custom-spacing":
front/side cover initially was set to 100 mm, after running "custom-spacing",
front cover seems to remain at 100 mm, side cover seems to be a bigger value.
slab was taken from arch-structure predefined.
regards thomas
slab_test.FCStd
(18.6 KiB) Downloaded 17 times
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11528 (Git)
Build type: Release
Branch: master
Hash: d31be3117de386b4f6cd3444e0b330db56dc6ba2
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
slab_test.PNG
slab_test.PNG (293.63 KiB) Viewed 676 times
User avatar
amrit3701
Posts: 234
Joined: Mon Jun 13, 2016 5:37 pm

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

Postby amrit3701 » Wed Jul 12, 2017 11:14 am

yorik wrote:
Yorik, I have noticed one more thing in the Rebar addon. I don't know it's a bug of rebar addon or FreeCAD. For eg. after opening .fcstd file in which reinforcement is created with rebar addon (https://forum.freecadweb.org/download/file.php?id=40127) and when I try to change properties of rebar from rebar addon dialog box it gave below error:

Code: Select all

Traceback (most recent call last):
  File "<string>", line 1, in <module>
<type 'exceptions.IOError'>: The project '/home/ambu/Desktop/slab_test.FCStd' is already open!
Exception (Wed Jul 12 16:26:40 2017): Sketch::checkGeoId. GeoId index out range.  
Traceback (most recent call last):
  File "/home/ambu/.FreeCAD/Mod/Reinforcement/StraightRebar.py", line 89, in accept
    editStraightRebar(self.Rebar, f_cover, b_cover, s_cover, diameter, True, amount, self.SelectedObj, self.FaceName)
  File "/home/ambu/.FreeCAD/Mod/Reinforcement/StraightRebar.py", line 171, in editStraightRebar
    sketch.movePoint(0, 1, points[0], 0)
<class 'Base.FreeCADError'>: Sketch::checkGeoId. GeoId index out range.
But this error will overcome if I double click on the sketch object and then if I change properties of rebar object from rebar dialog box it will works file. Can you tell why this error occurred?

Regards,
User avatar
amrit3701
Posts: 234
Joined: Mon Jun 13, 2016 5:37 pm

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

Postby amrit3701 » Wed Jul 12, 2017 11:36 am

thschrader wrote:
Wed Jul 12, 2017 8:49 am
Amrit,
as info on "custom-spacing":
front/side cover initially was set to 100 mm, after running "custom-spacing",
front cover seems to remain at 100 mm, side cover seems to be a bigger value.
slab was taken from arch-structure predefined.
Sorry, but I unable to get. It will be better if you can explain error a bit more or may explain through a screencast.

Regards,
User avatar
amrit3701
Posts: 234
Joined: Mon Jun 13, 2016 5:37 pm

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

Postby amrit3701 » Wed Jul 12, 2017 11:49 am

Kunda1 wrote:
Tue Jul 11, 2017 6:36 pm
amrit, do you think there is a necessity to create unit-tests for the Rebar addon ?
I think currently I should focus more on different rebar shapes but I will do it later.

Regards,
User avatar
Kunda1
Posts: 5505
Joined: Thu Jan 05, 2017 9:03 pm

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

Postby Kunda1 » Wed Jul 12, 2017 11:59 am

amrit3701 wrote:
Wed Jul 12, 2017 11:49 am
Kunda1 wrote:
Tue Jul 11, 2017 6:36 pm
amrit, do you think there is a necessity to create unit-tests for the Rebar addon ?
I think currently I should focus more on different rebar shapes but I will do it later.

Regards,
Sweet. Thanks!
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
thschrader
Posts: 1416
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

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

Postby thschrader » Wed Jul 12, 2017 3:01 pm

amrit3701 wrote:
Wed Jul 12, 2017 11:36 am
Sorry, but I unable to get. It will be better if you can explain error a bit more or may explain through a screencast.
Regards,
Amrit,
I did the following:
Step 1: Goto Arch-WB, select green face on slab, activate "straight-rebar" dialog.
Step 2: first initial settings front/side cover =100 mm, bottom 80 mm, diameter 12 mm, amount 10 (as a start...) Click OK
Result: (set transparency to 80) 10 bars are generated. Front/side cover is equal as given in dialog. rebar position is at the
bottom of slab (? maybe I misunderstood input dialog). Never mind. With rebar placement z=+80 mm lift the rebars up.
Then acivate rebar sketch, pick the right node and stretch rebar outside the slab.
Step 3: doublick rebar in tree, dialog opens with previous parameters. activate "spacing", then "custom-spacing).
I want 6 rebars dist=50 mm in segment 1, 6 rebar dist=180 mm in segment 2, segment 3=segment1. And I want that front/side
cover is equal! Hit ok, see result: distance is unequal
. Is that a bug or your intention.
regards thomas (the attachment drives me crazy, sorry for scrambling...)
Attachments
rebars_moved_up_and_stretched.PNG
rebars_moved_up_and_stretched.PNG (22.31 KiB) Viewed 608 times
result.PNG
result.PNG (27.29 KiB) Viewed 608 times
step3.PNG
step3.PNG (71.94 KiB) Viewed 608 times
step2.PNG
step2.PNG (42.43 KiB) Viewed 608 times
step1.PNG
step1.PNG (8.54 KiB) Viewed 608 times
thschrader
Posts: 1416
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

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

Postby thschrader » Wed Jul 12, 2017 3:13 pm

amrit,
I forgot the file. man...
slab_test_explanation.FCStd
(18.34 KiB) Downloaded 13 times
..
done with
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11528 (Git)
Build type: Release
Branch: master
Hash: d31be3117de386b4f6cd3444e0b330db56dc6ba2
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
User avatar
yorik
Site Admin
Posts: 11514
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

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

Postby yorik » Wed Jul 12, 2017 3:25 pm

Great job Amritpal!
Screenshot from 2017-07-12 12-13-41.png
Screenshot from 2017-07-12 12-13-41.png (103.21 KiB) Viewed 601 times
The "custom spacing" button is only available when editing the rebar, not when creating it, is that normal?

About the unit tests, there is one for the rebar object already, so I don't think it is absolutely necessary to add more. Up to you to see that later.

About your error, I don't really know... There have been changes in underlying geometry objects recently, maybe some new bugs have appeared. I'll see if I can narrow things down
User avatar
regis
Posts: 655
Joined: Sun Jul 12, 2015 8:17 am
Contact:

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

Postby regis » Wed Jul 12, 2017 4:05 pm

amrit3701 wrote:
Tue Jul 11, 2017 5:13 pm
regis wrote:
Tue Jul 11, 2017 4:52 pm
amazing news amazing work.
Thanks,

Is it works on your system now?

Regards,
Yes as you suggested it works on my system when I use the normal structure, but it doesn't work from when the structure is derived from a wire. But i'm wondering why should the rebar only be derived from the structure and not other arch objects like walls or any other shape for that matter? could there be an option to check a box to enable and disable that feature? It will continue the philosophy of freecad unlike other BIM products that, any shape can be converted into any other useful object, like a wall can now be a structure vice versa. Just my natural User Experience feel.
Also I was wondering, what are the possibilities for a rebar to be created just from a wire. a little bit like the pipe tool in a way, that will a allow any wire sketch to be converted into rebar and not only depend on a flat face sketch.
Just some things i'm wondering about feasibility and implementation.
So far, good job on your progress, they are looking really good.

much regards,

Regis
User avatar
amrit3701
Posts: 234
Joined: Mon Jun 13, 2016 5:37 pm

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

Postby amrit3701 » Wed Jul 12, 2017 6:29 pm

thschrader wrote:
Wed Jul 12, 2017 3:01 pm
Amrit,
I did the following:
Step 1: Goto Arch-WB, select green face on slab, activate "straight-rebar" dialog.
Step 2: first initial settings front/side cover =100 mm, bottom 80 mm, diameter 12 mm, amount 10 (as a start...) Click OK
Result: (set transparency to 80) 10 bars are generated. Front/side cover is equal as given in dialog. rebar position is at the
bottom of slab (? maybe I misunderstood input dialog). Never mind. With rebar placement z=+80 mm lift the rebars up.
Then acivate rebar sketch, pick the right node and stretch rebar outside the slab.
Step 3: doublick rebar in tree, dialog opens with previous parameters. activate "spacing", then "custom-spacing).
I want 6 rebars dist=50 mm in segment 1, 6 rebar dist=180 mm in segment 2, segment 3=segment1. And I want that front/side
cover is equal! Hit ok, see result: distance is unequal
. Is that a bug or your intention.
regards thomas (the attachment drives me crazy, sorry for scrambling...)
It's not a bug. ;)

Let me explain in detail.
We have a structural element whose width has 2000 mm and rebar is to be distributed along width of that element. We have also assigned rebar start and end offset values to 100 mm. Now, actual length left for placing rebars is 1800 mm (2000 - OffsetStart - OffsetEnd).

According to the inputs given by you in the rebar distribution dialog box, the custom spacing string is "6@50+6@180+6@50" and according to that, your rebars covers only 1630 mm length.

Following is how rebars distributed length is calculate from custom spacing string:
1. Length of first segment: 25+50+50+50+50+50 = 25+50*5 = 275 mm
2. Length of second segment: 180+180+180+180+180+180 = 180*6 = 1080 mm
3. Length of third segment: 50+50+50+50+50+25 = 50*5+25 = 275 mm
Total length covered: 275+1080+275 = 1630 mm

But actual length available is 1800 mm hence, 170 mm (1800-1630) spacing left from the end offset.

In the dialog box, look carefully at: "n@s (give either n or s)”. As it is saying, you need to provide input either for n or s, but not both because one value automatically determines other.

Given below are a few screenshots:
1. When the spacing is 180 mm and amount is 0 of segment 2.
rebardistributionexp1.png
rebardistributionexp1.png (317.49 KiB) Viewed 569 times

Output:
rebardistributionexp2.png
rebardistributionexp2.png (249.33 KiB) Viewed 569 times

2. When amount is 6 and spacing is 0 mm of segment 2.
rebardistributionexp3.png
rebardistributionexp3.png (287.13 KiB) Viewed 569 times

Output:
rebardistributionexp4.png
rebardistributionexp4.png (242.59 KiB) Viewed 569 times

But if you know the syntax of custom spacing you can do more fun with that. :D Also, read the below posts. It will help you to learn custom spacing syntax.
https://forum.freecadweb.org/viewtopic. ... 50#p181428
https://forum.freecadweb.org/viewtopic. ... 30#p180510

Regards,