A major upgrade to the section cutter tool, section cuts are now centered on the first and last location where they pass through constituent area geometry. An astute engineer in our office noticed that if the section cuts were not centered on the constituent area geometry, moment results could be quite skewed as ETABs reports moments about the center of the section cut, not the center of the cut geometry. Let's dig into the algorithm and code.
A new github repo has been created for the section cutter tool. This project has become big enough that it deserves it's own repo. The readme page also has install instructions.
The "Smart Sections Algorithm"
The algorithm to make "smart" sections was easy to do on paper, a bit harder to do by painstakingly describing every step to a computer. Let's get some visual aids to assist in outlining the algorithm.
Step 1 - Gather User Areas and Input Node. Example will be a simple square.
Note, I think the input node could be omitted, but it has remained in the section cutter tool for now.
Step 2 - Setup Local Coordinate System (LCS) based on input vector and starting point.
Here the LCS is rotated 45 degrees as shown by the blue rotated grid lines. Convert all constituent area geometry to the LCS. LCS coordinates in Red.
Step 3 - Generate an array lines in the LCS.
The previous section cutter tool would stop at this point. These results would be incorrect for buildings with steps, like an L shaped diaphragm.
Step 4 - Determine where lines generated in step 3 cross constituent geometry.
Use these points to create the section cuts in ETABs.
The main struggle on the coding side was controlling all the lists of data and maintaining their structure. The algorithm works for many areas and openings, so the amount of data that gets generated to perform these checks inflates quite quickly. To my surprise, the tool does not seem to struggle with generating all of the section cut data, the slowest part is still the analysis of the semi-rigid diaphragm.
Once again, chatGPT really helped out with the coding. The intersection function was exactly copied and pasted and it worked, how surprising!
Here is my chat with the AI overlord bot, THEY TOOK OUR JOBS! :
ChatGPT used an expression "out" that I had never seen before and it was super helpful. I still need to read up on "out" and "ref" in C#, but these seem to be ways to add additional function returns in C#.
Throwing this function into the main portion of the code, I was able to perform step 4 of the algorithm outlined above. Working in the LCS system was nice, allowing for easy manipulations of items that were perpendicular/parallel to the LCS. With the LCS point geometry known, it was easy to convert back into the GCS.
In addition to the main "smart sections" addition, a few features were added
- For Trenno, Imperial (kip, ft), freedom units, and Metric (kN, m), superior units, results.
- Section Cut plot at the bottom of the graphical user interface has been updated to look better.
- A few more data validations items on user input have been added
I have more updates I want to get around to listed on the github repo readme page. If you have suggestions/bugs, please let me know. Looking to make this better.