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

Mirror a shape with respect to custom axis #1689

Open
vikkyjain2013 opened this issue Dec 18, 2023 · 2 comments
Open

Mirror a shape with respect to custom axis #1689

vikkyjain2013 opened this issue Dec 18, 2023 · 2 comments

Comments

@vikkyjain2013
Copy link

I went through the konva documentation regarding mirror a shape.
Currently i believe we can mirror a shape on x-axis or y-axis. In that case, it is mirrored with respect to 0,0 origin point.
Then i can use offset to mirror a shape from a custom origin point.

My requirement is bit different. Assume, there are n number of axis in 2d model. lets say one axis at every 5 degree angle from origin point. I want to mirror a shape from those axis. My mirror functionality should not be limited to x or y axis. if i can pass a angle, offset and shape, it should mirror the shape through that axis which will be drawn on that angle from origin.

Please see below image created, where i want to rotate the rectangle shape through purple axis.

axis

@lavrton
Copy link
Member

lavrton commented Dec 18, 2023

Did you try anything? I don't think there is anything specific to the Konva. Just some math calculations.

@vikkyjain2013
Copy link
Author

I was thinking if konva have inbuilt method for this just like scaleX or scaleY. If not, then i need to search for math calculations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants