I have a 2d profile of a sheet metal flange shape.
I tried building it with Path2 but don’t know how to visualize it (I pulled points from AutoCAD).
I generated two copies of the getPoints with each having a different z value and that lets me build a ribbon but many of the arcs are going in the wrong direction.
This is the shape I’m trying to draw. In the end I’ll want this to also have thickness.
The first two parameters for addArcTo determine the direction the arc is drawn, if moving in y direction swap sign of midx otherwise swap sign of midy to change direction of arc.
Also looking at your goal image the path that follows the end edge is in 3D so cannot be drawn with path2
Oops! Just realised you can use path2d as you draw the path in an XY plane but move your start and end points along the z axis when you are by the indents.
My apologies having looked closely at path2 it does not behave as I would expect. I also cannot figure out a sensible way to get arcs drawn in the direction that I need. I will look at how to draw a path with arcs as needed later in the week.
@ajw1970 After experimenting for a few days it looks like it is more difficult than I imagined. If the two lines are perpendicular or parallel it is fairly straight forward to join them with an arc of a circle. In other cases to form a curve between two lines that starts and ends tangential to each line requires a Bezier or Camull-Rom curve. The shape the curve takes depends on one or two variables that while can be set automatically the choices might not be good ones. Without a visible drawing system such as a CAD one it it difficult to determine the values you might need.
Whilst you may be able to export data from a CAD system unless you have the algorithm to correctly read and apply the data you will not be able to draw the shape.
Apologies for promising more than I can deliver in the timescale I suggested.
I have now managed to set up a function to draw an arc through three points. I have submitted a PR that adds this feature to Curve3 but as a new feature it may have to wait until v5.00 is sorted.
Maybe too late for you but hope it could still help.