QCAD Professional
Version:
3.31.2.0 (3.31.2)
Internet:
QCAD.org
Build Date:
Oct 27 2024
Revision:
bae1b88
Qt Version:
5.14.2
Architecture:
x86_64
Compiler:
gcc 5.4.0
My experience is that Y never changes whether I use RBox.grow(2), RBox.growXY(2), or RBox.growXY(2,2). Only X grows by two, -2 for Corner1 and +2 for Corner2.
RBox.grow() and RBox.growXY() grow X only?
Moderator: andrew
-
mrhickman53
- Active Member
- Posts: 25
- Joined: Thu Sep 07, 2023 1:17 am
- Location: USA
-
CVH
- Premier Member
- Posts: 4995
- Joined: Wed Sep 27, 2017 4:17 pm
Re: RBox.grow() and RBox.growXY() grow X only?
This is rather a post for the QCAD Programming, Script Programming and Contributing forum.
Or in general for the QCAD Troubleshooting and Problems forum.
We start with a box that has its left lower corner at (4,3), 12 wide and 14 high.
After the first grow instruction it reports that the left lower corner is (2,1) and that the size has changed to 16x18.
After the second: (1,-0.5) and 18x21
The readout of the corners proves that X and Y have changed.
With RBox.grow(2) the box grows in Z too.
I don't see the issue.
Regards,
CVH
Or in general for the QCAD Troubleshooting and Problems forum.
Strange ... Run the next code in the Script Shell (GE):mrhickman53 wrote: ↑Wed Nov 20, 2024 2:25 pmMy experience is that Y never changes whether I use RBox.grow(2), RBox.growXY(2), or RBox.growXY(2,2). Only X grows by two, -2 for Corner1 and +2 for Corner2.
Code: Select all
var center = new RVector(10,10);
var box = new RBox(center, 12, 14);
box.getCorner1();
box.getCorner2();
box.grow(2);
box.getCorner1();
box.getCorner2();
box.growXY(1, 1.5);
box.getCorner1();
box.getCorner2();
After the first grow instruction it reports that the left lower corner is (2,1) and that the size has changed to 16x18.
After the second: (1,-0.5) and 18x21
The readout of the corners proves that X and Y have changed.
With RBox.grow(2) the box grows in Z too.
I don't see the issue.
Regards,
CVH
-
mrhickman53
- Active Member
- Posts: 25
- Joined: Thu Sep 07, 2023 1:17 am
- Location: USA
Re: RBox.grow() and RBox.growXY() grow X only?
I retested with your example, as well as my original code. I'm red-faced because I have yet again miss-interpreted the results. I was originally logging the box and not the corners and not detecting that the width x height was changing by 2*the growth value.
I apologize for taking your time away from other productive tasks purely because I could use some extra sleep.
I apologize for taking your time away from other productive tasks purely because I could use some extra sleep.
-
CVH
- Premier Member
- Posts: 4995
- Joined: Wed Sep 27, 2017 4:17 pm
Re: RBox.grow() and RBox.growXY() grow X only?
Hi,
You don't need to apologize, we are here to help other users.
Mistakes are there to make.
But may I ask to tag the topics that you started with [SOLVED] when considered as such?
Simply edit the title of your initial post.
Also see your topic on: Changing the lineweight.
In total a topic or 10.
Regards,
CVH
You don't need to apologize, we are here to help other users.
Mistakes are there to make.
But may I ask to tag the topics that you started with [SOLVED] when considered as such?
Simply edit the title of your initial post.
Also see your topic on: Changing the lineweight.
In total a topic or 10.
Regards,
CVH