How do I snap to two points or push together objects

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
mathcubes
Junior Member
Posts: 21
Joined: Fri Feb 24, 2023 11:47 pm

How do I snap to two points or push together objects

Post by mathcubes » Sat Feb 25, 2023 12:10 am

Hello guys, like what the title says how do I snap to two points or is there collision detection to push objects together without gaps in Qcad? And if not then what is the best way to go about it?
To give you a gasp on what I am trying to do. Here are the some examples but read them in order

1st example, in this screenshot now I inserted some squares at various angles and tried to line them up. For the first role that was simple but for the second. I can get them to perfectly touch one but not the other. I guess the workaround would be to resist the movement to one angle of the line in which it touch to align it up to the other.
Image
Image

2nd example, lets say I want to do the same thing with circles…. I have no clue what work around would be.
Image

3rd example, between these two circles lets say I needed a line with a length of two, now mathematically a place should exist. Now, I can align it to one but I can not align unless I move it but than that would of course throw off the first point. Perhaps if it was a slight lines there would be a simple mathematical formula I could use.
Image
Image

I draw up designs which they resembles diagrams which also require I get it correct. Simply if I was drawing on it on a sheet of paper I could just simply cut out the shapes and push them together. It’s should logically be easy to do and is quite intuitive but I have no idea on how to actually do it.

Any ideas?

---

Background to this, I just downloaded Qcad a few hours and I couldn't figure it out. I come form Adobe Illustrator but it has a weird quirk where nothing is precise. For example, you can have a 2 what-ever-unit square then make it 100x scale then for some reason it's 200.38 or something like that. I deal with modular design some of which can be complex and I make everything precise but then it doesn't align up with each other or like you can get it on a 45 degree angle and some of the intersecting paths would than go slightly pass it or before or its slightly screws up the angle which throws off the modular design. I know other vector editing programs do not have the problem with scale like Affinity Designer but I never test it with alignment. I was just told it was due to how the back-end works with vector that there is nothing I can do about it as everything is just highly approximated. Hints on why I want to switch because I actually want to have the ability to have it scale and as close to perfect as reasonable.

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

Re: How do I snap to two points or push together objects

Post by CVH » Sat Feb 25, 2023 4:21 am

mathcubes,

Hi and welcome to the forum.
QCAD is vector based and that would be as precise as possible and scaled just the same.
On how precise that is and on how certain a number in 64 bit floating point really is we can write a book or two.
For instance, the value 0.1000... can't be expressed exactly in floating point but it will be very very close to 0.1 in binary.
But that will never induce an error in the region of 0.19% like your Adobe Illustrator example.


I have to admit I needed to read your topic more than twice to get a glimpse of what you're at.
There is nothing as collision detection implemented in QCAD.
To start with, nothing in line-art or even hatched 'solid' is considered as a solid.
For that you need a high-end (expensive) parametric application that works with solid shapes.

For the circle problem I think it is easy.
A circle with a certain radius touching two other circles can be drawn with Draw .. Circle .. Two Tangents and Radius (CTR).
And for two circles that are 2 units apart the distance between the centers is 2R+2 or R1+R2+2 with unequal radii.
Or meaning that center 2 would lie on a circle with radius R1+2 around center 1 and vice versa.
The intersection of 2 construction circles will give you none, one or two exact solutions.
The same goes for touching what is zero units apart.

In your circle example there are some places where one should roll over another until it touches a third circle.
Rolling is keeping the center distance steady ... A construction circle radius = R1+R2.
Touching is again a certain center distance ... A second construction circle radius = R2+R3.
Where they intersect you can place circle 2 its center.

Or you could draw a CTR circle tangent to a circle and a construction circle that is 2 units wider than the other intended.

That should be perfect when measured up although it may display incorrect at extreme high zoom.
The reason here is that curved lines are displayed interpolated ... segmented.
At a certain zoom state touching curved shapes seems to drift apart, but they still touch mathematical.

For the squares it is less simple.
Just because they have corners sticking out. :lol: :wink:
Again this requires construction lines and QCAD has several tool for that.
But here we talk about sliding a corner along a face (= line) until another corner meets another face.
I would solve this by a parallel of the face trough the other corner with Draw .. Line .. Parallel (trough Point) (LG).
Then it is a question of moving the shape from one reference to another with Modify .. Move/Copy (MV)
Select the square to move, type MV, not copy or delete original, from point A to point B.

mathcubesProblem.png
mathcubesProblem.png (6.08 KiB) Viewed 6481 times

And of course, every problem will have several unique solutions and several ways to solve them. :wink:
Rotating a square around a corner so another corner meets a face requires a construction circle around the corner trough the second corner.
Then you can rotate the shape around the corner so the the other corner is where the circle meets the face.
Hint: In that case you define the angles with the mouse cursor (not by value), that is the pointer button beside the angle field in the dialog.

Rather curious in what math is done on the cubes e_geek (... mathcubes)

Regards,
CVH

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 5054
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: How do I snap to two points or push together objects

Post by Husky » Sat Feb 25, 2023 7:07 am

mathcubes wrote:
Sat Feb 25, 2023 12:10 am
1st example, in this screenshot now I inserted some squares at various angles and tried to line them up. For the first role that was simple but for the second. I can get them to perfectly touch one but not the other. I guess the workaround would be to resist the movement to one angle of the line in which it touch to align it up to the other.
You are correct. Use a Construction circle to find the perfect snap point for rotation. Something like this example video ...

Rotate rectangle.gif
Rotate rectangle.gif (1.23 MiB) Viewed 6463 times

... or for just a parallel move within an other rectangle this will do it:

slide rectangle.gif
slide rectangle.gif (1.1 MiB) Viewed 6463 times

