How to draw the outline of an icon made of several polygons?
With Mathematica 12 a possible approach is OuterPolygon
:
pol = Polygon[{{{0, -1}, {1, 1}, {-1, 1}}, {{-1, -1}, {1, -1}, {1,
0}, {-1, 0}}}]
Graphics[{FaceForm[], EdgeForm[{Thick, Blue}], pol}]
Graphics[{FaceForm[], EdgeForm[{Thick, Blue}], OuterPolygon[pol]}]
You can use BoundaryDiscretizeGraphics
:
bdg = BoundaryDiscretizeGraphics @ speakerIcon
Graphics[{EdgeForm[{Black, Thin}], FaceForm[], MeshPrimitives[bdg, 2]}, ImageSize -> 30]
Alternatively, you can use BoundaryDiscretizeRegion
+ RegionUnion
:
bdr = BoundaryDiscretizeRegion[
RegionUnion[Triangle[{{0, -1}, {1, 1}, {-1, 1}}], Rectangle[{-1, -1}, {1, 0}]]]