Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor Shell3D.get_geo_lines #1157

Open
1 of 3 tasks
WirajanDASILVA opened this issue Nov 23, 2023 · 0 comments
Open
1 of 3 tasks

refactor Shell3D.get_geo_lines #1157

WirajanDASILVA opened this issue Nov 23, 2023 · 0 comments
Assignees

Comments

@WirajanDASILVA
Copy link
Collaborator

  • I'm submitting a ...

    • bug report
    • feature request
    • refactor
  • What is the current behavior?
    Today the shell3d.get_geo_lines is very complex. Here are some suggestions to refactor it.

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...

  • branch: dev
  • commit:
  • python version: 3.9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants