How piping macros are made
Jump to navigation
Jump to search
Ruslan's way:
This is a rough description of my work flow.
- At first, I realize that I do an annoying repetitive task. Repetitive has two meanings: first, you will perform this task multiple times; second, the task is performed by multiple people with different parameters.
- I think about geometry and possible geometries. I try not to reinvent the wheel and stick to parameters given by manufactures as much as possible.
- I think about number of parameters. Try to use as view parameters as possible.
- Often I literally make a back-of-the-envelope calculation. (Why waste paper for it?). I also have a little white board (Actually I have multiple, at my bed, at my desk... You never know when an idea will suddenly visit you and keep your mind in hostage until you write it down). I use the white board to make calculations which involve a lot of corrections. And no -- I do not write on glass surfaces, like Hollywood tries to suggest to you.
- I create a 2D-drawing in LibreCAD. I will use it for documentation and GUI later. I also look at it during programming.
- I take my recent macro, which is similar to my task remove GUI and Table parts and make a basic macro. A basic macro means, it creates a part with default parameters. Always have default parameters for testing. This process involves many experiments with python console of FreeCAD. Do not forget to switch on Report view from main Menu, for debugging and error messages: View->Panels->Report View.
- I add a "Table"-Feature to my macro. This involve reading a CSV-file and put corresponding parameters into basic macro and run the basic macro. I have some test function, which creates all the parts from my parameter tables. "add" means here, copy from the previous macro and adjust.
- Finally I add GUI to my macro.
- Modularity-schmodularity. Parts of my code are redundant, because I had problems to share code between macros in FreeCAD. But I hope to figure out how to fix it. A little advantage of non-modular structure is that one needs only a macro file create-xy.FCMacro and a table xy.csv to create a macro.
Example Pipe frame box for D3D printer
- I spent hours trying to make a frame box of PVC pipe. Moving parts precisely, when you do not see them properly is not very simple in FreeCAD. The pipes must be aligned to the internal structure of the corners. Even the frame-view is little bit confusing. Once you realized that you select a wrong corner or pipe in the middle of process, you need to do everything again. This is a annoying task. I need to perform it each time, I have another corner part or different pipe dimensions. Mixing metric units and the strange units (😉 + 😭) makes the process not easier. Because of availability of corner-parts and different box sizes, this task needs to be customized by any other developer. Each developer will perform this task.
- Number of parameters are: box dimensions in x, y and z direction, measured between the center lines of the pipes; corner dimension "G", which describes the distance from the corner "center" to the edge of a pipe; outer diameter of the pipe. All other dimensions, will be derived from them. Mechanically, you can have an more optimal structure If you select different pipe dimensions corresponding to different structural stresses. But too many different parts increase product complexity. We want to keep it simple and interchange parts if necessary.
- During thinking about the box I had an Idea about possible structural improvements, I write them down some where (Oh. There are so much place left on the envelope, I will use it!).