JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D designs with JavaScript code. It provides a quick, precise and reproducible method for generating 3D models, and is especially useful for 3D printing applications.
This PR changes vectorText and vectorChar to have the first arg be a requiredoptions = {} parameter.
Why?
I don't like having a function signature that changes based on the inputs
there shouldn't be two different ways to pass input (either as 2nd arg, or as input field in options)
jsdoc doesn't like options having type object|string
no other functions in JSCAD work like this
vectorParams was used to handle these quirks, I removed it
I will admit that it was kind of nice to be able to just write vectorText('string') and now you would need to do vectorText({}, 'string'). But the same thing could be said about any operation with default options, like extrudeLinear for example. I think it's better to be explicit about requiring options.
I don't really feel that strongly about this particular issue. But if we're going to make API changes, now is the time to do it for V3. Let me know what you guys think.
All Submissions:
[x] Have you followed the guidelines in our Contributing document?
[x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
This PR changes
vectorText
andvectorChar
to have the first arg be a requiredoptions = {}
parameter.Why?
input
field in options)object|string
vectorParams
was used to handle these quirks, I removed itI will admit that it was kind of nice to be able to just write
vectorText('string')
and now you would need to dovectorText({}, 'string')
. But the same thing could be said about any operation with default options, likeextrudeLinear
for example. I think it's better to be explicit about requiring options.I don't really feel that strongly about this particular issue. But if we're going to make API changes, now is the time to do it for V3. Let me know what you guys think.
All Submissions: