Closed joeborrello closed 5 years ago
Quick update: I'm getting the same issue with a modified DXF where I added vertical lines to the left and right sides: REHexSkew_simple_bars.zip
Hi Joe, I see what you are saying. Your part has multiple lines on each side. So part.left and part.right should each contain a list of signLine items. Attached is an image of your part. I see from my code here: https://github.com/spacether/pycalculix/blob/master/pycalculix/partmodule.py#L158 That I am doing a strict match looking for lines which have exactly the left or rightmost value for the start and end point of the line. This means that your model geometry is slightly off. I will re-write this code to use a pycalculix geometry accuracy constant so it will by default capture the almost there lines too.
If it doesn't capture the part lines, then to fix your issue you could:
Thanks for that info. The DXF is being imported from OpenSCAD so, in theory at least, the vertical lines should all be perfectly straight and in the same position, but I know that's not always the case.
Where is the geometry accuracy constant specified in the code? I think that may be the quicker fix if I can get it to work by just adjusting the number.
Hi Joe, I just added a new branch which uses the accuracy constant when setting part.left/right/top/bottom. If you uninstall your pycalculix and reinstall it from: https://github.com/spacether/pycalculix/tree/bug/issue_57_part_left_not_detected you will have the fix.
The accuracy constant is pycalculix.geometry.ACC so if you set it to a new value after importing the pycalculix module, then import your geometry, it should use your new accuracy value. For example:
import pycalculix as pyc
pyc.geometry.ACC = 1
# import cad file here after setting ACC
If the left side is skewed so it is almost vertical and both of its points are captured within the left-1 zone, then that line will be set as part.left
I will merge my branch into master after I have added test demonstrating that it works. I already tested it on your file and it works.
I tried running the part again with the pycalculix installed from the updated branch, but I still get the same error. Do I need to specify the geometry accuracy constant?
Hey Joe. The accuracy constant starts out at a very small value. Try setting it to something like 0.1 then import your cad geometry.
Setting the ACC after import did it - wasn't sure if the branch had changed the constant or not. Thanks!
Master branch now has the fix for this issue in it.
I'm trying to perform an FE analysis on the DXF file attached but running into a problem in the constraints step. I can apply constraints to the right side of the model by using
part.right
, but get the following error when I try to apply constraints usingpart.left
:To my knowledge, both the left and right portions of the model are perfectly vertical, so I'm not sure why one side works and the other doesn't. REHexSkew_simple.zip