Line Break Symbol script
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
- petevick
- Premier Member
- Posts: 392
- Joined: Tue May 19, 2020 9:34 am
- Location: North Norfolk coast UK
Re: Line Break Symbol script
That looks like a new tool is required.....possibly
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Re: Line Break Symbol script
I guess I'm probably making more of a wishlist on this. I made those multiple cycles just by copying. I was thinking the amplitude of the zig-zag could be a 3rd point, rather than from a typed number (and that point could snap?) also the angles be equal (congruent as shown on left) and the center is the break (height 3) and the built-in is far right.
I think you and CVH have done a superlative job nevertheless. A gazzion +1 thumbups. And several more for Andrew too!
- Attachments
-
- Angles.png (807 KiB) Viewed 6427 times
Windows 10
Re: Line Break Symbol script
@Panchdara,
Pete worked it out as a SEED:
3 units long and later scaled to the distance between Point1 and point2.
If you are willing to do the math to replace the SEED ...
... then let it know.
Another pick point for height is also possible ... point3
That would result in a scaled value what is related to unscaled this.breakHeight
1-2-3 hertz too, 3-6-9 units long.
segvi is 0 or 1 depending starting orthogonal or slanted.
With those you have all the input variables you need to construct the math.
Pete already has the code to include longer seeds.
Any different this.breakHeight would alter the angles ...
Fixed angles need another approach with trig math.
Fixed angles define this.breakHeight.
Here my input ends.
Discuss it further with Pete ...
CVH
Pete worked it out as a SEED:
Code: Select all
// Define SEED:
var points = new Array(
new RVector( 0, 0),
new RVector( segvi, this.breakHeight),
new RVector( 3-segvi, this.breakHeight * -1),
new RVector( 3, 0)
);
If you are willing to do the math to replace the SEED ...
... then let it know.
Another pick point for height is also possible ... point3
That would result in a scaled value what is related to unscaled this.breakHeight
1-2-3 hertz too, 3-6-9 units long.
segvi is 0 or 1 depending starting orthogonal or slanted.
With those you have all the input variables you need to construct the math.
Pete already has the code to include longer seeds.
Any different this.breakHeight would alter the angles ...
Fixed angles need another approach with trig math.
Fixed angles define this.breakHeight.
Here my input ends.
Discuss it further with Pete ...
CVH
- petevick
- Premier Member
- Posts: 392
- Joined: Tue May 19, 2020 9:34 am
- Location: North Norfolk coast UK
Re: Line Break Symbol script
That is definitely another tool. I'll send you a pm Panchdara rather than clutter up here with off topic chatterPanchdara wrote: ↑Fri Mar 12, 2021 8:17 amI guess I'm probably making more of a wishlist on this. I made those multiple cycles just by copying. I was thinking the amplitude of the zig-zag could be a 3rd point, rather than from a typed number (and that point could snap?) also the angles be equal (congruent as shown on left) and the center is the break (height 3) and the built-in is far right.
I think you and CVH have done a superlative job nevertheless. A gazzion +1 thumbups. And several more for Andrew too!
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
- petevick
- Premier Member
- Posts: 392
- Joined: Tue May 19, 2020 9:34 am
- Location: North Norfolk coast UK
Re: Line Break Symbol script
This update consists of the following;
To install the PolyLineBreakSymbol tool first create a new folder called Draw in the scripts>Misc folder (if you don't already have that folder) and then extract the PolyLineBreakSymbol folder in the zip file into the new Draw folder. Restart Qcad and you'll find a Polyline Break Symbol menu item under the Misc>Draw menu, and a toolbar button on the Misc Draw toolbar and the Misc Draw section of the Tool Matrix panel. The shortcut is S3, commands are either pbreaksymbol or pbrksym.
User Options toolbar The first option is Remove Segment. If checked, the chosen entity segment between the break symbol will be removed if unchecked, the segment is not removed. The default is checked.
The second option is Inherit. If checked the break symbol inherits all the properties (layer, line colour etc) of the chosen entity. The default is checked.
The third option is Peak Ratio. This is the ratio of the peak height to the break symbol width. The minimum ratio is 1:3 and the maximum ratio is 3:1. This changes the look of the symbol considerably from one extreme to the other. The default ratio is 1:1.
The last option is Inclined and Vertical. If Inclined is selected the symbol will have inclined first and last segments thus... If Vertical is selected the symbol will have vertical first and last segments thus... The default is Inclined.
How to use
In the Pro version of Qcad you will be first asked to choose either a line, arc, circle, ellipse, spline or polyline to break up. In the CE version, you are asked to choose either a line, arc, circle or ellipse. You must choose one of those entities to proceed, selecting some other entity will result in an error message being displayed on the command line.
You are then prompted to pick the first break point. The break symbol will then appear. You will note that at this point you can scale the symbol along the path of the chosen entity by moving the crosshairs. You will then be prompted to pick a second point. This will fix the final size of the symbol, and, if the Remove Segment option is checked, the segment between the symbol will be removed.
Note that after the first point is picked you can change any of the user options and the symbol will be updated to reflect your changes.
You can now insert another break symbol or click the right mouse button to end.
I've also attached a MS Word document of the above should you want a hard copy.
- option to inherit the properties of the chosen entity added
- Peak Height renamed to Peak Ratio
- Peak Ratio is now selected via a drop down list and displays the ratio of peak height to break symbol width
- the Inclined and Vertical radio buttons are now toolbar buttons.
To install the PolyLineBreakSymbol tool first create a new folder called Draw in the scripts>Misc folder (if you don't already have that folder) and then extract the PolyLineBreakSymbol folder in the zip file into the new Draw folder. Restart Qcad and you'll find a Polyline Break Symbol menu item under the Misc>Draw menu, and a toolbar button on the Misc Draw toolbar and the Misc Draw section of the Tool Matrix panel. The shortcut is S3, commands are either pbreaksymbol or pbrksym.
User Options toolbar The first option is Remove Segment. If checked, the chosen entity segment between the break symbol will be removed if unchecked, the segment is not removed. The default is checked.
The second option is Inherit. If checked the break symbol inherits all the properties (layer, line colour etc) of the chosen entity. The default is checked.
The third option is Peak Ratio. This is the ratio of the peak height to the break symbol width. The minimum ratio is 1:3 and the maximum ratio is 3:1. This changes the look of the symbol considerably from one extreme to the other. The default ratio is 1:1.
The last option is Inclined and Vertical. If Inclined is selected the symbol will have inclined first and last segments thus... If Vertical is selected the symbol will have vertical first and last segments thus... The default is Inclined.
How to use
In the Pro version of Qcad you will be first asked to choose either a line, arc, circle, ellipse, spline or polyline to break up. In the CE version, you are asked to choose either a line, arc, circle or ellipse. You must choose one of those entities to proceed, selecting some other entity will result in an error message being displayed on the command line.
You are then prompted to pick the first break point. The break symbol will then appear. You will note that at this point you can scale the symbol along the path of the chosen entity by moving the crosshairs. You will then be prompted to pick a second point. This will fix the final size of the symbol, and, if the Remove Segment option is checked, the segment between the symbol will be removed.
Note that after the first point is picked you can change any of the user options and the symbol will be updated to reflect your changes.
You can now insert another break symbol or click the right mouse button to end.
I've also attached a MS Word document of the above should you want a hard copy.
- Attachments
-
- PolyLineBreakSymbol v1.zip
- (13.71 KiB) Downloaded 396 times
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6