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

Enable FreeCAD to generate mesh in different formats #1

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

aakritisi
Copy link
Owner

No description provided.

@jedbrown
Copy link

This looks good in terms of content. I think the commits should be squashed and rebased (rather than merging from upstream) into atomic parts intended for review. And then we need to write out in the PR what changes are being made and why.

I'm having an issue actually generating and visualizing a mesh right now with this workflow, but I don't think it's your code.

@aakritisi
Copy link
Owner Author

I have created a PR in the main repo: FreeCAD#14667 (comment) . Will keep in mind to squash the commits for next time. Whats and whys are mentioned in the main PR. Not sure why you are not able to generate meshes, I was able to generate and visualize meshes using different file formats

}
else if (str == ".msh") {
ind = 3;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be an error instead of silently using the default.

node_ind = int(line_list[2])
if(int(line_list[3])- int(line_list[2]) + 1 == total_num_nodes):
contigous_numbered = True
elif (read_node is True) and (len(nodes) < total_num_nodes):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
elif (read_node is True) and (len(nodes) < total_num_nodes):
elif read_node and len(nodes) < total_num_nodes:

line_list = line.split(" ")
total_num_nodes = int(line_list[1])
node_ind = int(line_list[2])
if(int(line_list[3])- int(line_list[2]) + 1 == total_num_nodes):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like pylint is run in CI. Best to run that linting and formatting.

Comment on lines +88 to +89
while line != "":
line = f.readline()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's usually more idiomatic to for line in f.readlines()

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought of using for loop in this but seeing that while loop is being used for other file types, I wanted to keep the code consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants