RBox.grow() and RBox.growXY() grow X only?

Please use this forum to post feedback and suggestions related to QCAD.

Moderator: andrew

Post Reply
mrhickman53
Active Member
Posts: 25
Joined: Thu Sep 07, 2023 1:17 am
Location: USA

RBox.grow() and RBox.growXY() grow X only?

Post by mrhickman53 » Wed Nov 20, 2024 2:25 pm

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.

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

Re: RBox.grow() and RBox.growXY() grow X only?

Post by CVH » Wed Nov 20, 2024 3:06 pm

This is rather a post for the QCAD Programming, Script Programming and Contributing forum.
Or in general for the QCAD Troubleshooting and Problems forum.
mrhickman53 wrote:
Wed Nov 20, 2024 2:25 pm
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.
Strange ... Run the next code in the Script Shell (GE):

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();
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. :wink:

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?

Post by mrhickman53 » Wed Nov 20, 2024 11:04 pm

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.

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

Re: RBox.grow() and RBox.growXY() grow X only?

Post by CVH » Thu Nov 21, 2024 8:37 am

Hi,
You don't need to apologize, we are here to help other users.
Mistakes are there to make. :wink:

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. :wink:

Regards,
CVH

Post Reply

Return to “QCAD Suggestions and Feedback”