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

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

Post by bernd »

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
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

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

Post by bernd »

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 2401 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

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

Post by bernd »

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 60 times

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

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

Post by bernd »

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 2388 times
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 »

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,
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 »

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,
Amritpal Singh
Github, Like my work, sponsor me!
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

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

Post by bernd »

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: 343
Joined: Mon Jun 13, 2016 5:37 pm

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

Post by amrit3701 »

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,
Amritpal Singh
Github, Like my work, sponsor me!
User avatar
yorik
Founder
Posts: 13630
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

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

Post by yorik »

amrit3701 wrote: Sun Jul 02, 2017 7:26 amCan you list all a base objects from where structural element is derived?
bernd wrote: Sun Jul 02, 2017 10:16 amAny 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 pmI 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 pmDocument::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
Founder
Posts: 13630
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

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

Post by yorik »

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...
Post Reply