Making objects easier to create #255
Replies: 2 comments 4 replies
-
Hi, Thanks for the feedback. When developing the API, we'd like to stick to the logic of RFEM 6 itself. In my opinion, if we start to create these shortcuts, our library will be more and more complex and will be hard to understand for structural engineers. But of course, there is no limitation for your creativitiy 😄 For example a simple function like below could work. def easyMember(firstNode, secondNode, material, section):
# nodes
Node(1, firstNode[0], firstNode[1], firstNode[2])
Node(2, secondNode[0], secondNode[1], secondNode[2])
# material
Material(1, material)
# section
Section(1, section, 1)
# member
Member(1, 1, 2, 0, 1, 1) If you want to contribute our library, it'd be good to go over the open issues and pull requests. |
Beta Was this translation helpful? Give feedback.
-
Hi @nathanvanthof , What would it look like when you want to use 1000 nodes each defined by 30 parameters. Would you rather use name like start_node_beam_3rd_row_5th_column_brace? I think not. Its easier to use id. Also, 3 coordinates quickly become magic numbers when you try to define more than 100 nodes. As @dogukankaratas said. The library would quickly become clouded with alternate ways to set up each object. That said, you can still define your own functions. It is just not applicable to wide range of use cases. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
I've recently followed the RFEM python training. One thing that struck me was that you have to quite meticulously follow which node/member has what number. In my opinion this will make code difficult to maintain further down the road when all the node numbers slowly become "magic" (similarly to how regex becomes kind of gibberish after looking away for 5 minutes).
I would like to be able to skip this. For instance, by creating a member with only passing 2 Node and 1 Section object. I've started off creating a new module which basically adds a very simple interfacing layer. But there's a lot of duplicate docstrings; I'm thinking it might be nicer to add the functionality straight to the existing objects, but I'm not sure if that would break any backwards compatibility issues.
On the other hand, it specifically states "There will be broken objects or adjustments affecting backward compatibility." so that's why I think it could be better to implement it there?
PS. I've done a fair bit of programming, but this would be the first time participating in open source. I'm pretty unaware of any conventions, so feel free to tell me if I'm doing this wrong
Beta Was this translation helpful? Give feedback.
All reactions