-
Notifications
You must be signed in to change notification settings - Fork 1
Draft of displaced center. #1
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
base: main
Are you sure you want to change the base?
Draft of displaced center. #1
Conversation
|
Hi @nicolau-manubens, thanks for the PR! The input range component wasn't designed to handle float values, so I just extended it, please find my change in the I also noticed couple of syntax issues that prevented app from being built, please find them in inline comments. To setup the repo and run the app, feel free to consult the Thanks again! |
src/components/Main.vue
Outdated
| v-model="paramX" | ||
| v-bind:min="-0.99" | ||
| v-bind:max="0.99" | ||
| setp="0.01" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prop name is step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, please bind the float value so it's correctly passed to the component (see min/max above).
src/components/Main.vue
Outdated
| v-model="paramY" | ||
| v-bind:min="-0.99" | ||
| v-bind:max="0.99" | ||
| setp="0.01" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prop name is step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, please bind the float value so it's correctly passed to the component (see min/max above).
| while (i <= n_points / 2) { | ||
| const theta = alpha * i; | ||
| const xc1 = Math.cos(theta) * r; | ||
| const yc2 = Math.sin(theta) * r; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable is unused?!
| // for each point, find line y = m*x + n passing by (0,0) and (x,y) | ||
| const n = 0; | ||
| const m = (yc1 - n) / xc1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yc1 is undefined, perhaps it should be yc2 defined above?
| }, | ||
| computed: { | ||
| circlePoints () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The circlePoints computed property should return circle points sorted in logical order, because linePoints depends on that. At the moment the final result is somewhat unexpected, because lines are not correctly drawn. You can check this out by running the generator on the unmodified code, and then comparing its output with your branch, when the center x/y displacement is 0/0 (should result in the same image).
|
Thanks @dvuckovic! I will address all that when I have the chance. |
b4d6dbc to
f586e6c
Compare
Some draft code for drawing string arts with a displaced center.