Hi @Fernando ,
After carefully reviewing the following documentations provided at the links below
To address the Delaunay triangulation error you're encountering when running mesh(p), please see a few potential solutions and considerations listed below
Check for Near-Duplicate Points
The error message indicates that there might be nearly coincident points in your design. You can check for duplicates by examining your FeedLocations and ViaLocations. Ensure that none of these points are too close together. A simple approach is to apply a tolerance when comparing points. Example code snippet to filter out duplicates:
tolerance = 1e-6; % Adjust as necessary uniqueFeedLocations = unique(p.FeedLocations, 'rows', 'stable'); uniqueViaLocations = unique(p.ViaLocations, 'rows', 'stable');
Simplify Geometry
If your PCB design has complex geometries, try simplifying it. This can involve reducing the number of layers temporarily or simplifying shapes within the Gerber files to see if that resolves the meshing issue.
Adjust Layer Configuration
Ensure that your layer configuration is correctly set up in terms of their order and materials. Each layer should be properly defined with respect to its dielectric properties and thickness.Confirm that all specified layers (including air layers) are correctly defined and not conflicting with each other.
Visual Inspection
Use show(p) after constructing your pcbStack object to visually inspect how your PCB looks before meshing. This may help you identify any immediate geometric issues that could lead to problems during meshing.
Review Gerber Files
Since you are importing multiple Gerber files, ensure that they are compatible with RS-274X standards and do not contain unsupported features such as cut-ins, aperture macros, etc., as mentioned in the documentation. You may also want to visualize individual layers using shapes(P) to ensure they are being read correctly.
Increase Mesh Resolution
Sometimes adjusting the meshing parameters can help. You can try modifying settings related to mesh resolution or constraints if applicable.
Debugging via Smaller Models
As a debugging step, try simulating a simpler PCB model first. If that works, gradually add complexity until you isolate what specifically causes the failure in your original design.
MATLAB Version Compatibility
Ensure that you are using a version of MATLAB that supports all functions and features you are trying to utilize, particularly concerning RF Toolbox updates.
Familiarize yourself with MATLAB's documentation on delaunayTriangulation and pcbStack for more detailed insights into managing points and constraints effectively. Monitor system performance while running simulations; sometimes computational limits can exacerbate issues in complex models.
By following these strategies, you should be able to troubleshoot and resolve the Delaunay triangulation error effectively, allowing you to proceed with simulating the EH fields of your planar transformer design.
Hope this helps.
Please let me know if you still have any further questions.