Imported polyhedra (STL) are not excited by active port (Python Interface) #135
-
|
I'm trying to conduct some antenna simulations with custom radiating element geometry created in FreeCAD. I have no issue importing STL files and adding them to a My method of import is as follows: And the summary for the The geometry is also confirmed visually in the CSXCAD viewer, and there are no apparent differences between geometry created via the two methods. The only difference being that one primitive is a Polyhderon and the other a Box. Is there something simple that I am missing? I've returned to this problem several times, combing through the available documentation with no luck so far. Any help is greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 11 replies
-
|
Can you please attach your FreeCAD file and python simulation script? It seems like there could be some grid error, like port placement or so, seems what you see in CSXCAD is what will you got :D With attached files it will be easy to debug, without them it's hard. |
Beta Was this translation helpful? Give feedback.
-
|
@LubomirJagos, thank you for the response. I'm attaching the STL file In the script you'll find a boolean called I believe the possibility of the issue being related to mesh grid or port placement can be excluded, as these are kept identical in both cases. That's why I'm wondering if there is some other parameter I'm missing which needs to set when using polyhedron geometry? When you run the provided example with For further comparison, here are the impedance plots for the two cases: Box Primitive (successful simulation) Polyhedron Primitive (failed simulation) I imagine this must either be something simple that I've overlooked, or an issue specific to the Python Interface, as I have seen other examples of people successfully using STL imports from the Matlab interface. I could find no complete example using the Python Interface, but perhaps there were some on the previous forum, which is no longer accessible? |
Beta Was this translation helpful? Give feedback.
-
|
So, I've finally had success getting my original model to work, but the root cause is pretty odd and frustrating. TL;DRUltimately if the STL model and the active port meet precisely at a mesh grid line with certain coordinates the simulation will fail. If they are displaced even marginally off from such mesh lines, the simulation will run successfully. The frustrating part is that the coordinates of such mesh lines appear to be arbitrary. In my case, if the line was at Z-coordinate 1.524 mm (as provided in the tutorial example), the simulation would fail. However, if I adjust the setup ever so slightly so that the common boundary and mesh line was at 1.525 mm instead, the simulation would succeed. This behaviour is made even more strange by the fact that there is no such issue with precisely the same geometry and mesh lines when created from a Box primitive (or presumably any other scripted CSX primitives). Perhaps this is a bug in the import precision that needs to be addressed. Suggested working solution:Avoid creating mesh lines at common boundaries between active ports and other properties/primitives which are meant to be excited by the port. This would mean generally avoiding the use of the @LubomirJagos, thank you very much for all the help and suggestions working through this. Copying the STL to the sim data directory was very helpful, as otherwise the first attempt would fail to find the model, which would only be found on the second attempt. Your suggestion fixed that. Interestingly, the only way I could get to the root of the issue was through closely examining the STL that you provided. I tried using FreeCAD in Windows; tried several different versions; tried exporting from Blender; and a plethora of other variations. But it wasn't until I examined the precise coordinates of your model, that I found it was very slightly off from my original geometry (on the order of micrometers). I used the export function of the CSXCAD viewer to export the STLs with ASCII formatting (rather than binary), and could then read through the vertex coordinates. I'm assuming that you may have created yours by eye and made it approximately the same as my original without using a shape binder to snap it precisely to the original bounds? This was very fortunate, because if it had exactly the same geometry as my original it would not have worked, and I would still be pulling my hair out. Many thanks! |
Beta Was this translation helpful? Give feedback.





So, I've finally had success getting my original model to work, but the root cause is pretty odd and frustrating.
TL;DR
Ultimately if the STL model and the active port meet precisely at a mesh grid line with certain coordinates the simulation will fail. If they are displaced even marginally off from such mesh lines, the simulation will run successfully.
The frustrating part is that the coordinates of such mesh lines appear to be arbitrary. In my case, if the line was at Z-coordinate 1.524 mm (as provided in the tutorial example), the simulation would fail. However, if I adjust the setup ever so slightly so that the common boundary and mesh line was at 1.525 mm instead, the simulation woul…