Open blazra opened 4 years ago
I'm having similar issues trying to visualize a ground plane with a hole for a via, as shown below. This portion for drawing a plane with via holes is adapted from documentation of the MATLAB portion here
bounding = {
'x': mesh.GetSimArea()[:, 0],
'y': mesh.GetSimArea()[:, 1],
'z': mesh.GetSimArea()[:, 2],
}
p = np.zeros((2, 26))
p[:, 0] = [bounding['x'][0], bounding['y'][0]]
p[:, 1] = [0, bounding['y'][0]]
a = np.linspace(-np.pi, np.pi, 19)
p[:, 2:21] = [
(VIA_GAP + VIA_OUTTER_DIAMETER/2) * np.sin(a),
(VIA_GAP + VIA_OUTTER_DIAMETER/2) * np.cos(a)
]
p[:, 21] = [0, bounding['y'][0]]
p[:, 22] = [bounding['x'][-1], bounding['y'][0]]
p[:, 23] = [bounding['x'][-1], bounding['y'][-1]]
p[:, 24] = [bounding['x'][0], bounding['y'][-1]]
p[:, 25] = [bounding['x'][0], bounding['y'][0]]
gnd.AddPolygon(p, 'z', elevation=(OUTTER_SUBSTRATE_THICKNESS + MIDDLE_SUBSTRATE_THICKNESS), priority=10)
Where a polygon is expected on the entire top plane.
Modifying the code as such...
bounding = {
'x': mesh.GetSimArea()[:, 0],
'y': mesh.GetSimArea()[:, 1],
'z': mesh.GetSimArea()[:, 2],
}
p = np.zeros((2, 25))
p[:, 0] = [bounding['x'][0], bounding['y'][0]]
p[:, 1] = [0, bounding['y'][0]]
a = np.linspace(-np.pi, np.pi, 19)
p[:, 2:21] = [
(VIA_GAP) * np.sin(a),
(VIA_GAP) * np.cos(a)
]
p[:, 21] = [0, bounding['y'][0]]
p[:, 22] = [bounding['x'][-1], bounding['y'][0]]
p[:, 23] = [bounding['x'][-1], bounding['y'][-1]]
p[:, 24] = [bounding['x'][0], bounding['y'][-1]]
gnd.AddPolygon(p, 'z', elevation=(OUTTER_SUBSTRATE_THICKNESS + MIDDLE_SUBSTRATE_THICKNESS), priority=10)
creates this, where the polygon doesn't have the hole in the middle and is simply a triangle. \
Plotting the object p
in MatPlotLib verifies we have (at least geometrically) properly created the object.
Hi,
for certain polygons the AppCSXCAD is showing a weird artifact - it looks like some vertices are missing. From the
openEMS --debug-PEC
dump it seems like openEMS is seeing the correct polygon - just the AppCSXCAD is visualizing it incorrectly. Maybe related to this http://openems.de/forum/viewtopic.php?f=3&t=444 ?Should look like this:
AppCSXCAD shows this:
openEMS PEC dump (white) with AppCSXCAD .stl export (blue) for comparison:
I have minimized the test-case into this script:
Generated .xml and the script: appcsxcad_testcase.zip
openEMS version: