Handle holes in shapes - #29
Conversation
bbb0b8c to
29f10ab
Compare
…() priority handling
0b8f638 to
523f8bb
Compare
| } | ||
|
|
||
| ranges::sort(materials, [](auto const& a, auto const& b) { | ||
| auto const& [material_a, priority_a] = a; |
Check notice
Code scanning / CodeQL
Unused local variable Note
|
|
||
| ranges::sort(materials, [](auto const& a, auto const& b) { | ||
| auto const& [material_a, priority_a] = a; | ||
| auto const& [material_b, priority_b] = b; |
Check notice
Code scanning / CodeQL
Unused local variable Note
| for(shared_ptr<Polygon> const& polygon : get_current_state().polygons[plane]) { | ||
| for(shared_ptr<Edge> const& edge : polygon->edges) { | ||
| auto const& inner_material = polygon->material; | ||
| auto const& [immediate_ambient_outer_material, outer_priority] = [&]() -> pair<shared_ptr<Material>, remove_const_t<decltype(Polygon::priority)>> { |
Check notice
Code scanning / CodeQL
Unused local variable Note
| // https://github.com/thliebig/openEMS-Project/discussions/347 | ||
| // Currently do not take care of Isotropy=false | ||
| // as_double() selects the first term and ditch the part after | ||
| bool isotropy = node.attribute("Isotropy").as_bool(); |
Check notice
Code scanning / CodeQL
Unused local variable Note
| double epsilon = property.attribute("Epsilon").as_double(Material::default_epsilon); | ||
| double mue = property.attribute("Mue").as_double(Material::default_mue); | ||
| double kappa = property.attribute("Kappa").as_double(Material::default_kappa); | ||
| double sigma = property.attribute("Sigma").as_double(Material::default_sigma); |
Check notice
Code scanning / CodeQL
Unused local variable Note
| } else if(node.name() == "Cylinder"s) { | ||
| } else if(node.name() == "Wire"s) { |
Check notice
Code scanning / CodeQL
Empty branch of conditional Note
| } else if(node.name() == "Wire"s) { | ||
| } else if(node.name() == "CylindricalShell"s) { |
Check notice
Code scanning / CodeQL
Empty branch of conditional Note
| } else if(node.name() == "CylindricalShell"s) { | ||
| } else if(node.name() == "User-Defined"s) { |
Check notice
Code scanning / CodeQL
Empty branch of conditional Note
| } else if(node.name() == "User-Defined"s) { | ||
| } else if(node.name() == "Curve"s) { |
Check notice
Code scanning / CodeQL
Empty branch of conditional Note
| // switch(polygon->material->type) { | ||
| // case domain::Material::Type::CONDUCTOR: | ||
| // item->locate_structure_polygon_params = [this]() -> auto& { | ||
| // return style_selector.get_polygon_shape(); | ||
| // }; | ||
| // break; | ||
| // case domain::Material::Type::PORT: | ||
| // item->locate_structure_polygon_params = [this]() -> auto& { | ||
| // return style_selector.get_polygon_port(); | ||
| // }; | ||
| // break; | ||
| // case domain::Material::Type::GROUND: | ||
| // item->locate_structure_polygon_params = [this]() -> auto& { | ||
| // return style_selector.get_polygon_ground(); | ||
| // }; | ||
| // break; | ||
| // case domain::Material::Type::DIELECTRIC: | ||
| // item->locate_structure_polygon_params = [this]() -> auto& { | ||
| // return style_selector.get_polygon_substrate(); | ||
| // }; | ||
| // break; | ||
| // case domain::Material::Type::AIR: | ||
| // item->locate_structure_polygon_params = [this]() -> auto& { | ||
| // return style_selector.get_polygon_substrate(); | ||
| // }; | ||
| // break; | ||
| // default: | ||
| // unreachable(); | ||
| // } |
Check notice
Code scanning / CodeQL
Commented-out code Note
523f8bb to
b245fde
Compare
b245fde to
bad8033
Compare
|


Fixes #18
Trying instructions:
In the example, there are 4 elements:
Metalproperty calledShape.Materialproperty calledHole, which actually has the characteristics of Air/Vacuum.Hole::0totally transverse the plane and is of a higher priority than the plane.Hole::1totally transverse the plane and is of a lower priority than the plane.Hole::2is located exactly like the plane in the Z axis (same width) and is of a lower priority than the plane.First, if needed, you can observe the structure in 3D with AppCSXCAD. On the left panel the light bulb icons can be used to toggle the visibility of all the primitives made of each property. You can also hold the left click and move the mouse to rotate the structure.
Run the mesher.
Zoom enough to fit on the left-bottom hole
[CTRL]+ scroll.Click on its left edge, in the dropdown menu, select the
MeshlinePolicywith the highest ID number.On the Processing view, you will observe it originates from 2 edges from 2 faces of the cube-alike
Hole::0primitive.To see which one is the second edge, you can display the
ZXplane and go back toXY(on the left bar of the Structure view).You will also observe both edges are marked
To reverse: true, which means they are both marked with aXMINandYMINNormaldirection, whereas theMeshlinePoliciesthey resulted in are marked with aMAXNormaldirection.To see what this means, on the Processing view, double-click on an edge, uncheck
To reverse. Repeat on the second. Observe the difference in the mesh by undoing/redoing[CTRL]+[Z]/[CTRL]+[SHIFT]+[Z]and stay in the initial reversed (undid) state.To understand why this reversal happens, imagine this inner square as a hole in the
Shapemetal planar part, as such those edges between a metal zone and an air/vacuum zone must be meshed the same way as the other outer edges of theShapesquare, that is to say the thirds rule should apply (a line at 1/3 of the interval around the edge on the metal side, a line at 2/3 on the air side).Now look on the right-top square. It is not at all taken into account in the meshing process because it only exists inside the
Shapeand is of a lower priority, so it is completely dismissed.YZorZXplane displays will be more meaningful.Look on the middle square. It is meshed and not reversed because, due to its lower priority, it is not actually a hole, it is sliced by the
Shapeinto two small cubes above and under it. Those two cubes are normally meshed.Note: It is possible to set a background property to air/vacuum too, and dismiss those two cubes in consequence, but it is not used in this example. Also, applying the thirds rule for an air/vacuum primitive is not really relevant, this will be treated as part of Find optimal meshline placement regarding structure edges #15.