-
Notifications
You must be signed in to change notification settings - Fork 30
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
basiljs gets points! #268
basiljs gets points! #268
Conversation
- 4 new point based functions: createOutlines(), addPoints(), points(), pointsInPaths() - w/ initial research by @kajetansom on point getting and interpolating, extended to handle live type, multi-line type, pageitems, etc. - built upon outline pseudocode from @fabianmoronzirfas on issue #100
Nice. I'm a bit behind on my reviews lately. Maybe @trych finds some time soonisher then me. |
Sweet! Can't make any promises, but will try to have a look at it soon! |
Ok, here we go. Sorry, quite a lot of points, but it would be great to get this right, I really like the new functions! :) General
createOutlines
addPoints
points, pointsInPaths
optional extras, nice to have
|
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.
Needs some changes, see my comments above.
Did you see these conflicts? for math.js? |
Thanks @trych for all the comments above. Indeed, did something weird in Sublimetext and it formatted the whole math.js doc, so I'll re-do it. Git-noob.. do I need to cancel this pull, or can I simply modify it? Re: Try/Catch, what is the problem with them? While I should also include the native InDesign error message, I found it better to offer some advice when the error occurred.. in testing, if somehow the wrong item was passed in one of those steps, sometime Indesign just said 'nope' – rather than articulating what was wrong.. that's where our catch and error message can help. What's a suggested alternative? |
It's just not very clean coding and a bit like "let the user do their stuff and see what happens" instead of planning it carefully and do proper checking of inputs. And as it stands right now (without the native InDesign error message) it is even more confusing, because I might get a error message like Instead I would – as it is done in most basil functions currently – carefully check by code for each condition that needs to be fulfilled to use the function. That means first check, if the correct type of object was passed. If not give a helpful basil error. This error should avoid most further errors right away. Then, if necessary, check if the object has a path (or whatever your function needs). If not, give a helpful basil message. And so on. Right now there are quite a few ways to "break" the functions and get caught in the try/catch statement. If there is proper check of the inputs, that could be avoided. Does that explanation help? If not, let me know, I might find some time to put together an example for one of the functions.
I think the cleanest would be to actually cancel this PR and prepare a new one, else all these formatting changes back and forth would end up in the git history. Would that be okay for you? Edit: Also, since I merged the bounds() PR in the meantime, there is now a merge conflict. So if you would do a new PR, you could (beforehand) merge the develop branch to be up-to-date and to avoid this conflict as well. |
Closed! Replaced by a much better set of functions in #352 – integrating the helpful suggestions above. Tested it against so many scenarios.. should be quite safe now... and no try/catch! |
createOutlines()
,addPoints()
,points()
,pointsInPaths()
createOutlines()
built upon outline pseudocode from @fabianmoronzirfas on issue Convert text to path #100Some sample code for the new functions: