I've written some code to make solid models of pipe fittings (tee, elbow, valves, etc) and am planning to use it in a program to automate the modelling of piping skids. I'm trying to work out in my head the best way to do it, but I'm having trouble concentrating on everything that needs to happen and how. Comments/suggestions would be helpful.
Basically, I want to have a script as the input that contains:
1. Vertices of the ends of pipe segments.
2. Connectivity information for each segment (e.g. segment 1 is vertex 1 to vertex 3).
3. List of what sizes/pieces are in each segment along with orientation. Each list will include a "filler" piece that will be the remainder of the length after adding things in, if needed.
In processing this script, the program should:
1. Infer what kind of fitting is at the meeting of pipe segments, e.g. if 1 point is connected to 3 other points, it'd be a tee.
2. Make sure sizes agree at each meeting/junction. This is one of the places I'm not sure about--should I just make sizes manual when I put the list of pieces in the script, or try to be smart about it and make an original size propagate throughout the model via changes (e.g. starting size is 2", I have a reducer in segment x that changes it to 1", everything after that will be 1"). Problem with this is that the piping doesn't just go one way, it splits and then rejoins and there's not a pattern, it'd have to be able to handle any combination of splits/rejoins. Seems like I should be able to make some sort of dependency tree here and do something efficient. Just not sure on what the data structure should look like and how I'd traverse it.
2. Calculate the correct orientation of each piece based on angles between the points (going to assume everything is orthogonal here, for now. I almost never need other piping angles).
3. Check to make sure the requested list of items will fit each segment
4. Create/place 3D models of junctions
5. Create/place 3D models of the list of items in between each junctions
Yeah, so I guess I'm looking for suggestions on step 2. Really brainfarting today.