Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to add a simple resize tool. #1777

Closed
NabilAKROUD opened this issue May 10, 2024 · 13 comments
Closed

Request to add a simple resize tool. #1777

NabilAKROUD opened this issue May 10, 2024 · 13 comments
Labels
feature request A request for new functionality or behavior implemented A feature that has been completed

Comments

@NabilAKROUD
Copy link

NabilAKROUD commented May 10, 2024

Expected behavior

I miss a tool to RESIZE objects by selecting, for example, two points: the initial and the final.
I created a simple shape in PowerPoint imagining how it should work.
The tool would greatly simplify the work when the drawing is too large and would avoid using cross your heart method , which always leaves much to be desired.

Operating System and LibreCAD version info

Any

Resizing.tool.LC.mp4
@lordofbikes
Copy link
Member

This is exactly, what Modify - Scale does.
https://docs.librecad.org/en/2.2.0_a/ref/tools.html?highlight=scale#modify

@dxli dxli added implemented A feature that has been completed feature request A request for new functionality or behavior labels May 12, 2024
@NabilAKROUD
Copy link
Author

Thanks for your quick response,
I've been trying to figure out how to scale from a REF point to a TARGET point and am not getting any satisfactory results.
unlike the [Move/Copy Tool] which asks for two points REF and TARGET, the [Scale Tool] always asks for a REF point and a scale FACTOR. To get that FACTOR I use the [Point to Point Distance tool] tool to get the FACTOR (e.g. 60.186/60.162) but I always have a small mismatch.

Thank you and sorry for the inconvenience if I'm not doing things right.

@lordofbikes
Copy link
Member

Sorry, my bad. Seems I've mixed up things, Rotate works this way, with two points, I'd expected, that Scale works the same way. Or maybe it was changed in the past and my memories fooled me.
Now that I've tried myself, I can confirm, that Scale only works with one reference point and the options dialog.

But this cuts both ways, for the Rotate tool we have regularly requests to change it to use one reference only, because entering the parameter in the dialog is more accurate.

@lordofbikes lordofbikes removed the implemented A feature that has been completed label May 13, 2024
@NabilAKROUD
Copy link
Author

Thank you again @lordofbikes,
I understand well your perspective that the use of the options dialog is much more practical in case of working with numbers, but when it comes to geometric shapes with irregular fractions I think that with two points (ref, target) it would greatly simplify the drawing.
I leave here a DXF example file where it is very difficult for me to scale and match the two objects with the options dialog.

Scale Req.zip

While waiting for the implementation of the new features, I continue using the available tools.
Thanks to you and the entire team for the wonderful work.

image

@dxli
Copy link
Member

dxli commented May 13, 2024

@NabilAKROUD

We can add a button to the scale dialog, so the end user can select a reference and a target point to fill the numbers automatically.

@NabilAKROUD
Copy link
Author

It would help.
Thanks ☺️

@dxli
Copy link
Member

dxli commented May 14, 2024

I am in the process of implementation, but looks like I get a busy week ahead. Will try to get it work by this weekend.

dxli added a commit that referenced this issue May 15, 2024
Issue #1777:

Experimental feature: for the scaling tool, allow to specify a source
point and a target point, so the scaling would scale the source to the
target point.

If the coordinate difference from the scaling center is zero in any
direction(x- or y-), no scaling is applied in that direction.

Negative factors are allowed, and this may not work well with all entity
types.
@dxli
Copy link
Member

dxli commented May 15, 2024

The implementation is ready for testing.

I think we should set the relative zero to the scaling center when selecting the source and target points.

A button is added next to the factor input fields. If you gets a better icon for the button, please upload an SVG version here, or create a pull request.

@dxli
Copy link
Member

dxli commented May 15, 2024

Question: do we need to consider maintaining aspect ratio(isotropic) in the new methods?

If the x/y lead to different factors, it's not clear on which one to use, if isotropic scaling is intended

@NabilAKROUD
Copy link
Author

Great question 🤔
To avoid losing functionality in the unforeseen future, I would leave both tools, that is, implement the new resize tool without removing the current one.
... and then if it is seen that the current one is redundant during beta testing, it would be removed before releasing the stable version.

@dongxuli-concord-design
Copy link
Contributor

dongxuli-concord-design commented May 15, 2024

That's not actually my question.

My question is:

1, if user chooses isotropic scaling in dialog, then click "find factors";
2, user selects source and target points.

Currently, the isotropic selection is ignored, if points lead to different scaling factors in xy- directions.

To improve:

If isotropic scaling is set, the target selection is limited on the line by the center and the source points;

Some minor issues: avoid selecting the center as source or target;

More improvement: allow selecting two source points and two target points (by auto selection xy- directions of the scaling), so the scaling is defined by points not by the current coordinate system. The overall effect, rotate to one direction, scale by xy-factors, rotate it back.

dxli added a commit that referenced this issue May 15, 2024
 For scaling by points:
1. support isotropic scaling;
2. avoid selecting the scaling center as source or taget;
3. move relative zero to the scaling center.
@dxli dxli added the implemented A feature that has been completed label May 15, 2024
dxli added a commit that referenced this issue May 16, 2024
@NabilAKROUD
Copy link
Author

NabilAKROUD commented May 16, 2024

What this tool does is incredible 🤩.
It does exactly what I was looking for and more.
thank you!!!!!

image

Regarding your Question,
If I understand it correctly,
Perhaps to resolve it, it would be good to follow (for example) the same sequence as that of the Rotation tool, that is, firstly start with a Ref and Target points and leave the Dialog box until the END of the operation where it would be retrieved and shown the scale ratio between the two points and where the following choices also come:

  • Delete original
  • Keep original
  • Multiple copies

@dxli
Copy link
Member

dxli commented May 18, 2024

Hi @NabilAKROUD,

The current behavior is chosen so based on the easiest for implementation by reusing the current "scale" method, so there's no change to previous scaling workflow for scaling by ratios, where a reference point is not necessary.

It's interesting to investigate how to provide behaviors for other transforms:

1, isometrics (translation, rotation, and mirroring) by reference and target;
2, other offline transforms: scale, shear, perspective, etc.

@dxli dxli closed this as completed May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A request for new functionality or behavior implemented A feature that has been completed
Projects
None yet
Development

No branches or pull requests

4 participants