ebrahim raeyat wrote: ↑Wed Dec 16, 2020 7:24 am
Thanks @Suraj Dadral. You right. it is a true solution. but I think we can add some helper function like get_ushape_rebar_edges and so on and call these in getUShapeRebarSVGData (get*SVG). this way, the code didn't need to change, is it possible? I say this only for speed performance in large files and the zen of python. each function must do one and exactly one thing.
thanks.
In above, I am assuming that get_ushape_rebar_edges() will return only visible edges (Right?).
In function getUShapeRebarSVGData(), to check if an edge is visible or not, I first generated SVG of each edge and then checked for each edge having unique svg is visible.
So, if we need get_ushape_rebar_edges() should only return visible edges and if we are not going to change above logic of finding visible edges, then its better to return visible edges from getUShapeRebarSVGData() function.
Otherwise we will be first generating svg of each edge in get_ushape_rebar_edges() function to find visible edges and then again generating svg of each edge in getUShapeRebarSVGData(), which will degrade performance.
If get_ushape_rebar_edges() should return all edges of rebar, then we can surely refactor getUShapeRebarSVGData() function.
Thanks,