JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. paul a golder
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 4
    • Best 1
    • Controversial 0
    • Groups 0

    paul a golder

    @paul a golder

    1
    Reputation
    1
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    paul a golder Unfollow Follow

    Best posts made by paul a golder

    • Help me understand the structure of a project.

      I have installed the offline version on a Ubuntu 20 machine and can run examples, but find I am not clear how to organise my files and create shared libraries. Do the all have to be within
      /usr/local/lib/node_modules/@jscad ?
      How would I re-locate to a user area /~paul/development/jscad... for example?

      Any help welcome.

      posted in General Discussions
      paul a golder
      paul a golder

    Latest posts made by paul a golder

    • RE: Help me understand the structure of a project.

      @gilboonet I ran into a simple problem, the selection order of the downloaded files matters. I was not getting the same result as you as my files had different names and in my file selector appear in the reverse order. When I made the file selector do a reverse ordering of filenames and then completed the drag and drop I achieved the same result as you. Thanks again.

      posted in General Discussions
      paul a golder
      paul a golder
    • RE: Help me understand the structure of a project.

      @gilboonet Thanks very much for the example I think I can see my way forward. I like the integration with Geany, another thing for me to try, currently I use Kate

      posted in General Discussions
      paul a golder
      paul a golder
    • RE: Help me understand the structure of a project.

      Thanks for the reply.

      I am trying the drag-n-drop folder approach with a simple two file example.

      ====
      file one - test.jscad

      include ("./tube.js");
      function main() {
        var atube = tube(100,32,30);
        return atube;
      }
      

      ======

      ========
      file two tube.js ( or tube.jscad)

      function main(params) {
        var atube = tube(params.length,params.outerdiameter,params.innerdiameter);
        return atube;
      }
      
      function getParameterDefinitions() {
        return [
          { name: 'outerdiameter', caption: 'Outer Diameter:', type: 'float', default: 10 },
          { name: 'innerdiameter', caption: 'Inner Diameter:', type: 'float', default: 8 },
          { name: 'length', caption: 'length:', type: 'float', default: 20 },
        ];
      }
      
      function tube(len, od,id)
      {
      var ocylinder = CSG.cylinder({
        start: [0, -len/2, 0],
        end: [0, +len/2, 0],
        radius: od/2,
        resolution: 40       // optional
      });
      var icylinder = CSG.cylinder({
          start: [0, -len/2, 0],
        end: [0, +len/2, 0],
        radius: id/2,
        resolution: 40       // optional
      });
      var cylinder = ocylinder.subtract(icylinder);
      return cylinder;
      }
      

      ============

      These are both in the same directory in my user area. I dragged the directory to the OpenJSCAD.org interface and the result is :

      ReferenceError: tube is not defined
      Line: 124,col: 0
      (blob:https://openjscad.org/d80c6540-7a94-4c8f-b319-51dc761194f2 line 43 > Function)
      

      I am anyway puzzled as to how the interpreter knows which file is the Main one to execute.

      I have tried with Firefox 79 for Ubuntu and Chromium Version 84.0.4147.105 (Official Build) Built on Ubuntu , running on Ubuntu 18.04 (64-bit) with the included file both as .js and as .jscad

      posted in General Discussions
      paul a golder
      paul a golder
    • Help me understand the structure of a project.

      I have installed the offline version on a Ubuntu 20 machine and can run examples, but find I am not clear how to organise my files and create shared libraries. Do the all have to be within
      /usr/local/lib/node_modules/@jscad ?
      How would I re-locate to a user area /~paul/development/jscad... for example?

      Any help welcome.

      posted in General Discussions
      paul a golder
      paul a golder