I use BitMap tracing in Inkscape to get the profiles I need for eventual cutting of wood veneers.
I need to transfer the profiles to a CAD system.
The profiles in Inkscape have many Bezier cubic sections which I am approximating with circular arcs in the CAD system (which does not have Bezier cubics).
The geometry of the 2 tangentially meeting arcs is given in the picture headed “Geometry of arcs used to approximate the Bezier curves”. There is different geometry when there is an inflexion of the cubic curve.
Most of the approximations work as required. However, there are some problems.
The picture headed “Screen shot of brach sqg query” shows one profile extracted from the main drawing. The picture headed “Screen shop of shape from CAD system shows the results of using the 2 arc approximation. There are two problems.
1. The lines in the red rectangle are missing;
2. The curve in the blue rectangle is much more rounded – this is reasonable given the direction of the line (red) from the end of the curve to the control point – it is at about 150 degrees.
So the 2 questions are
1. Why are the lines in the red rectangle missing. I believe these are at the beginning of the svg path (attached) which is the following d="M 0.81558,2.9585 0.02158,2.5785 1.2576,2.6385 C where there are 3 pairs of x,y points after the M and before the C I understand the M x,y simply means a move so no lines are drawn. Therefore if there is more than 1 set of x,y after a move (M), should the subsequent ones be treated as L so that lines are drawn? (It seems that Inkscape may use this convention)
2. Why is the curve in Inkscape drawn in a more pointed way (which seems not to be controlled by the line from the end to the control point)? As important, how can I construct the curve to be like that shown in Inkscape?
As an experiment, I drew the actual curve as a series of small straight lines - this is shown in the picture attached.
As can be seen, this is more more pointed than the approximating arc shown in one of the pictures in the original post.
So it seems that the two arc approximation has limits' to be useful. Perhaps 'failure' is more likely the steeper the angle (relative to the base line) and maybe this is associated with sharp corners.
In any event I shall have to work on this.
However, the question about missing lines remains.
[Path > Path Effects...] and then add [Spiro spline]. This takes a bezier path and fits a series of circular arcs to the nodes. You can improve the fit by adding more nodes in areas of high curvature. When you're happy with the fit, flatten the spiro path effect. Hopefully your CAD software will like the result.
I have tried to use it but found the 'Spiro spine' option was greyed out when all the design had been selected.
I tried various things but seemed to find that I only could use the Spiro option after I had
1. used Path > Break Apart
2. selected a single path.
Is there a way of using the Spiro path effect on more than one path?
The attached picture shows what I got - it does not have the same shape as you found. So I wondered if
1. you had perhaps modified what you first found and/or
2. what you meant by 'flatten the Spiro path effect.' and if this had any effect.
I looked at the svg path and found several Bezier conic definitions. I am assuming that these give a close approximation to the circular arcs that the part had been converted to.
Is there a way of getting path circular arc definitions (A)? (I looked in the Preferences but could not see anything.
I duplicated your original shape, increased the stroke width, and added transparency. Here we go.
Using the Node tool, [double-click] the path to add a new node or [Insert new nodes] in the select a segment by clicking the "plus" icon at far left in the Node tool control bar.
Many thanks for the additional work and explanation of sorting the geometry of the shape I was having some trouble with.
I use a commercial CADCAM system to which I have added macros to help with the geometric manipulations I need to do to have parts that I can cut on a laser, I would not want to re-write these macros in another application. So the quest to get acceptable lines and circular arcs from Inkscape's svg path geometry. I do not need exact representations of the geometry and I believe that the work I have so far indicates I will be able to get acceptable geometry.
At the beginning of this thread I ask if it was normal to have, in the svg path geometry, an M followed by 3 pairs of x,y co-ordinates and if so how should this be handled. It seems that the 2nd and 3rd pair are treated as L's ie draw a line from the current position to the co-ordinates given.
I use BitMap tracing in Inkscape to get the profiles I need for eventual cutting of wood veneers.
I need to transfer the profiles to a CAD system.
The profiles in Inkscape have many Bezier cubic sections which I am approximating with circular arcs in the CAD system (which does not have Bezier cubics).
The geometry of the 2 tangentially meeting arcs is given in the picture headed “Geometry of arcs used to approximate the Bezier curves”. There is different geometry when there is an inflexion of the cubic curve.
Most of the approximations work as required. However, there are some problems.
The picture headed “Screen shot of brach sqg query” shows one profile extracted from the main drawing. The picture headed “Screen shop of shape from CAD system shows the results of using the 2 arc approximation. There are two problems.
1. The lines in the red rectangle are missing;
2. The curve in the blue rectangle is much more rounded – this is reasonable given the direction of the line (red) from the end of the curve to the control point – it is at about 150 degrees.
So the 2 questions are
1. Why are the lines in the red rectangle missing. I believe these are at the beginning of the svg path (attached) which is the following
d="M 0.81558,2.9585 0.02158,2.5785 1.2576,2.6385 C
where there are 3 pairs of x,y points after the M and before the C
I understand the M x,y simply means a move so no lines are drawn.
Therefore if there is more than 1 set of x,y after a move (M), should the subsequent ones be treated as L so that lines are drawn? (It seems that Inkscape may use this convention)
2. Why is the curve in Inkscape drawn in a more pointed way (which seems not to be controlled by the line from the end to the control point)? As important, how can I construct the curve to be like that shown in Inkscape?
Update
As an experiment, I drew the actual curve as a series of small straight lines - this is shown in the picture attached.
As can be seen, this is more more pointed than the approximating arc shown in one of the pictures in the original post.
So it seems that the two arc approximation has limits' to be useful. Perhaps 'failure' is more likely the steeper the angle (relative to the base line) and maybe this is associated with sharp corners.
In any event I shall have to work on this.
However, the question about missing lines remains.
..and here is the 'missing' svg file
[Path > Path Effects...] and then add [Spiro spline]. This takes a bezier path and fits a series of circular arcs to the nodes. You can improve the fit by adding more nodes in areas of high curvature. When you're happy with the fit, flatten the spiro path effect. Hopefully your CAD software will like the result.
Thanks for that it sounds very interesting.
I have tried to use it but found the 'Spiro spine' option was greyed out when all the design had been selected.
I tried various things but seemed to find that I only could use the Spiro option after I had
1. used Path > Break Apart
2. selected a single path.
Is there a way of using the Spiro path effect on more than one path?
The attached picture shows what I got - it does not have the same shape as you found. So I wondered if
1. you had perhaps modified what you first found and/or
2. what you meant by 'flatten the Spiro path effect.' and if this had any effect.
I looked at the svg path and found several Bezier conic definitions. I am assuming that these give a close approximation to the circular arcs that the part had been converted to.
Is there a way of getting path circular arc definitions (A)? (I looked in the Preferences but could not see anything.
Apart from the fact that I don't understand the shape at all, I don't see any reason why it can't be realised with a BSpline in Inkscape:
I duplicated your original shape, increased the stroke width, and added transparency. Here we go.
Using the Node tool, [double-click] the path to add a new node or [Insert new nodes] in the select a segment by clicking the "plus" icon at far left in the Node tool control bar.
What CAD system are we working with here? Many recent CAD and CAM programs can directly import SVG files. It might be time to upgrade.
The personal version of Fusion 260 includes CAD, CAM and is free.
Many thanks for the additional work and explanation of sorting the geometry of the shape I was having some trouble with.
I use a commercial CADCAM system to which I have added macros to help with the geometric manipulations I need to do to have parts that I can cut on a laser, I would not want to re-write these macros in another application. So the quest to get acceptable lines and circular arcs from Inkscape's svg path geometry. I do not need exact representations of the geometry and I believe that the work I have so far indicates I will be able to get acceptable geometry.
At the beginning of this thread I ask if it was normal to have, in the svg path geometry, an M followed by 3 pairs of x,y co-ordinates and if so how should this be handled. It seems that the 2nd and 3rd pair are treated as L's ie draw a line from the current position to the co-ordinates given.