Modify distance between parallel lines/splines

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
thelasercutter01
Junior Member
Posts: 24
Joined: Fri Jan 13, 2023 2:12 pm

Modify distance between parallel lines/splines

Post by thelasercutter01 » Wed Jan 25, 2023 12:53 am

I am working (importing) number of vector files and most of them come with double lines (e.g. attached). Issue I am seeing is when I am laser cutting these , in some cases the lines (parallel typically) are too close. Is there a way to separate them out by a consistent measurement? E.g. if the distance between the two lines is 3mm, I want to make it 6mm but rather than doing it manually, or one at a time do it in one go.

I have attached one for a reference.

Thanks in advance.

QCAD Professional
OS: Windows 11
Version: 3.27.8.0 (3.27.8)
Attachments
Track.dxf
(143.48 KiB) Downloaded 140 times

CVH
Premier Member
Posts: 3416
Joined: Wed Sep 27, 2017 4:17 pm

Re: Modify distance between parallel lines/splines

Post by CVH » Wed Jan 25, 2023 5:15 am

thelasercutter01,

When the origin is line-art in an SVG you could set a thicker pen in the SVG before importing it.
But I suspect this is the result of bitmap tracing.

With your file first Detect Zero-Length Entities (MZ) with Distance Tolerance 0.01
That returns 2 polylines with Length Zero on 'Layer_2'.
Instead of just closing the tool (Cross, Esc or QQ) you may want to Delete Selected Entities with the eraser.
The detection tool will close automatically. :wink:

The file has no unit set and the measurement system is metric. :roll:
The lines are typical just under 0.1 units apart with a local minimum of 0.0723 units.
This local minimum tells me that the origin wasn't line-art with a fix pen width. :wink:

We can select the inner or the outer contour by double clicking near it: inner = 47 splines, outer = 54 splines.
Offsets of splines are possible with Modify .. Offset (with Distance) (OF) but that will result in a polyline entity.
Meaning that the splines are approximated internally before offsetting and that is by the Explode Spline approximation tolerance.
Goto menu Edit .. Application Preferences .. Modify .. Explode and ensure this tolerance is appropriate: 0.005 or even 0.001 units.
OF will offset whole the connected contour of splines in one go if feasible, the tool preview may be partially. :wink:

Now there are several options.
1) Offset both contours in/out by lets say 0.05 units, now typical 0.2 apart but that would still result in a local minimum of 0.17 units.
2) Create a pseudo center path by offsetting or the inner or the outer towards the other by 0.05 units.
Set the global width of this polyline offset to 0.2 units (Property Editor) and Explode (XP) that to 2 new contours with a fixed distance.
Some tweaking at hard corners may be required.
3) The same as 2 but first manually adapt the center path so that it is also the middle at and near the local minimum.
I use Circle of two points (C2), one point on the inner and the second perpendicular on the outer.
With a few of those I draw an open fit-point spline trough the centers, explode that and merge this polyline with the pseudo center path.
Some trimming is required and the joints may need blending.
A tool that does this for the entire length would be nice, polyline morphing can't be used here. :(


Some hints.
Use temporary layers with a different color for new entities so that you know what is what at glance.
Always keep a copy of the originals or intermediates so that you can revert back to them.
Diversify all, all new on different layers, hide and/or lock as required.
Compare results of different methods.
To get in the ballpark of your 3mm ...
> Goto menu Edit .. Drawing Preferences .. General .. Drawing unit and select inch.
> menu Edit .. Convert Drawing Unit (CU) and select mm to convert to ... Now it is typical just under 2.5 mm apart.
Don't forget to adapt the Spline approximation tolerance when working in mm. :wink:
Offsets of polylines with arc segments may fail in certain situations.
If you see parts of larger circles after poly offset which are obviously incorrect then you need to tweak that manually. :oops:

Regards,
CVH

thelasercutter01
Junior Member
Posts: 24
Joined: Fri Jan 13, 2023 2:12 pm

Re: Modify distance between parallel lines/splines

Post by thelasercutter01 » Sun Jan 29, 2023 7:40 am

Thank you very much CVH. Lot to take in, I will try to make sense of it and see how far I follow! :)

Post Reply

Return to “QCAD 'How Do I' Questions”