mathcubes wrote:
Sat Feb 25, 2023 12:10 am
2nd example, lets say I want to do the same thing with circles…. I have no clue what work around would be.
The circle tools should cover that. Please check those tools below Draw/Circle

Husky-2023.02.24-02.png
Husky-2023.02.24-02.png (5 KiB) Viewed 6463 times
mathcubes wrote:
Sat Feb 25, 2023 12:10 am
3rd example, between these two circles lets say I needed a line with a length of two, now mathematically a place should exist. Now, I can align it to one but I can not align unless I move it but than that would of course throw off the first point. Perhaps if it was a slight lines there would be a simple mathematical formula I could use.
If I understand this correctly then a construction circle can help you again. The first point is fixed and you can snap to the one or two other points to keep the line to two units.

2 mm connection.gif
2 mm connection.gif (1.07 MiB) Viewed 6463 times

If it need to be perpendicular to one circle rotate the 2 unit line again with help of an circle ...

Rotate 2 mm.gif
Rotate 2 mm.gif (1.19 MiB) Viewed 6463 times
mathcubes wrote:
Sat Feb 25, 2023 12:10 am
I come form Adobe Illustrator but it has a weird quirk where nothing is precise. For example, you can have a 2 what-ever-unit square then make it 100x scale then for some reason it's 200.38 or something like that.
There is a reason why it is called "Illustrator". :wink: CAD is meant for precision ...

However - there are many ways to skin a cat. Bottom line, the more QCAD tools you know the more easier becomes your job ...
Work smart, not hard: QCad Pro
QcadPro, QcadCam, Win11/64, 64GB RAM, 10-Core, SSD
If a thread is considered as "solved" pls. change the title of the 1. post to "[solved] Title..."

mathcubes
Junior Member
Posts: 21
Joined: Fri Feb 24, 2023 11:47 pm

Re: How do I snap to two points or push together objects

Post by mathcubes » Sun Feb 26, 2023 4:47 am

Thanks. I actually thought it might have been impossible.

Your answer is very good and so thanks for taking out your time.

Math

mathcubes
Junior Member
Posts: 21
Joined: Fri Feb 24, 2023 11:47 pm

Re: How do I snap to two points or push together objects

Post by mathcubes » Sun Feb 26, 2023 4:50 am

CVH wrote:
Sat Feb 25, 2023 4:21 am
mathcubes,

Hi and welcome to the forum.
QCAD is vector based and that would be as precise as possible and scaled just the same.
On how precise that is and on how certain a number in 64 bit floating point really is we can write a book or two.
For instance, the value 0.1000... can't be expressed exactly in floating point but it will be very very close to 0.1 in binary.
But that will never induce an error in the region of 0.19% like your Adobe Illustrator example.


I have to admit I needed to read your topic more than twice to get a glimpse of what you're at.
There is nothing as collision detection implemented in QCAD.
To start with, nothing in line-art or even hatched 'solid' is considered as a solid.
For that you need a high-end (expensive) parametric application that works with solid shapes.

For the circle problem I think it is easy.
A circle with a certain radius touching two other circles can be drawn with Draw .. Circle .. Two Tangents and Radius (CTR).
And for two circles that are 2 units apart the distance between the centers is 2R+2 or R1+R2+2 with unequal radii.
Or meaning that center 2 would lie on a circle with radius R1+2 around center 1 and vice versa.
The intersection of 2 construction circles will give you none, one or two exact solutions.
The same goes for touching what is zero units apart.

In your circle example there are some places where one should roll over another until it touches a third circle.
Rolling is keeping the center distance steady ... A construction circle radius = R1+R2.
Touching is again a certain center distance ... A second construction circle radius = R2+R3.
Where they intersect you can place circle 2 its center.

Or you could draw a CTR circle tangent to a circle and a construction circle that is 2 units wider than the other intended.

That should be perfect when measured up although it may display incorrect at extreme high zoom.
The reason here is that curved lines are displayed interpolated ... segmented.
At a certain zoom state touching curved shapes seems to drift apart, but they still touch mathematical.

For the squares it is less simple.
Just because they have corners sticking out. :lol: :wink:
Again this requires construction lines and QCAD has several tool for that.
But here we talk about sliding a corner along a face (= line) until another corner meets another face.
I would solve this by a parallel of the face trough the other corner with Draw .. Line .. Parallel (trough Point) (LG).
Then it is a question of moving the shape from one reference to another with Modify .. Move/Copy (MV)
Select the square to move, type MV, not copy or delete original, from point A to point B.


mathcubesProblem.png


And of course, every problem will have several unique solutions and several ways to solve them. :wink:
Rotating a square around a corner so another corner meets a face requires a construction circle around the corner trough the second corner.
Then you can rotate the shape around the corner so the the other corner is where the circle meets the face.
Hint: In that case you define the angles with the mouse cursor (not by value), that is the pointer button beside the angle field in the dialog.

Rather curious in what math is done on the cubes e_geek (... mathcubes)

Regards,
CVH
Thanks.... It was just the name I came up with for my own self when I was 9 or so. I just like it and so it sticks. I was obsessed with math and cubes were and still are my polyhedron... So I just put them together. With hindsight math isn't the best idea because I got now kids asking me to help them with their math homework or correct me with the 'spelling' because for them it's should have a 's' at the end.... I just say work smarter not harder, just use a calc or program something which helps you.

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

Re: How do I snap to two points or push together objects

Post by CVH » Sun Feb 26, 2023 5:05 am

mathcubes wrote:
Sun Feb 26, 2023 4:47 am
Thanks. I actually thought it might have been impossible.
Many things seems to be impossible until solved. :wink:

BTW: You can quote an individual line or part of text with selecting it before hitting the quote button ...
... But not while re-editing your post.

Regards,
CVH

Post Reply

Return to “QCAD 'How Do I' Questions”