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

Predefined objects and :draw action #350

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Sov-trotter
Copy link
Member

@Sov-trotter Sov-trotter commented Jun 23, 2021

PR Checklist

If you are contributing to Javis.jl, please make sure you are able to check off each item on this list:

  • Did I update CHANGELOG.md with whatever changes/features I added with this PR?
  • Did I make sure to only change the part of the file where I introduced a new change/feature?
  • Did I cover all corner cases to be close to 100% test coverage (if applicable)?
  • Did I properly add Javis dependencies to the Project.toml + set an upper bound of the dependency (if applicable)?
  • Did I properly add test dependencies to the test directory (if applicable)?
  • Did I check relevant tutorials that may be affected by changes in this PR?
  • Did I clearly articulate why this PR was made the way it was and how it was made?

Link to relevant issue(s)
Closes #218 #313

How did you address these issues with this PR? What methods did you use?
This implements the appear{:draw} method and predefines the (args...) -> ... declaration for some basic shapes.
The medata implementation here is temporary as I store everything in a Dict in the object.result field.

TEST SCRIPT: https://gist.github.com/Sov-trotter/2df6181fd2ca2d2f121ecd7be490c2aa

@Sov-trotter Sov-trotter marked this pull request as draft June 23, 2021 11:49
@Sov-trotter Sov-trotter changed the title Predefined objects and new actions Predefined objects and :draw action Jun 23, 2021
@Sov-trotter
Copy link
Member Author

ease_pos_test
I have been thinking of having :draw action for a bunch of basic shapes. Obviously the methods for each differ quite alot.
What other basic shapes can we include @TheCedarPrince @Wikunia both for :draw and object declarations?

@Wikunia
Copy link
Member

Wikunia commented Jun 24, 2021

The idea was to be able to use this for all polygons such that the user can write something like the space filling curve in #218 by simply using line functions inside a user defined function.

@Sov-trotter
Copy link
Member Author

Sov-trotter commented Jun 30, 2021

There are a few things here:

  • The current way of drawing lines and circles is quite hacky. For a line I have just drawn it from point to point(using the get_interpolation) method.
  • For a circle, I have created a clipping mask using a pi and increased it's angle according to the interpolation factor.
  • Now we can go on creating drawing actions for different shapes. But what we really want to do it beable to do that for any polygon for that matter. https://juliagraphics.github.io/Luxor.jl/stable/polygons/#Luxor.polyportion is what we need to look at and bridge it with the interpolation factor. To get increasing portions of any polygon iteratively
  • Also the predefined objects(shorthands.jl) can be removed since they will be a part of a separate PR

@Wikunia Wikunia changed the base branch from master to main February 25, 2022 18:38
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

Successfully merging this pull request may close these issues.

Drawing a shape line by line
2 participants