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

Adding check for splines #210

Closed
wants to merge 7 commits into from

Conversation

shimwell
Copy link
Collaborator

@shimwell shimwell commented Jun 5, 2024

Description

This PR adds a check on all the imported solids to see if there are splines present. If spines are present then a VaueError is raised and a message explaining the options is provided to the users.

Here is a screen shot of a cad geometry with spines being loaded and the error message

then the cad file gets loaded again with skip_solids=[0] and the load is successful

Screenshot 2024-06-05 130227

Fixes issue

fixes #201

Checklist

  • I'm making a PR from a feature branch on my fork into GEOUNED-org/GEOUNED/dev branch
  • I have followed PEP8 style guide for Python or run a formatter such as black or ruff format on my code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

@shimwell
Copy link
Collaborator Author

shimwell commented Jun 5, 2024

I see the CI is failing with STEP files that are in the repo already. It looks like now I've added a check for splines some of the step files in testing/inputSTEP are found to contain contain splines.

I shall improve the error message so we can see which files have splines

@shimwell
Copy link
Collaborator Author

shimwell commented Jun 5, 2024

Locally I'm seeing that these files contain splines

FAILED tests/test_convert.py::test_conversion[input_step_file5] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/placa2.stp
FAILED tests/test_convert.py::test_conversion[input_step_file7] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/cylBox.stp
FAILED tests/test_convert.py::test_conversion[input_step_file10] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/Misc/origSolid_0.stp
FAILED tests/test_convert.py::test_conversion[input_step_file11] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/Misc/PiezaDavid.stp
FAILED tests/test_convert.py::test_conversion[input_step_file13] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/Misc/origSolid_6.stp
FAILED tests/test_convert.py::test_conversion[input_step_file14] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/Misc/RJ24.stp
FAILED tests/test_convert.py::test_conversion[input_step_file15] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/Misc/sphereBarCyl1.stp
FAILED tests/test_convert.py::test_conversion[input_step_file17] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/Misc/P52.stp
FAILED tests/test_convert.py::test_conversion[input_step_file18] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/Misc/sphereBarCyl2.stp
FAILED tests/test_convert.py::test_conversion[input_step_file21] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/Misc/origSolid_1.stp
FAILED tests/test_convert.py::test_conversion[input_step_file24] - ValueError: The solids [7, 70, 71, 72, 73, 76, 77, 78, 79, 109, 110, 111, 112, 113, 114, 115, 116, 133, 136, 149, 150] contain splines in th...
FAILED tests/test_convert.py::test_conversion[input_step_file25] - ValueError: The solids [8, 9, 14, 34, 51, 52, 63, 67, 77, 78, 113, 170, 172, 175, 176, 177, 178] contain splines in the CAD geometry /home/j...
FAILED tests/test_convert.py::test_conversion[input_step_file27] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/Torus/solid1.stp
FAILED tests/test_convert.py::test_conversion[input_step_file30] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/Torus/solid3.stp
FAILED tests/test_convert.py::test_conversion[input_step_file33] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/Torus/solid2.stp
FAILED tests/test_convert.py::test_conversion[input_step_file35] - ValueError: The solids [0, 1, 2, 3] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/Torus/Design1.stp
FAILED tests/test_convert.py::test_conversion[input_step_file36] - ValueError: The solids [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/Torus/ex...
FAILED tests/test_convert.py::test_conversion[input_step_file38] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/Torus/placa2.stp
FAILED tests/test_convert.py::test_conversion[input_step_file44] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/Torus/placa3.stp
FAILED tests/test_convert.py::test_conversion[input_step_file51] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/DoubleCylinder/placa3.step
FAILED tests/test_convert.py::test_conversion[input_step_file52] - ValueError: The solids [0] contain splines in the CAD geometry /home/j/GEOUNED/testing/inputSTEP/DoubleCylinder/placa2.step

@shimwell
Copy link
Collaborator Author

shimwell commented Jun 5, 2024

I've replaced the code that terminated the program when finding splines with a more gentle writing to log file as it appears that spines can be contained in step files but not used and that GEOUNED is fine with this.

@shimwell
Copy link
Collaborator Author

shimwell commented Jun 5, 2024

this one is ready for review

@akolsek
Copy link
Member

akolsek commented Jun 5, 2024

Hey @psauvan and @jpcatalanUNED! Any idea why some of the stp files, when opened in text editor, show B_SPLINE_CURVE_WITH_KNOTS, but splines are not identified in SpaceClaim and the models translate well?

@shimwell
Copy link
Collaborator Author

shimwell commented Jun 5, 2024

Hey @psauvan and @jpcatalanUNED! Any idea why some of the stp files, when opened in text editor, show B_SPLINE_CURVE_WITH_KNOTS, but splines are not identified in SpaceClaim and the models translate well?

I think the STP file keeps a history of the previous edges even after they have been simplified or converted to other edge types

@alexvalentine94
Copy link
Collaborator

Check for spline by using face.surface rather than edges

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

Successfully merging this pull request may close these issues.

3 participants