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!
User avatar
bernd
Posts: 9841
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

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

Postby bernd » Sun Jul 02, 2017 10:16 am

amrit3701 wrote:
Sun Jul 02, 2017 7:26 am
bernd wrote:
Sat Jul 01, 2017 8:19 pm
great. If a Part --> Box is used as a Base object for the Arch Struct the rebars should be in I get an error message saying
Good test, now I will add support to my addon when structural element is derived from Part object.

Can you list all a base objects from where structural element is derived?
Any object that could be used a base for Arch structural. As far as I know any object that holds Shape. But Yorik does know this any better than me.
User avatar
bernd
Posts: 9841
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

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

Postby bernd » Sun Jul 02, 2017 10:17 am

Gave the strirups a try. See attached picture. We should be able to change this length somehow.
screen.jpg
screen.jpg (32.53 KiB) Viewed 866 times
User avatar
bernd
Posts: 9841
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

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

Postby bernd » Sun Jul 02, 2017 11:09 am

made some small real rebar test. Attached the file of a simple column rebar, no special stuff. YEAH I did it, I'm quite happy, because there is no OpenSource software around cappable of doing this. :D I just would need the material bill and it could be used in real world. We really need to attract the material bill. Is a simple material bill part of the GSoC project too? I can not exactly remember.

I had the same problem chakkree has with the spaces. I had to use the amount for input and play as long as the space was what I would like to had it.

It took me more than an hour. If I would do this ten times I may could do it in 15 minutes but a draftsman in our office would need less than 5 minutes in Allplan to make the model. I ended up in having a crazy big tree in FreeCAD. I have 2 rebar types and one structural column. The tree has 9 structural objects and 5 rebar objects. It needs to be easier somehow. May be I did use the tools the wrong way.

cheers bernd


column-rebar.fcstd
(91.22 KiB) Downloaded 26 times

screen.jpg
screen.jpg (89.42 KiB) Viewed 860 times
User avatar
bernd
Posts: 9841
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

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

Postby bernd » Sun Jul 02, 2017 11:27 am

For me the stirrup intersects. See attached screen. I would rather let there be 1 mm or 2 air between them. Just to be sure not to have an intersection.

Bernd


screen.jpg
screen.jpg (97.55 KiB) Viewed 853 times
User avatar
amrit3701
Posts: 279
Joined: Mon Jun 13, 2016 5:37 pm

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

Postby amrit3701 » Sun Jul 02, 2017 7:29 pm

yorik wrote:
Fri Jun 30, 2017 3:22 pm
2) Allow the user to change the selected face once the task dialog is running (for ex. in case he picked the wrong one, or, later on, if things need to be fixed later on, which can always happen while TopoNaming is untrustable). I believe you would simply need to add a "pick selected face" button.
I have implemented "pick selected face" button in Straight Rebar. I also used a selection gate so that user can't select any other elements of the structural except faces. Can you tell how I can disable standard buttons when "pick selected face" button is in active state?

Also when change the support of sketch to some another face and recompute it. Then it gave a given below erorr:

Code: Select all

Document::recompute: The graph must be a DAG.
I unable to understand this error. Can you explain it in simple?

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

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

Postby amrit3701 » Mon Jul 03, 2017 9:22 am

bernd wrote:
Sun Jul 02, 2017 10:17 am
Gave the strirups a try. See attached picture. We should be able to change this length somehow.
Yes, I know but I made stirrup as per according to SP 34 (https://archive.org/stream/gov.in.is.sp ... 8/mode/1up). In that, they defined bent length is equal to k*phi (i.e. rounding*diameter). Please let me know I am missing something.

Regards,
User avatar
bernd
Posts: 9841
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

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

Postby bernd » Mon Jul 03, 2017 11:48 am

amrit3701 wrote:
Mon Jul 03, 2017 9:22 am
bernd wrote:
Sun Jul 02, 2017 10:17 am
Gave the strirups a try. See attached picture. We should be able to change this length somehow.
Yes, I know but I made stirrup as per according to SP 34 (https://archive.org/stream/gov.in.is.sp ... 8/mode/1up). In that, they defined bent length is equal to k*phi (i.e. rounding*diameter). Please let me know I am missing something.
You are not missing anything, but any national standard could define it different, and may be an engineer could may be make it even different than the standard defines it. https://www.ethz.ch/content/dam/ethz/sp ... HS2016.pdf page 7 in switzerland is 5*diameter minimum 50 mm
User avatar
amrit3701
Posts: 279
Joined: Mon Jun 13, 2016 5:37 pm

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

Postby amrit3701 » Tue Jul 04, 2017 2:05 pm

bernd wrote:
Mon Jul 03, 2017 11:48 am
You are not missing anything, but any national standard could define it different, and may be an engineer could may be make it even different than the standard defines it. https://www.ethz.ch/content/dam/ethz/sp ... HS2016.pdf page 7 in switzerland is 5*diameter minimum 50 mm
Okay. Now I have added a new property in the Stirrup i.e. Bent Factor. Bent Factor defines the bent length of a Stirrup by using formula "bentFactor*diamter".

Regards,
User avatar
yorik
Site Admin
Posts: 11859
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 » Tue Jul 04, 2017 4:13 pm

amrit3701 wrote:
Sun Jul 02, 2017 7:26 am
Can you list all a base objects from where structural element is derived?
bernd wrote:
Sun Jul 02, 2017 10:16 am
Any object that could be used a base for Arch structural.
Indeed. You can use the "native" Arch Structure, that calculates a shape itself, but if the base shape of any Arch object (including Structures) contains solids, that base shape is used "as is" by the Arch object, no shape calculation is done. So this can indeed be anything, any object created by any other FreeCAD workbench, or even imported from another application.

So the only certainties you can have is 1) your object is solid (but it can have more than one solid) and 2) you have a base face, because the user has selected one. All the rest could be anything. That's basically why we calculate the "span" of the object by the method you saw (projecting it onto an axis), so the shape of our object doesn't matter.
amrit3701 wrote:
Sun Jul 02, 2017 7:29 pm
I have implemented "pick selected face" button in Straight Rebar. I also used a selection gate so that user can't select any other elements of the structural except faces. Can you tell how I can disable standard buttons when "pick selected face" button is in active state?
You implementation is a good way, there is also another way which is simpler: Instead of creating a system for the user to pick a new face, you could expect the user to already have selected the new face when clicking the button. So there is no selection callback + gate mechanism to implement, you just need to check that the selection contains a face.

I don't think there's an easy way to disable those buttons.
amrit3701 wrote:
Sun Jul 02, 2017 7:29 pm
Document::recompute: The graph must be a DAG.
This is a very common FreeCAD problem: You cannot have circular dependencies (object A depends on object B which depends on object A, that's circular). A DAG is a tree structure that doesn't contain any of those (mandatory in FreeCAD). What I think must happen in your case is that:

- The structure depends on a Rebar (because it is listed in its "Armatures" property)
- The rebar depends on a sketch
- The sketch depends on the structure (it probably has it in its Support property)

That is the problem I was trying to solve with the creation of an additional Structure object.

I have an new idea to circumvent the problem, which actually might be mature enough to test now, is to get rid of the Armatures property. In other words, the structure doesn't know anymore of its rebars. It is the rebar that knows which structure it is attached to.

That means basically:

- We get rid of the Armature property in Structures
- We add a new property "Host" for example, to Rebars

The everywhere the old Armatures system was used must be changed:

- makeRebar() functon must be changed.
- ViewProviderStructure.claimChildren() must be changed
- ArchComponent.ComponentTaskPanel must be changed

These two last function will become a bit slower, because now they will need to run a small "query" to find out which rebars are hosted in themselves, but that shouldn't be too noticeable (it's just a matter of scanning the OutList).

I'll try to implement that between today and tomorrow...
User avatar
yorik
Site Admin
Posts: 11859
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 » Thu Jul 06, 2017 12:08 am

Ok the change described above is now done in git commit cab3358ee

What changes:

- The Structure object doesn't have an "Armatures" property anymore
- The Rebar object now has a "Host" property
- It is not mandatory anymore for the Rebar object to have a host (I don't know what would be the use for this, but there is no reason to make it mandatory anyway).

For the end user, nothing will really change, apart that, if you want to add or remove a rebar to/from a structure, you now do that by changing the Rebar's Host property instead of changing the Structure. This is actually easier, as the Host property is directly editable in the property editor.

For the programmer, if you are using the makeRebar() function, nothing changes either (the new rebar will have its Host set automatically, like the Armature before)

So now the Arch option to "remove sketches dependencies" doesn't apply anymore to rebars. There is no more possibility to have a non-DAG. Let's test that for a while, and if it works well we change the Window as well. This doesn't look like, but would be a huge improvement!

Amritpal, I notice a small thing that must be changed in your code, in rebarfunc.py at L143. I don't really know why that line is there, so I let you see what to do...