Dessia-tech / volmdlr

A python VOLume MoDeLeR computations-oriented with STEP support for import/export
GNU Lesser General Public License v2.1
26 stars 10 forks source link

refactor Shell3D.get_geo_lines #1157

Open WirajanDASILVA opened 9 months ago

WirajanDASILVA commented 9 months ago

before doing any refactor, it is recommended to create some tests for .geo files, so you are sure to have the same functionality at the and.

The first part of the code can be separated into one method. It searches to save all shell points on a list, as well as its face edges, in a way there is no repeated edges not matter the direction. image

Then there is this part of the code, that can be simplified by updating the get_geo_lines method for each edge (circle, bspline, linesegment, arc, etc...) such that the get_geo_line_methods receives as arguments the points list, line_account and point_acount. Inside each edge class, there would be a get_geo_lines_tags to define what tags are appropriate for each edge. as the example shown below

image Screenshot 2023-11-23 at 10 46 48

Other improvements: simplify loops, eliminate unused enumerate...