Page 1 of 1

Direct access to the specific preferences for the Explode method (XP)

Posted: Mon Mar 17, 2025 3:42 pm
by CVH
All,

Based on a idea from user thhz.
Users that do a lot of preparation work for CNC and finds themselves accessing the XP preferences on a regular base may find this interesting.

Explosions of Splines, Ellipses or Text may return too coarse approximations/interpolations or may return a vast amount of segments.
Too short Line-segments or too little Arcs-segments may become problematic down the line.
The truth is somewhere in between and some trial and error may be required.

Accessing the XP preferences via the Application Preferences each time may get annoying.
I do (did) this numerous times daily for the past .. years.

Spline approximation by Arc-segments is drawing unit independent, e.g. 0.01 (in mm) or 0.01 (in inch = 0.254mm).
A tolerance of 0.01 is absurd when the overall size are nearly meters in a mm drawing but 0.001 can be appropriate for a few mm.
The default Spline interpolation preference with 64 Line-segments is per Bézier-segment times (degree + 1) ...
... How many Bézier-segments depend on the original Spline and correlates with the point count.
Ellipse segments per full Ellipse is a size relative tolerance.


Wrote a little GUI tool for direct access. :P
Shortcut is XX and it is listed in the Edit menu below 'Application Preferences' with an icon.
A dialog is shown with the XP preferences, fully compatible with the default preference panel, Pro or CE.
Implemented the OR clause as per Feature Request FS#2653
:arrow: Splines per approximation OR per interpolation.


XP_Dialog.png
The dialog showing my current preferences
XP_Dialog.png (32.65 KiB) Viewed 40516 times

The package is donated freely 'As Is' to the QCAD project (See script headers).
:arrow: Andrew may include it in a future release of QCAD if and how he sees fit.
In such a case the custom installed files under scripts/Edit should be removed to avoid conflicts.

# EDIT # Newer revision, the package was downloaded 10 times before the fix.
DirectPrefsForXP.zip
Content of the sub-folder (Revision)
(7.92 KiB) Downloaded 343 times

Regards,
CVH


Direct installation:
------------------------
The package is intended to be installed under: .../QCAD/scripts/Edit/DirectPrefsForXP/*.*
Where the 3 dots are the installation path of QCAD or the local data location (See: Changelog 3.26.2), QCAD or QCADCAM or ...
It may be required to manually add the folder structure .../QCAD/scripts/Edit/ and the sub folder DirectPrefsForXP/
The full path of the base script then reads as: .../QCAD/scripts/Edit/DirectPrefsForXP/DirectPrefsForXP.js

Re: Direct access to the specific preferences for the Explode method (XP)

Posted: Wed Mar 19, 2025 8:23 am
by thhz
Hi CVH,

Thank you very much for the great work,
this is very helpful

regards
Thomas

Re: Direct access to the specific preferences for the Explode method (XP)

Posted: Wed Mar 19, 2025 11:22 am
by CVH
It seems that there was a little mistake in the code what was reported by Thomas.

The 'typo' prevented the tool from starting more than once.
And that is per definition the whole idea of this Addon ... :oops:

Fixed in the revision, see initial commit.
Sorry for the inconvenience.


I didn't fail in my case because the switch -always-load-scripts was included in the OS shortcut target.
But this switch is now reported to have other consequences.
Investigation is pending ... TBC
Further unrelated for the usage of this tool with the revised code.

Regards,
CVH