Add a plane and tab into Edit Mode then press A then M > Merge At Center. There will be one vertex left at the center. Select it and press the sequence EX-1Enter to Extrude along the X-axis by negative 1 unit. Select the center vertex again and then use the sequence EY1Enter to extrude another vertex along the Y-Axis by 1 unit. Then use this extruding technique two times more to extrude another 2 vertices to, say, 0.8 units.

Delete the center vertex by selecting it and pressing X > Delete > Vertices. Temporarily extrude the whole setup by a small amount on the Z-Axis so you get the following shape. Select the vertices shown below and go to Edge > Bridge Edge Loops

Tinker around with the settings in the Adjust Last Operation
popup to get the profile you need.

Press ASZ0 to scale the vertices back to zero on the Z-axis. Press AM > Merge By Distance to merge all vertices.

Add a Mirror Modifier for X & Y and tab back into Object Mode. Right click the object and select Convert To > Curve

Under Curve Settings go to Bevel tab and give it some Depth and adjust the Resolution. Right click object and select Convert To > Mesh.

You can do the same technique for the triangle. Just leave a small gap between the 3 corners and let the Bridge Edge Loops step round those corners.