Beginner Questions



  • @z3dev Ok, I just wondered if I was missing something.

    Personally it seems a shame that the defaults are tied to the parameters function instead of where they should be ie:

    const main = ({radius=10}) => { }
    // or
    const main = (radius=10)  => {}
    // etc
    

    But how that would work with parameter definitions is a another thing...



  • @Dunk-Fordyce said in Beginner Questions:

    Also:

    • how can I use the parameter defaults from another file? It seems getParameterValuesFromParameters should be exposed somewhere?

    There are several ways but no general practice. I'm porting a project which has several designs for gears (very nice designs). And here's one way to put those together into one BIG design.

    const bevelParams = require('./bevelGear').getParameterDefinitions
    const bevelGear = require('./bevelGear').main
    
    // combine parameters definitions
    
    const getParameterDefinitions = () => {
      const definitions = [
      ]
      // bevel gear parameters
      definitions.push({ name: 'bevelGear', type: 'group', caption: 'Bevel Gear' })
      definitions.push(...bevelParams())
      return definitions
    }
    
    const main = (params) => {
      return bevelGear(params)
    }
    
    module.exports = { main, getParameterDefinitions }
    


  • @Dunk-Fordyce said in Beginner Questions:

    I understand how the project structure is meant to be now but is there, or could there be, a template git repo with the correct files included for linting and other nice to have things?

    If I understand correctly, a template for new design projects. Nice idea!

    Just clone and go. 😎

    Maybe a new project on the JSCAD community would be a good place for this.



  • @Dunk-Fordyce said in Beginner Questions:

    i want to add a vector type to the params, is there anything wrong with adding that into packages/web/src/ui/views/parameterControls.js or are your vue controls about to make it obsolete?

    Interesting. Nothing is planned for the parameters, except some re-factoring of code. A new type of parameter would be fine if it works across CLI/WEB applications.



  • @Dunk-Fordyce said in Beginner Questions:

    will you support js import/export statement instead of require?

    Definitely. Browsers (and Node) are moving forward with import/export, and JSCAD will follow.



  • @Dunk-Fordyce said in Beginner Questions:

    whats happening with the vue components I've seen in your vue-components repo ( I like vue )

    Excellent! I will be maintaining those going forward, but would appreciate any assitance or comments. I'm just a Vue beginner, and probably have a whole lot wrong.



  • Also:

    • how can I use the parameter defaults from another file? It seems getParameterValuesFromParameters should be exposed somewhere?


  • Ok, I have the following questions, is here appropriate to ask?

    • whats happening with the vue components I've seen in your vue-components repo ( I like vue )
    • will you support js import/export statement instead of require?
    • i want to add a vector type to the params, is there anything wrong with adding that into packages/web/src/ui/views/parameterControls.js or are your vue controls about to make it obsolete?
    • I understand how the project structure is meant to be now but is there, or could there be, a template git repo with the correct files included for linting and other nice to have things?


  • @Dunk-Fordyce said in Beginner Questions:

    @z3dev Thanks!

    This works great!

    Is there a discord or slack or even IRC channel for jscad?

    Not that I know about.



  • @z3dev Thanks!

    This works great!

    Is there a discord or slack or even IRC channel for jscad?



  • @Dunk-Fordyce Sorry. I forgot to mention that the auto-reload function works really welcome with Chrome.

    Just enable Auto-reload then drag and drop a file or a folder (project). Any changes will automatically be detected and reloaded.



  • @Dunk-Fordyce Welcome!

    A great question!
    The management of projects is getting better in V2, and you can find more information on the V2 User Guide. See the Projects section.

    (It’s been work in progress so please make changes!)


Log in to reply