Repository navigation
How to correctly create copper traces for PCB-Antenna #474
Replies: 2 comments
|
Hi there! The solution to the "remove entire contents" question is easy. You just need an additional command in your *.m file. Regarding the crash, I was lazy and asked my dear friend Claude AI, answer is below. Box 4 shares exact coordinates with box 3 at x=1.4 and y=4.7, and its region x:1.4–1.9, y:4.7–5.2 overlaps box 3 entirely instead of being adjacent to it. That overlap is the problem. Later in the script: matlab DetectEdges inserts refined mesh lines at every edge of every box making up 'patch'. Because box 4 overlaps box 3, it introduces duplicate or near-duplicate edge coordinates at 1.4 and 4.7 that are already present from the other boxes, but does so in a way that creates degenerate/extremely thin intervals. SmoothMesh then tries to iteratively enforce a maximum cell-size-growth ratio between neighboring lines — with near-coincident lines this constraint can't converge cleanly, and in Octave's implementation this manifests as an effectively infinite loop (it's a known pain point with SmoothMesh/DetectEdges on self-overlapping metal geometry, worse in Octave than MATLAB). The overlap, precisely: Box 3: x:[1.4, 4.3], y:[4.7, 5.2] Their intersection — x:[1.4, 1.9], y:[4.7, 5.2] — is non-empty. Both boxes are zero-thickness (same z on start/stop), sitting on the exact same plane, so you get two coincident PEC surfaces covering the same area with shared boundary coordinates at x=1.4 and y=4.7. Why this hangs specifically in SmoothMesh: The actual fix — make box 4 non-overlapping: matlab This only adds the new area you actually want (the little tab above box 3) instead of re-covering box 3's region. With no interior overlap, DetectEdges/SmoothMesh gets a clean, non-degenerate line set and won't hang. |
|
One more comment: if you are new to openEMS and willing to create your models in Python, you could use the wonderful automatic meshing add-on that Mustafa presented here: |
Uh oh!
There was an error while loading. Please reload this page.
Hi!
I am doing my very first steps with OpenEMS.
I saw the tutorial from Georgy Moshkin and the FOSDEM video from Thomas.
I am totally amazed what openEMS can do!
Now I am doing my first steps. I am trying to simulate my first meandering BLE antenna by modifying the sample code from Simple_Patch_Antenna.m.
I have added a
returnstatement beforeRunOpenEMSis called, so that I can run my script and see the Output of my modeling withWriteOpenEMSwithout starting the simulation.I want to create my antenna by adding multiple boxes like
to create the zig-zag-pattern.
Every time I hit the run button to check my geometry I get the question
in the Command window, where I have to enter
yes.After adding the fourth segment for the patch (line 71 in attached code) the Command window clears when pressing Start, but I do not get the above question anymore and Octave freezes infinitely. I have to terminate the program with the task manager.
I have no idea how to overcome this problem.
Any suggestions welcome!
I am using Octave 11.3.0 (2026-06-01) and openEMS_v0.0.36 on Windows 11.
Jan
Nochmal_Antenna.zip
All reactions